bool MidiIOPrefs::Apply() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); const PmDeviceInfo *info; info = (const PmDeviceInfo *) mPlay->GetClientData(mPlay->GetSelection()); if (info) { gPrefs->Write(wxT("/MidiIO/PlaybackDevice"), wxString::Format(wxT("%s: %s"), wxString(info->interf, wxConvLocal).c_str(), wxString(info->name, wxConvLocal).c_str())); } #ifdef EXPERIMENTAL_MIDI_IN info = (const PmDeviceInfo *) mRecord->GetClientData(mRecord->GetSelection()); if (info) { gPrefs->Write(wxT("/MidiIO/RecordingDevice"), wxString::Format(wxT("%s: %s"), wxString(info->interf, wxConvLocal).c_str(), wxString(info->name, wxConvLocal).c_str())); } #endif return gPrefs->Flush(); }
void SpectrumPrefs::Populate(int windowSize) { mSizeChoices.Add(_("8 - most wideband")); mSizeChoices.Add(wxT("16")); mSizeChoices.Add(wxT("32")); mSizeChoices.Add(wxT("64")); mSizeChoices.Add(wxT("128")); mSizeChoices.Add(_("256 - default")); mSizeChoices.Add(wxT("512")); mSizeChoices.Add(wxT("1024")); mSizeChoices.Add(wxT("2048")); mSizeChoices.Add(wxT("4096")); mSizeChoices.Add(wxT("8192")); mSizeChoices.Add(wxT("16384")); mSizeChoices.Add(_("32768 - most narrowband")); wxASSERT(mSizeChoices.size() == SpectrogramSettings::NumWindowSizes); PopulatePaddingChoices(windowSize); for (int i = 0; i < NumWindowFuncs(); i++) { mTypeChoices.Add(WindowFuncName(i)); } mScaleChoices = SpectrogramSettings::GetScaleNames(); mAlgorithmChoices = SpectrogramSettings::GetAlgorithmNames(); //------------------------- Main section -------------------- // Now construct the GUI itself. ShuttleGui S(this, eIsCreating); PopulateOrExchange(S); // ----------------------- End of main section -------------- }
void EffectDialog::Init() { ShuttleGui S(this, eIsCreating); S.SetBorder(5); S.StartVerticalLay(true); { PopulateOrExchange(S); long buttons = eOkButton; if (mType == PROCESS_EFFECT || mType == INSERT_EFFECT) { buttons |= eCancelButton; if (mType == PROCESS_EFFECT) { buttons |= ePreviewButton; } } S.AddStandardButtons(buttons); } S.EndVerticalLay(); Layout(); Fit(); SetMinSize(GetSize()); Center(); }
void KeyConfigPrefs::Populate() { ShuttleGui S(this, eIsCreatingFromPrefs); AudacityProject *project = GetActiveProject(); if (!project) { S.StartVerticalLay(true); { S.StartStatic(wxEmptyString, true); { S.AddTitle(_("Keyboard preferences currently unavailable.")); S.AddTitle(_("Open a new project to modify keyboard shortcuts.")); } S.EndStatic(); } S.EndVerticalLay(); return; } mManager = project->GetCommandManager(); mManager->GetCategories(mCats); mCats.Insert(_("All"), 0); PopulateOrExchange(S); CreateList(); mCommandSelected = -1; }
void ExportMultiple::OnExport(wxCommandEvent& event) { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); // Make sure the output directory is in good shape if (!DirOk()) { return; } mFormatIndex = mFormat->GetSelection(); bool overwrite = mOverwrite->GetValue(); bool ok; if (mLabel->GetValue()) { ok = ExportMultipleByLabel(mByName->GetValue(), mPrefix->GetValue()); } else { ok = ExportMultipleByTrack(mByName->GetValue(), mPrefix->GetValue()); } if (!ok) { return; } EndModal(1); }
void TracksPrefs::Populate() { mSoloCodes.Add(wxT("Simple")); mSoloCodes.Add(wxT("Multi")); mSoloCodes.Add(wxT("None")); mSoloChoices.Add(_("Simple")); mSoloChoices.Add(_("Multi-track")); mSoloChoices.Add(_("None")); // Keep view choices and codes in proper correspondence -- // we don't display them by increasing integer values. mViewChoices.Add(_("Waveform")); mViewCodes.Add(int(WaveTrack::Waveform)); mViewChoices.Add(_("Waveform (dB)")); mViewCodes.Add(int(WaveTrack::obsoleteWaveformDBDisplay)); mViewChoices.Add(_("Spectrogram")); mViewCodes.Add(WaveTrack::Spectrum); //------------------------- Main section -------------------- // Now construct the GUI itself. // Use 'eIsCreatingFromPrefs' so that the GUI is // initialised with values from gPrefs. ShuttleGui S(this, eIsCreatingFromPrefs); PopulateOrExchange(S); // ----------------------- End of main section -------------- }
ExportMultiple::ExportMultiple(AudacityProject *project) : wxDialog(project, wxID_ANY, wxString(_("Export Multiple"))) , mIterator(new TrackListIterator) { SetName(GetTitle()); mProject = project; mTracks = project->GetTracks(); mPlugins = mExporter.GetPlugins(); this->CountTracksAndLabels(); mBook = NULL; // create array of characters not allowed in file names wxString forbid = wxFileName::GetForbiddenChars(); for(unsigned int i=0; i < forbid.Length(); i++) exclude.Add( forbid.Mid(i, 1) ); ShuttleGui S(this, eIsCreatingFromPrefs); // Creating some of the widgets cause cause events to fire // and we don't want that until after we're completely // created. (Observed on Windows) mInitialized = false; PopulateOrExchange(S); mInitialized = true; Layout(); Fit(); SetMinSize(GetSize()); Center(); EnableControls(); }
bool TracksBehaviorsPrefs::Commit() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); return true; }
bool EffectsPrefs::Commit() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); return true; }
void BatchProcessDialog::Populate() { //------------------------- Main section -------------------- ShuttleGui S(this, eIsCreating); PopulateOrExchange(S); // ----------------------- End of main section -------------- }
ExportMultiple::ExportMultiple(AudacityProject *project) : wxDialogWrapper(project, wxID_ANY, wxString(_("Export Multiple"))) { SetName(GetTitle()); mProject = project; mTracks = project->GetTracks(); // Construct an array of non-owning pointers for (const auto &plugin : mExporter.GetPlugins()) mPlugins.push_back(plugin.get()); this->CountTracksAndLabels(); mBook = NULL; ShuttleGui S(this, eIsCreatingFromPrefs); // Creating some of the widgets cause events to fire // and we don't want that until after we're completely // created. (Observed on Windows) mInitialized = false; PopulateOrExchange(S); mInitialized = true; Layout(); Fit(); SetMinSize(GetSize()); Center(); EnableControls(); }
bool ModulePrefs::Apply() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); return true; }
/// Creates the dialog and its contents. void EditChainsDialog::Populate() { //------------------------- Main section -------------------- ShuttleGui S(this, eIsCreating); PopulateOrExchange(S); // ----------------------- End of main section -------------- // Get and validate the currently active chain mActiveChain = gPrefs->Read(wxT("/Batch/ActiveChain"), wxT("")); // Go populate the chains list. PopulateChains(); // We have a bare list. We need to add columns and content. PopulateList(); // Layout and set minimum size of window Layout(); Fit(); SetSizeHints(GetSize()); // Size and place window SetSize(wxSystemSettings::GetMetric(wxSYS_SCREEN_X) * 3 / 4, wxSystemSettings::GetMetric(wxSYS_SCREEN_Y) * 4 / 5); Center(); // Set the column size for the chains list. wxSize sz = mChains->GetClientSize(); mChains->SetColumnWidth(0, sz.x); // Size columns properly FitColumns(); }
void MacroCommandDialog::Populate() { //------------------------- Main section -------------------- ShuttleGui S(this, eIsCreating); PopulateOrExchange(S); // ----------------------- End of main section -------------- }
void GUIPrefs::Populate() { // First any pre-processing for constructing the GUI. GetLanguages(mLangCodes, mLangNames); mHtmlHelpCodes.Add(wxT("Local")); mHtmlHelpCodes.Add(wxT("FromInternet")); mHtmlHelpChoices.Add(_("Local")); mHtmlHelpChoices.Add(_("From Internet")); GetRangeChoices(&mRangeChoices, &mRangeCodes); #if 0 // only for testing... mLangCodes.Add("kg"); mLangNames.Add("Klingon"); mLangCodes.Add("ep"); mLangNames.Add("Esperanto"); #endif //------------------------- Main section -------------------- // Now construct the GUI itself. // Use 'eIsCreatingFromPrefs' so that the GUI is // initialised with values from gPrefs. ShuttleGui S(this, eIsCreatingFromPrefs); PopulateOrExchange(S); // ----------------------- End of main section -------------- }
void SpectrumPrefs::Populate( ) { int minFreq; int maxFreq; // First any pre-processing for constructing the GUI. // Unusual handling of maxFreqStr because it is a validated input. gPrefs->Read(wxT("/Spectrum/MaxFreq"), &maxFreq, 8000L); gPrefs->Read(wxT("/Spectrum/MinFreq"), &minFreq, 0L); gPrefs->Read(wxT("/Spectrum/WindowType"), &windowType, 3L); #ifdef EXPERIMENTAL_FFT_SKIP_POINTS gPrefs->Read(wxT("/Spectrum/FFTSkipPoints"), &fftSkipPoints, 0L); #endif //EXPERIMENTAL_FFT_SKIP_POINTS #ifdef EXPERIMENTAL_FFT_Y_GRID gPrefs->Read(wxT("/Spectrum/FFTYGrid"), &fftYGrid, false); #endif //EXPERIMENTAL_FFT_Y_GRID #ifdef EXPERIMENTAL_FIND_NOTES gPrefs->Read(wxT("/Spectrum/FFTFindNotes"), &fftFindNotes, false); gPrefs->Read(wxT("/Spectrum/FindNotesMinA"), &findNotesMinA, -30L); findNotesMinAStr.Printf(wxT("%d"), findNotesMinA); gPrefs->Read(wxT("/Spectrum/FindNotesN"), &findNotesN, 5L); findNotesNStr.Printf(wxT("%d"), findNotesN); gPrefs->Read(wxT("/Spectrum/FindNotes"), &findNotesQuantize, false); #endif //EXPERIMENTAL_FIND_NOTES minFreqStr.Printf(wxT("%d"), minFreq); maxFreqStr.Printf(wxT("%d"), maxFreq); //------------------------- Main section -------------------- // Now construct the GUI itself. // Use 'eIsCreatingFromPrefs' so that the GUI is // initialised with values from gPrefs. ShuttleGui S(this, eIsCreatingFromPrefs); PopulateOrExchange(S); // ----------------------- End of main section -------------- }
bool EffectDialog::TransferDataToWindow() { ShuttleGui S(this, eIsSettingToDialog); PopulateOrExchange(S); return true; }
/// Update the preferences stored on disk. bool SmartRecordPrefs::Apply() { ShuttleGui S( this, eIsSavingToPrefs ); PopulateOrExchange( S ); return true; }
bool EffectDialog::TransferDataFromWindow() { ShuttleGui S(this, eIsGettingFromDialog); PopulateOrExchange(S); return true; }
bool DirectoriesPrefs::Apply() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); return true; }
bool SpectrumPrefs::Apply() { if (!Validate()) return false; const bool isOpenPage = this->IsShown(); WaveTrack *const partner = mWt ? static_cast<WaveTrack*>(mWt->GetLink()) : 0; ShuttleGui S(this, eIsGettingFromDialog); PopulateOrExchange(S); mTempSettings.ConvertToActualWindowSizes(); SpectrogramSettings::Globals::Get().SavePrefs(); // always if (mWt) { if (mDefaulted) { mWt->SetSpectrogramSettings(NULL); // ... and so that the vertical scale also defaults: mWt->SetSpectrumBounds(-1, -1); if (partner) { partner->SetSpectrogramSettings(NULL); partner->SetSpectrumBounds(-1, -1); } } else { SpectrogramSettings *pSettings = &mWt->GetIndependentSpectrogramSettings(); *pSettings = mTempSettings; if (partner) { pSettings = &partner->GetIndependentSpectrogramSettings(); *pSettings = mTempSettings; } } } if (!mWt || mDefaulted) { SpectrogramSettings *const pSettings = &SpectrogramSettings::defaults(); *pSettings = mTempSettings; pSettings->SavePrefs(); } mTempSettings.ConvertToEnumeratedWindowSizes(); if (mWt && isOpenPage) { mWt->SetDisplay(WaveTrack::Spectrum); if (partner) partner->SetDisplay(WaveTrack::Spectrum); } if (isOpenPage) { TrackPanel *const tp = ::GetActiveProject()->GetTrackPanel(); tp->UpdateVRulers(); tp->Refresh(false); } return true; }
ExportFLACOptions::ExportFLACOptions(wxWindow *parent, int WXUNUSED(format)) : wxPanel(parent, wxID_ANY) { ShuttleGui S(this, eIsCreatingFromPrefs); PopulateOrExchange(S); TransferDataToWindow(); }
bool NoiseDialog::TransferDataFromWindow() { ShuttleGui S( this, eIsGettingFromDialog ); PopulateOrExchange( S ); nAmplitude = TrapDouble(nAmplitude, AMP_MIN, AMP_MAX); return true; }
bool ModulePrefs::Apply() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); int i; for(i=0;i<(int)mPaths.GetCount();i++) SetModuleStatus( mPaths[i], mStatuses[i] ); return true; }
bool ExportFLACOptions::TransferDataFromWindow() { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); gPrefs->Flush(); return true; }
void WaveformPrefs::OnDefaults(wxCommandEvent &) { if (mDefaultsCheckbox->IsChecked()) { mTempSettings = WaveformSettings::defaults(); mDefaulted = true; ShuttleGui S(this, eIsSettingToDialog); PopulateOrExchange(S); } }
void SoundActivatedRecord::OnOK(wxCommandEvent & WXUNUSED(event)) { ShuttleGui S( this, eIsSavingToPrefs ); PopulateOrExchange( S ); gPrefs->Flush(); EndModal(0); }
void ExportFFmpegWMAOptions::OnOK(wxCommandEvent& event) { ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); EndModal(wxID_OK); return; }
bool WaveformPrefs::Apply() { const bool isOpenPage = this->IsShown(); const auto partner = mWt ? // Assume linked track is wave or null static_cast<WaveTrack*>(mWt->GetLink()) : nullptr; ShuttleGui S(this, eIsGettingFromDialog); PopulateOrExchange(S); mTempSettings.ConvertToActualDBRange(); WaveformSettings::Globals::Get().SavePrefs(); if (mWt) { if (mDefaulted) { mWt->SetWaveformSettings({}); if (partner) partner->SetWaveformSettings({}); } else { WaveformSettings *pSettings = &mWt->GetIndependentWaveformSettings(); *pSettings = mTempSettings; if (partner) { pSettings = &partner->GetIndependentWaveformSettings(); *pSettings = mTempSettings; } } } if (!mWt || mDefaulted) { WaveformSettings *const pSettings = &WaveformSettings::defaults(); *pSettings = mTempSettings; pSettings->SavePrefs(); } mTempSettings.ConvertToEnumeratedDBRange(); if (mWt && isOpenPage) { mWt->SetDisplay(WaveTrack::Waveform); if (partner) partner->SetDisplay(WaveTrack::Waveform); } if (isOpenPage) { TrackPanel *const tp = ::GetActiveProject()->GetTrackPanel(); tp->UpdateVRulers(); tp->Refresh(false); } return true; }
void SpectrumPrefs::OnDefaults(wxCommandEvent &) { if (mDefaultsCheckbox->IsChecked()) { mTempSettings = SpectrogramSettings::defaults(); mTempSettings.ConvertToEnumeratedWindowSizes(); mDefaulted = true; ShuttleGui S(this, eIsSettingToDialog); PopulateOrExchange(S); } }