void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(2); S.StartStatic(_("Temporary files directory")); { S.StartMultiColumn(3, wxEXPAND); { S.SetStretchyCol(1); S.Id(TempDirID); mTempDir = S.TieTextBox(_("&Location:"), wxT("/Directories/TempDir"), wxT(""), 30); S.Id(ChooseButtonID); S.AddButton(_("C&hoose...")); S.AddFixedText(_("Free Space:")); mFreeSpace = S.AddVariableText(wxT("")); } S.EndMultiColumn(); } S.EndStatic(); #ifdef DEPRECATED_AUDIO_CACHE // See http://bugzilla.audacityteam.org/show_bug.cgi?id=545. S.StartStatic(_("Audio cache")); { S.TieCheckBox(_("Play and/or record using &RAM (useful for slow drives)"), wxT("/Directories/CacheBlockFiles"), false); S.StartTwoColumn(); { S.TieNumericTextBox(_("Mi&nimum Free Memory (MB):"), wxT("/Directories/CacheLowMem"), 16, 9); } S.EndTwoColumn(); S.AddVariableText(_("If the available system memory falls below this value, audio will no longer\nbe cached in memory and will be written to disk."))->Wrap(600); } S.EndStatic(); #endif // DEPRECATED_AUDIO_CACHE }
void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(2); S.StartStatic(_("Temporary files directory")); { S.StartMultiColumn(3, wxEXPAND); { S.SetStretchyCol(1); S.Id(TempDirID); mTempDir = S.TieTextBox(_("Location:"), wxT("/Directories/TempDir"), wxT(""), 30); S.Id(ChooseButtonID); S.AddButton(_("Choose...")); S.AddFixedText(_("Free Space:")); mFreeSpace = S.AddVariableText(wxT("")); } S.EndMultiColumn(); } S.EndStatic(); S.StartStatic(_("Audio cache")); { S.TieCheckBox(_("Play and/or record using RAM (useful for slow drives)"), wxT("/Directories/CacheBlockFiles"), false); S.StartTwoColumn(); { S.TieTextBox(_("Minimum Free Memory (MB):"), wxT("/Directories/CacheLowMem"), 16, 9); } S.EndTwoColumn(); S.AddVariableText(_("If the available system memory falls below this value, audio will no longer\nbe cached in memory and will be written to disk."))->Wrap(600); } S.EndStatic(); }
/// This PopulateOrExchange function is a good example of mixing the fully /// automatic style of reading/writing from GUI to prefs with the partial form. /// /// You'll notice that some of the Tie functions have Prefs identifiers in them /// and others don't. void LibraryPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(2); S.StartStatic(_("MP3 Export Library")); { S.StartTwoColumn(); { S.AddVariableText(_("MP3 Library Version:"), true, wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL); mMP3Version = S.AddVariableText(wxT("9.99"), true, wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); S.AddVariableText(_("MP3 Library:"), true, wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL); wxButton *locate_button = S.Id(ID_MP3_FIND_BUTTON).AddButton(_("&Locate..."), wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); S.AddVariableText(_("LAME MP3 Library:"), true, wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL); wxButton *download_button = S.Id(ID_MP3_DOWN_BUTTON).AddButton(_("&Download"), wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); #ifdef DISABLE_DYNAMIC_LOADING_LAME locate_button->Enable(FALSE); download_button->Enable(FALSE); #else (void)locate_button; (void)download_button; #endif // DISABLE_DYNAMIC_LOADING_LAME } S.EndTwoColumn(); } S.EndStatic(); S.StartStatic(_("FFmpeg Import/Export Library")); { S.StartTwoColumn(); { S.AddVariableText(_("FFmpeg Library Version:"), true, wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL); #if defined(USE_FFMPEG) mFFmpegVersion = S.AddVariableText(_("No compatible FFmpeg library was found"), true, wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); #else mFFmpegVersion = S.AddVariableText(wxT("FFmpeg support is not compiled in"), true, wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); #endif S.AddVariableText(_("FFmpeg Library:"), true, wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL); S.Id(ID_FFMPEG_FIND_BUTTON); wxButton *bfnd = S.AddButton(_("Loca&te..."), wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); S.AddVariableText(_("FFmpeg Library:"), true, wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL); S.Id(ID_FFMPEG_DOWN_BUTTON); wxButton *bdwn = S.AddButton(_("Dow&nload"), wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); #if !defined(USE_FFMPEG) || defined(DISABLE_DYNAMIC_LOADING_FFMPEG) bdwn->Enable(FALSE); bfnd->Enable(FALSE); #else // fix compilation warnings about unused variables bfnd, bdwn; #endif } S.EndTwoColumn(); #ifdef EXPERIMENTAL_OD_FFMPEG wxCheckBox* checkbox = S.TieCheckBox(_("Allow &background on-demand loading"), wxT("/Library/FFmpegOnDemand"), false); #if !defined(USE_FFMPEG) checkbox->Enable(FALSE); #endif #endif } S.EndStatic(); }