1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Add GetInfo Preferences.

This commit is contained in:
James Crook
2018-02-24 19:39:58 +00:00
parent 11fa48d66f
commit ea4968e094
37 changed files with 364 additions and 53 deletions

View File

@@ -26,10 +26,10 @@ public:
BatchPrefs(wxWindow * parent, wxWindowID winid);
~BatchPrefs();
bool Commit() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
DECLARE_EVENT_TABLE()
};

View File

@@ -178,14 +178,14 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S)
DEFAULT_LATENCY_DURATION,
9);
S.AddUnits(_("milliseconds"));
w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
w = S.TieNumericTextBox(_("Track &shift after record:"),
wxT("/AudioIO/LatencyCorrection"),
DEFAULT_LATENCY_CORRECTION,
9);
S.AddUnits(_("milliseconds"));
w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
}
S.EndThreeColumn();
}

View File

@@ -29,10 +29,10 @@ class DevicePrefs final : public PrefsPanel
virtual ~DevicePrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void GetNamesAndLabels();
void OnHost(wxCommandEvent & e);

View File

@@ -26,10 +26,10 @@ class DirectoriesPrefs final : public PrefsPanel
bool Commit() override;
bool Validate() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void UpdateFreeSpace(wxCommandEvent & e);
void OnChooseTempDir(wxCommandEvent & e);

View File

@@ -123,7 +123,7 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
wxT("name"),
visualgroups,
prefsgroups);
c->SetMinSize(c->GetBestSize());
if( c ) c->SetMinSize(c->GetBestSize());
S.TieNumericTextBox(_("&Maximum effects per group (0 to disable):"),
wxT("/Effects/MaxPerGroup"),

View File

@@ -29,10 +29,10 @@ class EffectsPrefs final : public PrefsPanel
~EffectsPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
};
class EffectsPrefsFactory final : public PrefsPanelFactory

View File

@@ -50,6 +50,7 @@ class ExtImportPrefs final : public PrefsPanel
~ExtImportPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
void OnPluginKeyDown(wxListEvent& event);
void OnPluginBeginDrag(wxListEvent& event);
@@ -103,7 +104,6 @@ class ExtImportPrefs final : public PrefsPanel
void DoOnRuleTableSelect (int toprow);
void AddItemToTable (int index, const ExtImportItem *item);
void Populate();
void PopulateOrExchange(ShuttleGui & S);
DECLARE_EVENT_TABLE()
};

View File

@@ -29,12 +29,12 @@ class GUIPrefs final : public PrefsPanel
~GUIPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
static void GetRangeChoices(wxArrayString *pChoices, wxArrayString *pCodes);
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
wxArrayString mLangCodes;
wxArrayString mLangNames;

View File

@@ -28,10 +28,10 @@ class ImportExportPrefs final : public PrefsPanel
~ImportExportPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
};
class ImportExportPrefsFactory final : public PrefsPanelFactory

View File

@@ -154,11 +154,11 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree"));
{
mViewByTree = S.Id(ViewByTreeID).TieRadioButton(_("&Tree"), wxT("tree"));
mViewByTree->SetName(_("View by tree"));
if( mViewByTree ) mViewByTree->SetName(_("View by tree"));
mViewByName = S.Id(ViewByNameID).TieRadioButton(_("&Name"), wxT("name"));
mViewByName->SetName(_("View by name"));
if( mViewByName ) mViewByName->SetName(_("View by name"));
mViewByKey = S.Id(ViewByKeyID).TieRadioButton(_("&Key"), wxT("key"));
mViewByKey->SetName(_("View by key"));
if( mViewByKey ) mViewByKey->SetName(_("View by key"));
}
S.EndRadioButtonGroup();
}

View File

@@ -40,10 +40,10 @@ public:
bool Commit() override;
void Cancel() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void RefreshBindings(bool bSort);
void FilterKeys( std::vector<NormalizedKeyString> & arr );
wxString NameFromKey(const NormalizedKeyString & key);

View File

@@ -158,7 +158,7 @@ void LibraryPrefs::PopulateOrExchange(ShuttleGui & S)
wxT("/Library/FFmpegOnDemand"),
false);
#if !defined(USE_FFMPEG)
checkbox->Enable(FALSE);
if( checkbox ) checkbox->Enable(FALSE);
#endif
#endif
}

View File

@@ -29,10 +29,10 @@ class LibraryPrefs final : public PrefsPanel
~LibraryPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void SetMP3VersionText(bool prompt = false);
void SetFFmpegVersionText();

View File

@@ -34,10 +34,10 @@ class MidiIOPrefs final : public PrefsPanel
bool Commit() override;
bool Validate() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void GetNamesAndLabels();
void OnHost(wxCommandEvent & e);

View File

@@ -38,6 +38,7 @@ class ModulePrefs final : public PrefsPanel
~ModulePrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
static int GetModuleStatus( const wxString &fname );
static void SetModuleStatus( const wxString &fname, int iStatus );
@@ -45,7 +46,6 @@ class ModulePrefs final : public PrefsPanel
private:
void GetAllModuleStatuses();
void Populate();
void PopulateOrExchange(ShuttleGui & S);
wxArrayString mModules;
std::vector<int> mStatuses;
wxArrayString mPaths;

View File

@@ -26,10 +26,10 @@ class MousePrefs final : public PrefsPanel
~MousePrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void CreateList();
void AddItem(wxString const & buttons,
wxString const & tool,

View File

@@ -65,7 +65,7 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
6.0,
9);
S.AddUnits(_("seconds"));
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
}
S.EndThreeColumn();
}
@@ -81,14 +81,14 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
2.0,
9);
S.AddUnits(_("seconds"));
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
w = S.TieNumericTextBox(_("&After cut region:"),
wxT("/AudioIO/CutPreviewAfterLen"),
1.0,
9);
S.AddUnits(_("seconds"));
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
}
S.EndThreeColumn();
}
@@ -103,14 +103,14 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
1.0,
9);
S.AddUnits(_("seconds"));
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
w = S.TieNumericTextBox(_("Lo&ng period:"),
wxT("/AudioIO/SeekLongPeriod"),
15.0,
9);
S.AddUnits(_("seconds"));
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
}
S.EndThreeColumn();
}

View File

@@ -27,10 +27,10 @@ class PlaybackPrefs final : public PrefsPanel
virtual ~PlaybackPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
};
class PlaybackPrefsFactory final : public PrefsPanelFactory

View File

@@ -428,6 +428,23 @@ void PrefsDialog::OnHelp(wxCommandEvent & WXUNUSED(event))
HelpSystem::ShowHelp(this, page, true);
}
void PrefsDialog::ShuttleAll( ShuttleGui & S)
{
// Validate all pages first
if (mCategories) {
for (size_t i = 0; i < mCategories->GetPageCount(); i++) {
S.ResetId();
PrefsPanel *panel = (PrefsPanel *)mCategories->GetPage(i);
panel->PopulateOrExchange( S );
}
}
else
{
S.ResetId();
mUniquePage->PopulateOrExchange( S );
}
}
void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
{
if(event.GetKeyCode() == WXK_RETURN)

View File

@@ -24,6 +24,7 @@
class PrefsPanel;
class PrefsPanelFactory;
class ShuttleGui;
#ifdef __GNUC__
#define CONST
@@ -56,6 +57,7 @@ class PrefsDialog /* not final */ : public wxDialogWrapper
// Defined this so a protected virtual can be invoked after the constructor
int ShowModal() override;
void ShuttleAll( ShuttleGui & S);
void OnCategoryChange(wxCommandEvent & e);
void OnOK(wxCommandEvent & e);

View File

@@ -40,6 +40,8 @@ ThemePrefs.
#define TOP_LEVEL_BORDER 5
#define GENERIC_CONTROL_BORDER 5
class ShuttleGui;
class PrefsPanel /* not final */ : public wxPanelWrapper
{
public:
@@ -59,6 +61,7 @@ class PrefsPanel /* not final */ : public wxPanelWrapper
// If it returns True, the Preview button is added below the panel
// Default returns false
virtual bool ShowsPreviewButton();
virtual void PopulateOrExchange( ShuttleGui & WXUNUSED(S) ){};
// If not empty string, the Help button is added below the panel
// Default returns empty string.

View File

@@ -28,10 +28,10 @@ class ProjectsPrefs final : public PrefsPanel
~ProjectsPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
};
class ProjectsPrefsFactory final : public PrefsPanelFactory

View File

@@ -31,10 +31,10 @@ class QualityPrefs final : public PrefsPanel
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void GetNamesAndLabels();
void OnSampleRateChoice(wxCommandEvent & e);

View File

@@ -138,8 +138,10 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S)
wxT("/GUI/TrackNames/RecodingTrackName"),
_("Recorded_Audio"),
30);
mToggleCustomName->SetName(_("Custom name text"));
mToggleCustomName->Enable(mUseCustomTrackName);
if( mToggleCustomName ) {
mToggleCustomName->SetName(_("Custom name text"));
mToggleCustomName->Enable(mUseCustomTrackName);
}
}
S.EndMultiColumn();

View File

@@ -28,10 +28,10 @@ class RecordingPrefs final : public PrefsPanel
virtual ~RecordingPrefs();
bool Commit() override;
wxString HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void OnToggleCustomName(wxCommandEvent & /* Evt */);
wxTextCtrl *mToggleCustomName;

View File

@@ -300,7 +300,9 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
} S.EndScroller();
EnableDisableSTFTOnlyControls();
// Enabling and disabling belongs outside this function.
if( S.GetMode() != eIsGettingMetadata )
EnableDisableSTFTOnlyControls();
mPopulating = false;
}

View File

@@ -46,6 +46,7 @@ class SpectrumPrefs final : public PrefsPanel
virtual ~SpectrumPrefs();
void Preview() override;
bool Commit() override;
void PopulateOrExchange(ShuttleGui & S) override;
void Rollback();
bool ShowsPreviewButton() override;
bool Validate() override;
@@ -54,7 +55,6 @@ class SpectrumPrefs final : public PrefsPanel
private:
void Populate(size_t windowSize);
void PopulatePaddingChoices(size_t windowSize);
void PopulateOrExchange(ShuttleGui & S);
void OnControl(wxCommandEvent &event);
void OnWindowSize(wxCommandEvent &event);

View File

@@ -30,7 +30,7 @@ class ThemePrefs final : public PrefsPanel
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void PopulateOrExchange(ShuttleGui & S) override;
void OnLoadThemeComponents(wxCommandEvent & e);
void OnSaveThemeComponents(wxCommandEvent & e);
void OnLoadThemeCache(wxCommandEvent & e);

View File

@@ -31,7 +31,7 @@ class TracksBehaviorsPrefs final : public PrefsPanel
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void PopulateOrExchange(ShuttleGui & S) override;
wxArrayString mSoloCodes;
wxArrayString mSoloChoices;

View File

@@ -38,7 +38,7 @@ class TracksPrefs final : public PrefsPanel
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void PopulateOrExchange(ShuttleGui & S) override;
static int iPreferencePinned;

View File

@@ -31,7 +31,7 @@ class WarningsPrefs final : public PrefsPanel
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void PopulateOrExchange(ShuttleGui & S) override;
};
class WarningsPrefsFactory final : public PrefsPanelFactory

View File

@@ -28,10 +28,10 @@ public:
bool Commit() override;
bool ShowsPreviewButton() override;
bool Validate() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void OnControl(wxCommandEvent&);
void OnScale(wxCommandEvent&);