From 7fbe97c5cad5a8abc7ba4f16977c6afe15e38c68 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 5 Feb 2019 11:48:40 -0500 Subject: [PATCH 1/3] Privatize, rename ShuttleGuiBase member fns (those using WrappedType) --- src/ShuttleGui.cpp | 50 +++++++++++++++++++++++----------------------- src/ShuttleGui.h | 19 +++++++++--------- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 522bc5102..fabef008e 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -1125,7 +1125,7 @@ void ShuttleGuiBase::DoDataShuttle( const wxString &Name, WrappedType & WrappedR // they bind to (i.e. WrappedType). // The type specific versions are much shorter and are later // in this file. -wxCheckBox * ShuttleGuiBase::TieCheckBox(const wxString &Prompt, WrappedType & WrappedRef) +wxCheckBox * ShuttleGuiBase::DoTieCheckBox(const wxString &Prompt, WrappedType & WrappedRef) { HandleOptionality( Prompt ); // The Add function does a UseUpId(), so don't do it here in that case. @@ -1167,7 +1167,7 @@ wxCheckBox * ShuttleGuiBase::TieCheckBox(const wxString &Prompt, WrappedType & W return pCheckBox; } -wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight(const wxString &Prompt, WrappedType & WrappedRef) +wxCheckBox * ShuttleGuiBase::DoTieCheckBoxOnRight(const wxString &Prompt, WrappedType & WrappedRef) { HandleOptionality( Prompt ); // The Add function does a UseUpId(), so don't do it here in that case. @@ -1209,7 +1209,7 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight(const wxString &Prompt, WrappedT return pCheckBox; } -wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( const wxString &Prompt, WrappedType & WrappedRef, const int max, const int min ) +wxSpinCtrl * ShuttleGuiBase::DoTieSpinCtrl( const wxString &Prompt, WrappedType & WrappedRef, const int max, const int min ) { HandleOptionality( Prompt ); // The Add function does a UseUpId(), so don't do it here in that case. @@ -1252,7 +1252,7 @@ wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( const wxString &Prompt, WrappedType & return pSpinCtrl; } -wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars) +wxTextCtrl * ShuttleGuiBase::DoTieTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars) { HandleOptionality( Prompt ); // The Add function does a UseUpId(), so don't do it here in that case. @@ -1295,7 +1295,7 @@ wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString &Prompt, WrappedType & W return pTextBox; } -wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars) +wxTextCtrl * ShuttleGuiBase::DoTieNumericTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars) { HandleOptionality( Prompt ); // The Add function does a UseUpId(), so don't do it here in that case. @@ -1338,7 +1338,7 @@ wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( const wxString &Prompt, WrappedT return pTextBox; } -wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, WrappedType & WrappedRef, const int max, int min ) +wxSlider * ShuttleGuiBase::DoTieSlider( const wxString &Prompt, WrappedType & WrappedRef, const int max, int min ) { HandleOptionality( Prompt ); // The Add function does a UseUpId(), so don't do it here in that case. @@ -1385,7 +1385,7 @@ wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, WrappedType & Wrap } -wxChoice * ShuttleGuiBase::TieChoice( +wxChoice * ShuttleGuiBase::DoTieChoice( const wxString &Prompt, WrappedType &WrappedRef, const wxArrayStringEx &choices ) @@ -1548,7 +1548,7 @@ void ShuttleGuiBase::EndRadioButtonGroup() wxCheckBox * ShuttleGuiBase::TieCheckBox(const wxString &Prompt, bool &Var) { WrappedType WrappedRef( Var ); - return TieCheckBox( Prompt, WrappedRef ); + return DoTieCheckBox( Prompt, WrappedRef ); } // See comment in AddCheckBoxOnRight() for why we have this variant. @@ -1558,55 +1558,55 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight(const wxString &Prompt, bool &Va WrappedType WrappedRef( Var ); if( mShuttleMode == eIsCreating ) return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() == wxT("true") ); - return TieCheckBox( Prompt, WrappedRef ); + return DoTieCheckBox( Prompt, WrappedRef ); } wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( const wxString &Prompt, int &Value, const int max, const int min ) { WrappedType WrappedRef(Value); - return TieSpinCtrl( Prompt, WrappedRef, max, min ); + return DoTieSpinCtrl( Prompt, WrappedRef, max, min ); } wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString &Prompt, wxString &Selected, const int nChars) { WrappedType WrappedRef(Selected); - return TieTextBox( Prompt, WrappedRef, nChars ); + return DoTieTextBox( Prompt, WrappedRef, nChars ); } wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString &Prompt, int &Selected, const int nChars) { WrappedType WrappedRef( Selected ); - return TieTextBox( Prompt, WrappedRef, nChars ); + return DoTieTextBox( Prompt, WrappedRef, nChars ); } wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString &Prompt, double &Value, const int nChars) { WrappedType WrappedRef( Value ); - return TieTextBox( Prompt, WrappedRef, nChars ); + return DoTieTextBox( Prompt, WrappedRef, nChars ); } wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( const wxString &Prompt, int &Value, const int nChars) { WrappedType WrappedRef( Value ); - return TieNumericTextBox( Prompt, WrappedRef, nChars ); + return DoTieNumericTextBox( Prompt, WrappedRef, nChars ); } wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( const wxString &Prompt, double &Value, const int nChars) { WrappedType WrappedRef( Value ); - return TieNumericTextBox( Prompt, WrappedRef, nChars ); + return DoTieNumericTextBox( Prompt, WrappedRef, nChars ); } wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, int &pos, const int max, const int min ) { WrappedType WrappedRef( pos ); - return TieSlider( Prompt, WrappedRef, max, min ); + return DoTieSlider( Prompt, WrappedRef, max, min ); } wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, double &pos, const double max, const double min ) { WrappedType WrappedRef( pos ); - return TieSlider( Prompt, WrappedRef, max, min ); + return DoTieSlider( Prompt, WrappedRef, max, min ); } wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, float &pos, const float fMin, const float fMax) @@ -1636,7 +1636,7 @@ wxChoice * ShuttleGuiBase::TieChoice( const wxArrayStringEx &choices ) { WrappedType WrappedRef( Selected ); - return TieChoice( Prompt, WrappedRef, choices ); + return DoTieChoice( Prompt, WrappedRef, choices ); } wxChoice * ShuttleGuiBase::TieChoice( @@ -1645,7 +1645,7 @@ wxChoice * ShuttleGuiBase::TieChoice( const wxArrayStringEx &choices ) { WrappedType WrappedRef( Selected ); - return TieChoice( Prompt, WrappedRef, choices ); + return DoTieChoice( Prompt, WrappedRef, choices ); } //-----------------------------------------------------------------------// @@ -1759,7 +1759,7 @@ wxCheckBox * ShuttleGuiBase::TieCheckBox( bool bValue=bDefault; WrappedType WrappedRef( bValue ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); - if( DoStep(2) ) pCheck = TieCheckBox( Prompt, WrappedRef ); + if( DoStep(2) ) pCheck = DoTieCheckBox( Prompt, WrappedRef ); if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); return pCheck; @@ -1777,7 +1777,7 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight( bool bValue=bDefault; WrappedType WrappedRef( bValue ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); - if( DoStep(2) ) pCheck = TieCheckBoxOnRight( Prompt, WrappedRef ); + if( DoStep(2) ) pCheck = DoTieCheckBoxOnRight( Prompt, WrappedRef ); if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); return pCheck; @@ -1797,7 +1797,7 @@ wxSlider * ShuttleGuiBase::TieSlider( int iValue=iDefault; WrappedType WrappedRef( iValue ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); - if( DoStep(2) ) pSlider = TieSlider( Prompt, WrappedRef, max, min ); + if( DoStep(2) ) pSlider = DoTieSlider( Prompt, WrappedRef, max, min ); if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); return pSlider; @@ -1817,7 +1817,7 @@ wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( int iValue = Value; WrappedType WrappedRef( iValue ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); - if( DoStep(2) ) pSpinCtrl = TieSpinCtrl( Prompt, WrappedRef, max, min ); + if( DoStep(2) ) pSpinCtrl = DoTieSpinCtrl( Prompt, WrappedRef, max, min ); if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); return pSpinCtrl; @@ -1836,7 +1836,7 @@ wxTextCtrl * ShuttleGuiBase::TieTextBox( wxString Temp = Default; WrappedType WrappedRef( Temp ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); - if( DoStep(2) ) pText = TieTextBox( Prompt, WrappedRef, nChars ); + if( DoStep(2) ) pText = DoTieTextBox( Prompt, WrappedRef, nChars ); if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); return pText; } @@ -1855,7 +1855,7 @@ wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( double Temp = Default; WrappedType WrappedRef( Temp ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); - if( DoStep(2) ) pText = TieNumericTextBox( Prompt, WrappedRef, nChars ); + if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars ); if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); return pText; } diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 7d67ff049..3e74ec829 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -178,34 +178,25 @@ public: void StartRadioButtonGroup( const ChoiceSetting &Setting ); void EndRadioButtonGroup(); - void DoDataShuttle( const wxString &Name, WrappedType & WrappedRef ); - bool DoStep( int iStep ); int TranslateToIndex( const wxString &Value, const wxArrayStringEx &Choices ); wxString TranslateFromIndex( const int nIn, const wxArrayStringEx &Choices ); //-- Tie functions both add controls and also read/write to them. -// The ones taking a 'WrappedType' are type-generic and are used by the type specific ones. - wxTextCtrl * TieTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars); wxTextCtrl * TieTextBox( const wxString &Caption, wxString & Value, const int nChars=0); wxTextCtrl * TieTextBox( const wxString &Prompt, int &Selected, const int nChars=0); wxTextCtrl * TieTextBox( const wxString &Prompt, double &Value, const int nChars=0); - wxTextCtrl * TieNumericTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars); wxTextCtrl * TieNumericTextBox( const wxString &Prompt, int &Value, const int nChars=0); wxTextCtrl * TieNumericTextBox( const wxString &Prompt, double &Value, const int nChars=0); - wxCheckBox * TieCheckBox( const wxString &Prompt, WrappedType & WrappedRef ); wxCheckBox * TieCheckBox( const wxString &Prompt, bool & Var ); - wxCheckBox * TieCheckBoxOnRight( const wxString & Prompt, WrappedType & WrappedRef ); wxCheckBox * TieCheckBoxOnRight( const wxString & Prompt, bool & Var ); - wxChoice * TieChoice( const wxString &Prompt, WrappedType & WrappedRef, const wxArrayStringEx &choices ); wxChoice * TieChoice( const wxString &Prompt, wxString &Selected, const wxArrayStringEx &choices ); wxChoice * TieChoice( const wxString &Prompt, int &Selected, const wxArrayStringEx &choices ); - wxSlider * TieSlider( const wxString &Prompt, WrappedType & WrappedRef, const int max, const int min = 0 ); wxSlider * TieSlider( const wxString &Prompt, int &pos, const int max, const int min = 0); wxSlider * TieSlider( const wxString &Prompt, double &pos, const double max, const double min = 0.0); wxSlider * TieSlider( const wxString &Prompt, float &pos, const float fMin, const float fMax); @@ -215,7 +206,6 @@ public: // and as many times as there are values in the enumeration. wxRadioButton * TieRadioButton(); - wxSpinCtrl * TieSpinCtrl( const wxString &Prompt, WrappedType & WrappedRef, const int max, const int min = 0 ); wxSpinCtrl * TieSpinCtrl( const wxString &Prompt, int &Value, const int max, const int min = 0 ); @@ -344,6 +334,15 @@ protected: wxMenu * mpMenu; private: + void DoDataShuttle( const wxString &Name, WrappedType & WrappedRef ); + wxCheckBox * DoTieCheckBoxOnRight( const wxString & Prompt, WrappedType & WrappedRef ); + wxTextCtrl * DoTieTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars); + wxTextCtrl * DoTieNumericTextBox( const wxString &Prompt, WrappedType & WrappedRef, const int nChars); + wxCheckBox * DoTieCheckBox( const wxString &Prompt, WrappedType & WrappedRef ); + wxChoice * DoTieChoice( const wxString &Prompt, WrappedType & WrappedRef, const wxArrayStringEx & choices ); + wxSlider * DoTieSlider( const wxString &Prompt, WrappedType & WrappedRef, const int max, const int min = 0 ); + wxSpinCtrl * DoTieSpinCtrl( const wxString &Prompt, WrappedType & WrappedRef, const int max, const int min = 0 ); + const ChoiceSetting *mpRadioSetting = nullptr; wxString mRadioSettingName; /// The setting controlled by a group. Maybe mRadioValue; /// The wrapped value associated with the active radio button. From 7675d51044d8a6c87c3de1219c1ee15475c420b3 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 1 Apr 2019 08:30:06 -0400 Subject: [PATCH 2/3] Separate function TieIntegerTextBox... ... For the cases in which there is an associated preference variable which should be a whole number --- src/ShuttleGui.cpp | 21 ++++++++++++++++++++- src/ShuttleGui.h | 5 +++++ src/commands/GetInfoCommand.cpp | 19 +++++++++++++++++++ src/prefs/DirectoriesPrefs.cpp | 2 +- src/prefs/EffectsPrefs.cpp | 2 +- src/prefs/MidiIOPrefs.cpp | 2 +- src/prefs/RecordingPrefs.cpp | 4 ++-- 7 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index fabef008e..bfa23a1e5 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -1841,6 +1841,25 @@ wxTextCtrl * ShuttleGuiBase::TieTextBox( return pText; } +/// Variant of the standard TieTextBox which does the two step exchange +/// between gui and stack variable and stack variable and shuttle. +/// This one does it for double values... +wxTextCtrl * ShuttleGuiBase::TieIntegerTextBox( + const wxString & Prompt, + const wxString & SettingName, + const int & Default, + const int nChars) +{ + wxTextCtrl * pText=(wxTextCtrl*)NULL; + + auto Temp = Default; + WrappedType WrappedRef( Temp ); + if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars ); + if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + return pText; +} + /// Variant of the standard TieTextBox which does the two step exchange /// between gui and stack variable and stack variable and shuttle. /// This one does it for double values... @@ -1852,7 +1871,7 @@ wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( { wxTextCtrl * pText=(wxTextCtrl*)NULL; - double Temp = Default; + auto Temp = Default; WrappedType WrappedRef( Temp ); if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars ); diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 3e74ec829..48501a36c 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -243,6 +243,11 @@ public: const wxString &SettingName, const wxString &Default, const int nChars); + virtual wxTextCtrl * TieIntegerTextBox( + const wxString & Prompt, + const wxString & SettingName, + const int & Default, + const int nChars); virtual wxTextCtrl * TieNumericTextBox( const wxString & Prompt, const wxString & SettingName, diff --git a/src/commands/GetInfoCommand.cpp b/src/commands/GetInfoCommand.cpp index 3c7d5c471..f8b8671a6 100644 --- a/src/commands/GetInfoCommand.cpp +++ b/src/commands/GetInfoCommand.cpp @@ -219,6 +219,11 @@ public: const wxString &SettingName, const wxString &Default, const int nChars) override; + wxTextCtrl * TieIntegerTextBox( + const wxString & Prompt, + const wxString & SettingName, + const int & Default, + const int nChars) override; wxTextCtrl * TieNumericTextBox( const wxString & Prompt, const wxString & SettingName, @@ -308,6 +313,20 @@ wxTextCtrl * ShuttleGuiGetDefinition::TieTextBox( EndStruct(); return ShuttleGui::TieTextBox( Prompt, SettingName, Default, nChars ); } +wxTextCtrl * ShuttleGuiGetDefinition::TieIntegerTextBox( + const wxString & Prompt, + const wxString & SettingName, + const int & Default, + const int nChars) +{ + StartStruct(); + AddItem( SettingName, "id" ); + AddItem( Prompt, "prompt" ); + AddItem( "number", "type" ); + AddItem( Default, "default" ); + EndStruct(); + return ShuttleGui::TieIntegerTextBox( Prompt, SettingName, Default, nChars ); +} wxTextCtrl * ShuttleGuiGetDefinition::TieNumericTextBox( const wxString & Prompt, const wxString & SettingName, diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index 232f72829..5b27c8239 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -130,7 +130,7 @@ void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S) S.StartTwoColumn(); { - S.TieNumericTextBox(_("Mi&nimum Free Memory (MB):"), + S.TieIntegerTextBox(_("Mi&nimum Free Memory (MB):"), wxT("/Directories/CacheLowMem"), 16, 9); diff --git a/src/prefs/EffectsPrefs.cpp b/src/prefs/EffectsPrefs.cpp index 709be0494..65836314e 100644 --- a/src/prefs/EffectsPrefs.cpp +++ b/src/prefs/EffectsPrefs.cpp @@ -202,7 +202,7 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S) wxChoice *c = S.TieChoice( _("S&ort or Group:"), EffectsGroupBy); if( c ) c->SetMinSize(c->GetBestSize()); - S.TieNumericTextBox(_("&Maximum effects per group (0 to disable):"), + S.TieIntegerTextBox(_("&Maximum effects per group (0 to disable):"), wxT("/Effects/MaxPerGroup"), #if defined(__WXGTK__) 15, diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 512c60cb2..8e61a405c 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -158,7 +158,7 @@ void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) { S.Id(PlayID); mPlay = S.AddChoice(_("&Device:"), {} ); - mLatency = S.TieNumericTextBox(_("MIDI Synth L&atency (ms):"), + mLatency = S.TieIntegerTextBox(_("MIDI Synth L&atency (ms):"), wxT("/MidiIO/SynthLatency"), DEFAULT_SYNTH_LATENCY, 3); } diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index ca6a70155..564a41993 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -217,13 +217,13 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { - S.TieNumericTextBox(_("Analysis Time:"), + S.TieIntegerTextBox(_("Analysis Time:"), wxT("/AudioIO/AnalysisTime"), AILA_DEF_ANALYSIS_TIME, 9); S.AddUnits(_("milliseconds (time of one analysis)")); - S.TieNumericTextBox(_("Number of consecutive analysis:"), + S.TieIntegerTextBox(_("Number of consecutive analysis:"), wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS, 2); From d4ffbe0d68ffac2ab34e53eda2d2f79801b931c7 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 3 Apr 2019 10:57:59 -0400 Subject: [PATCH 3/3] Group setting path & default value arguments of Tie...() functions --- src/ShuttleGui.cpp | 87 +++++++++++------------- src/ShuttleGui.h | 39 ++++++----- src/SoundActivatedRecord.cpp | 2 +- src/commands/GetInfoCommand.cpp | 104 ++++++++++++----------------- src/export/ExportCL.cpp | 4 +- src/export/ExportFFmpegDialogs.cpp | 54 +++++++-------- src/export/ExportMP2.cpp | 4 +- src/export/ExportMP3.cpp | 6 +- src/export/ExportMultiple.cpp | 8 +-- src/prefs/BatchPrefs.cpp | 2 +- src/prefs/DevicePrefs.cpp | 8 +-- src/prefs/DirectoriesPrefs.cpp | 4 +- src/prefs/EffectsPrefs.cpp | 11 +-- src/prefs/ExtImportPrefs.cpp | 4 +- src/prefs/GUIPrefs.cpp | 28 ++++---- src/prefs/ImportExportPrefs.cpp | 8 +-- src/prefs/MidiIOPrefs.cpp | 4 +- src/prefs/PlaybackPrefs.cpp | 28 ++++---- src/prefs/QualityPrefs.cpp | 4 +- src/prefs/RecordingPrefs.cpp | 79 +++++++++++----------- src/prefs/TracksBehaviorsPrefs.cpp | 36 +++++----- src/prefs/TracksPrefs.cpp | 24 +++---- src/prefs/WarningsPrefs.cpp | 28 ++++---- 23 files changed, 280 insertions(+), 296 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index bfa23a1e5..8729151e4 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -1751,16 +1751,15 @@ bool ShuttleGuiBase::DoStep( int iStep ) /// between gui and stack variable and stack variable and shuttle. wxCheckBox * ShuttleGuiBase::TieCheckBox( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault) + const SettingSpec< bool > &Setting) { wxCheckBox * pCheck=NULL; - bool bValue=bDefault; - WrappedType WrappedRef( bValue ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pCheck = DoTieCheckBox( Prompt, WrappedRef ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pCheck; } @@ -1769,16 +1768,15 @@ wxCheckBox * ShuttleGuiBase::TieCheckBox( /// between gui and stack variable and stack variable and shuttle. wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault) + const SettingSpec< bool > &Setting) { wxCheckBox * pCheck=NULL; - bool bValue=bDefault; - WrappedType WrappedRef( bValue ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pCheck = DoTieCheckBoxOnRight( Prompt, WrappedRef ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pCheck; } @@ -1787,18 +1785,17 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight( /// between gui and stack variable and stack variable and shuttle. wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, - const wxString &SettingName, - const int iDefault, + const SettingSpec< int > &Setting, const int max, const int min) { wxSlider * pSlider=NULL; - int iValue=iDefault; - WrappedType WrappedRef( iValue ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pSlider = DoTieSlider( Prompt, WrappedRef, max, min ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pSlider; } @@ -1807,18 +1804,17 @@ wxSlider * ShuttleGuiBase::TieSlider( /// between gui and stack variable and stack variable and shuttle. wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( const wxString &Prompt, - const wxString &SettingName, - const int Value, + const SettingSpec< int > &Setting, const int max, const int min) { wxSpinCtrl * pSpinCtrl=NULL; - int iValue = Value; - WrappedType WrappedRef( iValue ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pSpinCtrl = DoTieSpinCtrl( Prompt, WrappedRef, max, min ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pSpinCtrl; } @@ -1827,17 +1823,16 @@ wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( /// between gui and stack variable and stack variable and shuttle. wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString & Prompt, - const wxString & SettingName, - const wxString & Default, + const SettingSpec< wxString > &Setting, const int nChars) { wxTextCtrl * pText=(wxTextCtrl*)NULL; - wxString Temp = Default; - WrappedType WrappedRef( Temp ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pText = DoTieTextBox( Prompt, WrappedRef, nChars ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pText; } @@ -1846,17 +1841,16 @@ wxTextCtrl * ShuttleGuiBase::TieTextBox( /// This one does it for double values... wxTextCtrl * ShuttleGuiBase::TieIntegerTextBox( const wxString & Prompt, - const wxString & SettingName, - const int & Default, + const SettingSpec< int > &Setting, const int nChars) { wxTextCtrl * pText=(wxTextCtrl*)NULL; - auto Temp = Default; - WrappedType WrappedRef( Temp ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pText; } @@ -1865,17 +1859,16 @@ wxTextCtrl * ShuttleGuiBase::TieIntegerTextBox( /// This one does it for double values... wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( const wxString & Prompt, - const wxString & SettingName, - const double & Default, + const SettingSpec< double > &Setting, const int nChars) { wxTextCtrl * pText=(wxTextCtrl*)NULL; - auto Temp = Default; - WrappedType WrappedRef( Temp ); - if( DoStep(1) ) DoDataShuttle( SettingName, WrappedRef ); + auto Value = Setting.GetDefault(); + WrappedType WrappedRef( Value ); + if( DoStep(1) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); if( DoStep(2) ) pText = DoTieNumericTextBox( Prompt, WrappedRef, nChars ); - if( DoStep(3) ) DoDataShuttle( SettingName, WrappedRef ); + if( DoStep(3) ) DoDataShuttle( Setting.GetPath(), WrappedRef ); return pText; } @@ -1929,8 +1922,7 @@ wxChoice *ShuttleGuiBase::TieChoice( /// if null, then use 0, 1, 2, ... wxChoice * ShuttleGuiBase::TieNumberAsChoice( const wxString &Prompt, - const wxString &SettingName, - const int Default, + const SettingSpec< int > &Setting, const wxArrayStringEx & Choices, const std::vector * pInternalChoices) { @@ -1944,6 +1936,7 @@ wxChoice * ShuttleGuiBase::TieNumberAsChoice( for ( int ii = 0; ii < Choices.size(); ++ii ) InternalChoices.push_back( fn( ii ) ); + const auto Default = Setting.GetDefault(); long defaultIndex; if ( pInternalChoices ) defaultIndex = make_iterator_range( *pInternalChoices ).index( Default ); @@ -1952,8 +1945,8 @@ wxChoice * ShuttleGuiBase::TieNumberAsChoice( if ( defaultIndex < 0 || defaultIndex >= Choices.size() ) defaultIndex = -1; - ChoiceSetting Setting{ - SettingName, + ChoiceSetting choiceSetting{ + Setting.GetPath(), { ByColumns, Choices, @@ -1962,7 +1955,7 @@ wxChoice * ShuttleGuiBase::TieNumberAsChoice( defaultIndex }; - return ShuttleGuiBase::TieChoice( Prompt, Setting ); + return ShuttleGuiBase::TieChoice( Prompt, choiceSetting ); } //------------------------------------------------------------------// diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 48501a36c..b70b463da 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -15,6 +15,7 @@ #define SHUTTLE_GUI #include "Audacity.h" +#include "audacity/Types.h" #include #include // to inherit @@ -103,6 +104,20 @@ using wxStaticBoxWrapper = wxStaticBox; using wxSliderWrapper = wxSlider; #endif +template< typename T > class SettingSpec { +public: + SettingSpec( const RegistryPath &path, const T &defaultValue = {} ) + : mPath{ path }, mDefaultValue{ defaultValue } + {} + + const RegistryPath &GetPath() const { return mPath; } + const T &GetDefault() const { return mDefaultValue; } + +private: + RegistryPath mPath; + T mDefaultValue; +}; + class AUDACITY_DLL_API ShuttleGuiBase /* not final */ { public: @@ -215,12 +230,10 @@ public: // so it doesn't need an argument that is writeable. virtual wxCheckBox * TieCheckBox( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault); + const SettingSpec< bool > &Setting); virtual wxCheckBox * TieCheckBoxOnRight( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault); + const SettingSpec< bool > &Setting); virtual wxChoice *TieChoice( const wxString &Prompt, @@ -233,36 +246,30 @@ public: // emitting scripting information about Preferences. virtual wxChoice * TieNumberAsChoice( const wxString &Prompt, - const wxString &SettingName, - const int Default, + const SettingSpec< int > &Setting, const wxArrayStringEx & Choices, const std::vector * pInternalChoices = nullptr ); virtual wxTextCtrl * TieTextBox( const wxString &Prompt, - const wxString &SettingName, - const wxString &Default, + const SettingSpec< wxString > &Setting, const int nChars); virtual wxTextCtrl * TieIntegerTextBox( const wxString & Prompt, - const wxString & SettingName, - const int & Default, + const SettingSpec< int > &Setting, const int nChars); virtual wxTextCtrl * TieNumericTextBox( const wxString & Prompt, - const wxString & SettingName, - const double & Default, + const SettingSpec< double > &Setting, const int nChars); virtual wxSlider * TieSlider( const wxString & Prompt, - const wxString & SettingName, - const int iDefault, + const SettingSpec< int > &Setting, const int max, const int min = 0); virtual wxSpinCtrl * TieSpinCtrl( const wxString &Prompt, - const wxString &SettingName, - const int Value, + const SettingSpec< int > &Setting, const int max, const int min); //-- End of variants. diff --git a/src/SoundActivatedRecord.cpp b/src/SoundActivatedRecord.cpp index 5b3a88054..fb2e1f050 100644 --- a/src/SoundActivatedRecord.cpp +++ b/src/SoundActivatedRecord.cpp @@ -55,7 +55,7 @@ void SoundActivatedRecord::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(2, wxEXPAND); S.SetStretchyCol(1); dBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE); - S.TieSlider(_("Activation level (dB):"), wxT("/AudioIO/SilenceLevel"), -50, 0, -dBRange); + S.TieSlider(_("Activation level (dB):"), {wxT("/AudioIO/SilenceLevel"), -50}, 0, -dBRange); S.EndMultiColumn(); } S.EndVerticalLay(); diff --git a/src/commands/GetInfoCommand.cpp b/src/commands/GetInfoCommand.cpp index f8b8671a6..b20fa1668 100644 --- a/src/commands/GetInfoCommand.cpp +++ b/src/commands/GetInfoCommand.cpp @@ -200,45 +200,37 @@ public: wxCheckBox * TieCheckBox( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault) override; + const SettingSpec< bool > &Setting) override; wxCheckBox * TieCheckBoxOnRight( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault) override; + const SettingSpec< bool > &Setting) override; wxChoice * TieNumberAsChoice( const wxString &Prompt, - const wxString &SettingName, - const int Default, + const SettingSpec< int > &Setting, const wxArrayStringEx & Choices, const std::vector * pInternalChoices) override; wxTextCtrl * TieTextBox( const wxString &Prompt, - const wxString &SettingName, - const wxString &Default, + const SettingSpec< wxString > &Setting, const int nChars) override; wxTextCtrl * TieIntegerTextBox( const wxString & Prompt, - const wxString & SettingName, - const int & Default, + const SettingSpec< int > &Setting, const int nChars) override; wxTextCtrl * TieNumericTextBox( const wxString & Prompt, - const wxString & SettingName, - const double & Default, + const SettingSpec< double > &Setting, const int nChars) override; wxSlider * TieSlider( const wxString & Prompt, - const wxString & SettingName, - const int iDefault, + const SettingSpec< int > &Setting, const int max, const int min = 0) override; wxSpinCtrl * TieSpinCtrl( const wxString &Prompt, - const wxString &SettingName, - const int Value, + const SettingSpec< int > &Setting, const int max, const int min) override; }; @@ -256,34 +248,31 @@ ShuttleGuiGetDefinition::~ShuttleGuiGetDefinition(void) wxCheckBox * ShuttleGuiGetDefinition::TieCheckBox( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault) -{ + const SettingSpec< bool > &Setting) +{ StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "bool", "type" ); - AddBool( bDefault, "default" ); + AddBool( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieCheckBox( Prompt, SettingName, bDefault ); + return ShuttleGui::TieCheckBox( Prompt, Setting ); } wxCheckBox * ShuttleGuiGetDefinition::TieCheckBoxOnRight( const wxString &Prompt, - const wxString &SettingName, - const bool bDefault) + const SettingSpec< bool > &Setting) { StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "bool", "type" ); - AddBool( bDefault, "default" ); + AddBool( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieCheckBoxOnRight( Prompt, SettingName, bDefault ); + return ShuttleGui::TieCheckBoxOnRight( Prompt, Setting ); } wxChoice * ShuttleGuiGetDefinition::TieNumberAsChoice( const wxString &Prompt, - const wxString &SettingName, - const int Default, + const SettingSpec< int > &Setting, const wxArrayStringEx & Choices, const std::vector * pInternalChoices) { @@ -291,85 +280,80 @@ wxChoice * ShuttleGuiGetDefinition::TieNumberAsChoice( // numbers, with an associated control that allows arbitrary entry of an // "Other..." StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "number", "type" ); // not "enum" ! - AddItem( Default, "default" ); + AddItem( Setting.GetDefault(), "default" ); EndStruct(); return ShuttleGui::TieNumberAsChoice( - Prompt, SettingName, Default, Choices, pInternalChoices ); + Prompt, Setting, Choices, pInternalChoices ); } wxTextCtrl * ShuttleGuiGetDefinition::TieTextBox( const wxString &Prompt, - const wxString &SettingName, - const wxString &Default, - const int nChars) + const SettingSpec< wxString > &Setting, + const int nChars) { StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "string", "type" ); - AddItem( Default, "default" ); + AddItem( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieTextBox( Prompt, SettingName, Default, nChars ); + return ShuttleGui::TieTextBox( Prompt, Setting, nChars ); } wxTextCtrl * ShuttleGuiGetDefinition::TieIntegerTextBox( const wxString & Prompt, - const wxString & SettingName, - const int & Default, - const int nChars) + const SettingSpec< int > &Setting, + const int nChars) { StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "number", "type" ); - AddItem( Default, "default" ); + AddItem( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieIntegerTextBox( Prompt, SettingName, Default, nChars ); + return ShuttleGui::TieIntegerTextBox( Prompt, Setting, nChars ); } wxTextCtrl * ShuttleGuiGetDefinition::TieNumericTextBox( const wxString & Prompt, - const wxString & SettingName, - const double & Default, - const int nChars) + const SettingSpec< double > &Setting, + const int nChars) { StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "number", "type" ); - AddItem( Default, "default" ); + AddItem( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieNumericTextBox( Prompt, SettingName, Default, nChars ); + return ShuttleGui::TieNumericTextBox( Prompt, Setting, nChars ); } wxSlider * ShuttleGuiGetDefinition::TieSlider( const wxString & Prompt, - const wxString & SettingName, - const int iDefault, + const SettingSpec< int > &Setting, const int max, const int min) { StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "number", "type" ); - AddItem( iDefault, "default" ); + AddItem( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieSlider( Prompt, SettingName, iDefault, max, min ); + return ShuttleGui::TieSlider( Prompt, Setting, max, min ); } wxSpinCtrl * ShuttleGuiGetDefinition::TieSpinCtrl( const wxString &Prompt, - const wxString &SettingName, - const int Value, + const SettingSpec< int > &Setting, const int max, const int min) { StartStruct(); - AddItem( SettingName, "id" ); + AddItem( Setting.GetPath(), "id" ); AddItem( Prompt, "prompt" ); AddItem( "number", "type" ); - AddItem( Value, "default" ); + AddItem( Setting.GetDefault(), "default" ); EndStruct(); - return ShuttleGui::TieSpinCtrl( Prompt, SettingName, Value, max, min ); + return ShuttleGui::TieSpinCtrl( Prompt, Setting, max, min ); } } diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index 0b68fb7fb..f4489915b 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -126,8 +126,8 @@ void ExportCLOptions::PopulateOrExchange(ShuttleGui & S) wxALIGN_CENTER_VERTICAL); S.AddFixedText( {} ); S.TieCheckBox(_("Show output"), - wxT("/FileFormats/ExternalProgramShowOutput"), - false); + {wxT("/FileFormats/ExternalProgramShowOutput"), + false}); } S.EndMultiColumn(); } diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index 193c962e9..0bff2b65e 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -216,8 +216,8 @@ void ExportFFmpegAC3Options::PopulateOrExchange(ShuttleGui & S) { S.TieNumberAsChoice( _("Bit Rate:"), - wxT("/FileFormats/AC3BitRate"), - 160000, + {wxT("/FileFormats/AC3BitRate"), + 160000}, AC3BitRateNames, &AC3BitRateValues ); @@ -278,7 +278,7 @@ void ExportFFmpegAACOptions::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(2, wxCENTER); { S.SetStretchyCol(1); - S.Prop(1).TieSlider(_("Quality (kbps):"),wxT("/FileFormats/AACQuality"),160,320,98); + S.Prop(1).TieSlider(_("Quality (kbps):"), {wxT("/FileFormats/AACQuality"), 160},320, 98); } S.EndMultiColumn(); } @@ -367,8 +367,8 @@ void ExportFFmpegAMRNBOptions::PopulateOrExchange(ShuttleGui & S) { S.TieNumberAsChoice( _("Bit Rate:"), - wxT("/FileFormats/AMRNBBitRate"), - 12200, + {wxT("/FileFormats/AMRNBBitRate"), + 12200}, AMRNBBitRateNames, &AMRNBBitRateValues ); @@ -469,8 +469,8 @@ void ExportFFmpegWMAOptions::PopulateOrExchange(ShuttleGui & S) { S.TieNumberAsChoice( _("Bit Rate:"), - wxT("/FileFormats/WMABitRate"), - 128000, + {wxT("/FileFormats/WMABitRate"), + 128000}, WMABitRateNames, &WMABitRateValues ); @@ -1579,33 +1579,33 @@ void ExportFFmpegOptions::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn(8, wxEXPAND); { - mLanguageText = S.Id(FELanguageID).TieTextBox(_("Language:"), wxT("/FileFormats/FFmpegLanguage"), wxEmptyString, 9); + mLanguageText = S.Id(FELanguageID).TieTextBox(_("Language:"), {wxT("/FileFormats/FFmpegLanguage"), wxEmptyString}, 9); mLanguageText->SetToolTip(_("ISO 639 3-letter language code\nOptional\nempty - automatic")); S.AddSpace( 20,0 ); S.AddVariableText(_("Bit Reservoir")); - S.Id(FEBitReservoirID).TieCheckBox( {}, wxT("/FileFormats/FFmpegBitReservoir"), true); + S.Id(FEBitReservoirID).TieCheckBox( {}, {wxT("/FileFormats/FFmpegBitReservoir"), true}); S.AddSpace( 20,0 ); S.AddVariableText(_("VBL")); - S.Id(FEVariableBlockLenID).TieCheckBox( {}, wxT("/FileFormats/FFmpegVariableBlockLen"), true); + S.Id(FEVariableBlockLenID).TieCheckBox( {}, {wxT("/FileFormats/FFmpegVariableBlockLen"), true}); } S.EndMultiColumn(); S.StartMultiColumn(4, wxALIGN_LEFT); { - mTag = S.Id(FETagID).TieTextBox(_("Tag:"), wxT("/FileFormats/FFmpegTag"), wxEmptyString, 4); + mTag = S.Id(FETagID).TieTextBox(_("Tag:"), {wxT("/FileFormats/FFmpegTag"), wxEmptyString}, 4); mTag->SetToolTip(_("Codec tag (FOURCC)\nOptional\nempty - automatic")); - mBitrateSpin = S.Id(FEBitrateID).TieSpinCtrl(_("Bit Rate:"), wxT("/FileFormats/FFmpegBitRate"), 0, 1000000, 0); + mBitrateSpin = S.Id(FEBitrateID).TieSpinCtrl(_("Bit Rate:"), {wxT("/FileFormats/FFmpegBitRate"), 0}, 1000000, 0); mBitrateSpin->SetToolTip(_("Bit Rate (bits/second) - influences the resulting file size and quality\nSome codecs may only accept specific values (128k, 192k, 256k etc)\n0 - automatic\nRecommended - 192000")); - mQualitySpin = S.Id(FEQualityID).TieSpinCtrl(_("Quality:"), wxT("/FileFormats/FFmpegQuality"), 0, 500, -1); + mQualitySpin = S.Id(FEQualityID).TieSpinCtrl(_("Quality:"), {wxT("/FileFormats/FFmpegQuality"), 0}, 500, -1); mQualitySpin->SetToolTip(_("Overall quality, used differently by different codecs\nRequired for vorbis\n0 - automatic\n-1 - off (use bitrate instead)")); - mSampleRateSpin = S.Id(FESampleRateID).TieSpinCtrl(_("Sample Rate:"), wxT("/FileFormats/FFmpegSampleRate"), 0, 200000, 0); + mSampleRateSpin = S.Id(FESampleRateID).TieSpinCtrl(_("Sample Rate:"), {wxT("/FileFormats/FFmpegSampleRate"), 0}, 200000, 0); mSampleRateSpin->SetToolTip(_("Sample rate (Hz)\n0 - don't change sample rate")); - mCutoffSpin = S.Id(FECutoffID).TieSpinCtrl(_("Cutoff:"), wxT("/FileFormats/FFmpegCutOff"), 0, 10000000, 0); + mCutoffSpin = S.Id(FECutoffID).TieSpinCtrl(_("Cutoff:"), {wxT("/FileFormats/FFmpegCutOff"), 0}, 10000000, 0); mCutoffSpin->SetToolTip(_("Audio cutoff bandwidth (Hz)\nOptional\n0 - automatic")); mProfileChoice = S.Id(FEProfileID) @@ -1621,42 +1621,42 @@ void ExportFFmpegOptions::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn(4, wxALIGN_LEFT); { - mCompressionLevelSpin = S.Id(FECompLevelID).TieSpinCtrl(_("Compression:"), wxT("/FileFormats/FFmpegCompLevel"), 0, 10, -1); + mCompressionLevelSpin = S.Id(FECompLevelID).TieSpinCtrl(_("Compression:"), {wxT("/FileFormats/FFmpegCompLevel"), 0}, 10, -1); mCompressionLevelSpin->SetToolTip(_("Compression level\nRequired for FLAC\n-1 - automatic\nmin - 0 (fast encoding, large output file)\nmax - 10 (slow encoding, small output file)")); - mFrameSizeSpin = S.Id(FEFrameSizeID).TieSpinCtrl(_("Frame:"), wxT("/FileFormats/FFmpegFrameSize"), 0, 65535, 0); + mFrameSizeSpin = S.Id(FEFrameSizeID).TieSpinCtrl(_("Frame:"), {wxT("/FileFormats/FFmpegFrameSize"), 0}, 65535, 0); mFrameSizeSpin->SetToolTip(_("Frame size\nOptional\n0 - default\nmin - 16\nmax - 65535")); - mLPCCoeffsPrecisionSpin = S.Id(FELPCCoeffsID).TieSpinCtrl(_("LPC"), wxT("/FileFormats/FFmpegLPCCoefPrec"), 0, 15, 0); + mLPCCoeffsPrecisionSpin = S.Id(FELPCCoeffsID).TieSpinCtrl(_("LPC"), {wxT("/FileFormats/FFmpegLPCCoefPrec"), 0}, 15, 0); mLPCCoeffsPrecisionSpin->SetToolTip(_("LPC coefficients precision\nOptional\n0 - default\nmin - 1\nmax - 15")); mPredictionOrderMethodChoice = S.Id(FEPredOrderID) .TieNumberAsChoice( _("PdO Method:"), - wxT("/FileFormats/FFmpegPredOrderMethod"), - 4, // Full search + {wxT("/FileFormats/FFmpegPredOrderMethod"), + 4}, // Full search PredictionOrderMethodNames ); mPredictionOrderMethodChoice->SetSizeHints( 100,-1); mPredictionOrderMethodChoice->SetToolTip(_("Prediction Order Method\nEstimate - fastest, lower compression\nLog search - slowest, best compression\nFull search - default")); - mMinPredictionOrderSpin = S.Id(FEMinPredID).TieSpinCtrl(_("Min. PdO"), wxT("/FileFormats/FFmpegMinPredOrder"), -1, 32, -1); + mMinPredictionOrderSpin = S.Id(FEMinPredID).TieSpinCtrl(_("Min. PdO"), {wxT("/FileFormats/FFmpegMinPredOrder"), -1}, 32, -1); mMinPredictionOrderSpin->SetToolTip(_("Minimal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)")); - mMaxPredictionOrderSpin = S.Id(FEMaxPredID).TieSpinCtrl(_("Max. PdO"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1, 32, -1); + mMaxPredictionOrderSpin = S.Id(FEMaxPredID).TieSpinCtrl(_("Max. PdO"), {wxT("/FileFormats/FFmpegMaxPredOrder"), -1}, 32, -1); mMaxPredictionOrderSpin->SetToolTip(_("Maximal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)")); - mMinPartitionOrderSpin = S.Id(FEMinPartOrderID).TieSpinCtrl(_("Min. PtO"), wxT("/FileFormats/FFmpegMinPartOrder"), -1, 8, -1); + mMinPartitionOrderSpin = S.Id(FEMinPartOrderID).TieSpinCtrl(_("Min. PtO"), {wxT("/FileFormats/FFmpegMinPartOrder"), -1}, 8, -1); mMinPartitionOrderSpin->SetToolTip(_("Minimal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8")); - mMaxPartitionOrderSpin = S.Id(FEMaxPartOrderID).TieSpinCtrl(_("Max. PtO"), wxT("/FileFormats/FFmpegMaxPartOrder"), -1, 8, -1); + mMaxPartitionOrderSpin = S.Id(FEMaxPartOrderID).TieSpinCtrl(_("Max. PtO"), {wxT("/FileFormats/FFmpegMaxPartOrder"), -1}, 8, -1); mMaxPartitionOrderSpin->SetToolTip(_("Maximal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8")); /* i18n-hint: Abbreviates "Linear Predictive Coding", but this text needs to be kept very short */ S.AddVariableText(_("Use LPC")); // PRL: This preference is not used anywhere! - S.Id(FEUseLPCID).TieCheckBox( {}, wxT("/FileFormats/FFmpegUseLPC"), true); + S.Id(FEUseLPCID).TieCheckBox( {}, {wxT("/FileFormats/FFmpegUseLPC"), true}); } S.EndMultiColumn(); } @@ -1668,12 +1668,12 @@ void ExportFFmpegOptions::PopulateOrExchange(ShuttleGui & S) /* i18n-hint: 'mux' is short for multiplexor, a device that selects between several inputs 'Mux Rate' is a parameter that has some bearing on compression ratio for MPEG it has a hard to predict effect on the degree of compression */ - mMuxRate = S.Id(FEMuxRateID).TieSpinCtrl(_("Mux Rate:"), wxT("/FileFormats/FFmpegMuxRate"), 0, 10000000, 0); + mMuxRate = S.Id(FEMuxRateID).TieSpinCtrl(_("Mux Rate:"), {wxT("/FileFormats/FFmpegMuxRate"), 0}, 10000000, 0); mMuxRate->SetToolTip(_("Maximum bit rate of the multiplexed stream\nOptional\n0 - default")); /* i18n-hint: 'Packet Size' is a parameter that has some bearing on compression ratio for MPEG compression. It measures how big a chunk of audio is compressed in one piece. */ - mPacketSize = S.Id(FEPacketSizeID).TieSpinCtrl(_("Packet Size:"), wxT("/FileFormats/FFmpegPacketSize"), 0, 10000000, 0); + mPacketSize = S.Id(FEPacketSizeID).TieSpinCtrl(_("Packet Size:"), {wxT("/FileFormats/FFmpegPacketSize"), 0}, 10000000, 0); mPacketSize->SetToolTip(_("Packet size\nOptional\n0 - default")); } S.EndMultiColumn(); diff --git a/src/export/ExportMP2.cpp b/src/export/ExportMP2.cpp index 934cb0f7a..b99b7243b 100644 --- a/src/export/ExportMP2.cpp +++ b/src/export/ExportMP2.cpp @@ -161,8 +161,8 @@ void ExportMP2Options::PopulateOrExchange(ShuttleGui & S) { S.TieNumberAsChoice( _("Bit Rate:"), - wxT("/FileFormats/MP2Bitrate"), - 160, + {wxT("/FileFormats/MP2Bitrate"), + 160}, BitRateNames, &BitRateValues ); diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index eb9188edc..3847bb880 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -379,16 +379,14 @@ void ExportMP3Options::PopulateOrExchange(ShuttleGui & S) mRate = S.Id(ID_QUALITY).TieNumberAsChoice( _("Quality"), - wxT("/FileFormats/MP3Bitrate"), - defrate, + { wxT("/FileFormats/MP3Bitrate"), defrate }, *choices, codes ); mMode = S.TieNumberAsChoice( _("Variable Speed:"), - wxT("/FileFormats/MP3VarMode"), - ROUTINE_FAST, + { wxT("/FileFormats/MP3VarMode"), ROUTINE_FAST }, varModeNames ); mMode->Enable(enable); diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index 2e4cc746d..644be945b 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -266,8 +266,8 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S) { mDir = S.Id(DirID) .TieTextBox(_("Folder:"), - wxT("/Export/MultiplePath"), - DefaultPath, + {wxT("/Export/MultiplePath"), + DefaultPath}, 64); S.Id(ChooseID).AddButton(_("Choose...")); S.Id(CreateID).AddButton(_("Create")); @@ -395,8 +395,8 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S) S.StartHorizontalLay(wxEXPAND, false); { mOverwrite = S.Id(OverwriteID).TieCheckBox(_("Overwrite existing files"), - wxT("/Export/OverwriteExisting"), - false); + {wxT("/Export/OverwriteExisting"), + false}); } S.EndHorizontalLay(); diff --git a/src/prefs/BatchPrefs.cpp b/src/prefs/BatchPrefs.cpp index e6d599377..ce112d6a6 100644 --- a/src/prefs/BatchPrefs.cpp +++ b/src/prefs/BatchPrefs.cpp @@ -73,7 +73,7 @@ void BatchPrefs::PopulateOrExchange( ShuttleGui & S ) { #ifdef __WXDEBUG__ S.TieCheckBox( _("&Don't apply effects in batch mode"), - wxT("/Batch/Debug"), false); + {wxT("/Batch/Debug"), false}); #endif } S.EndStatic(); diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index 855d5acf4..257947b3d 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -186,15 +186,15 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) // only show the following controls if we use Portaudio v19, because // for Portaudio v18 we always use default buffer sizes w = S.TieNumericTextBox(_("&Buffer length:"), - wxT("/AudioIO/LatencyDuration"), - DEFAULT_LATENCY_DURATION, + {wxT("/AudioIO/LatencyDuration"), + DEFAULT_LATENCY_DURATION}, 9); S.AddUnits(_("milliseconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds")); w = S.TieNumericTextBox(_("&Latency compensation:"), - wxT("/AudioIO/LatencyCorrection"), - DEFAULT_LATENCY_CORRECTION, + {wxT("/AudioIO/LatencyCorrection"), + DEFAULT_LATENCY_CORRECTION}, 9); S.AddUnits(_("milliseconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds")); diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index 5b27c8239..d0544baa7 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -104,8 +104,8 @@ void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S) S.Id(TempDirID); mTempDir = S.TieTextBox(_("&Location:"), - wxT("/Directories/TempDir"), - wxT(""), + {wxT("/Directories/TempDir"), + wxT("")}, 30); } S.EndMultiColumn(); diff --git a/src/prefs/EffectsPrefs.cpp b/src/prefs/EffectsPrefs.cpp index 65836314e..8395384c5 100644 --- a/src/prefs/EffectsPrefs.cpp +++ b/src/prefs/EffectsPrefs.cpp @@ -188,8 +188,8 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S) { S.TieCheckBox( GetCustomTranslation( entry.prompt ), - entry.setting, - true + {entry.setting, + true} ); } } @@ -203,12 +203,13 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S) if( c ) c->SetMinSize(c->GetBestSize()); S.TieIntegerTextBox(_("&Maximum effects per group (0 to disable):"), - wxT("/Effects/MaxPerGroup"), + {wxT("/Effects/MaxPerGroup"), #if defined(__WXGTK__) - 15, + 15 #else - 0, + 0 #endif + }, 5); } S.EndMultiColumn(); diff --git a/src/prefs/ExtImportPrefs.cpp b/src/prefs/ExtImportPrefs.cpp index 5903c2027..cd48a99c9 100644 --- a/src/prefs/ExtImportPrefs.cpp +++ b/src/prefs/ExtImportPrefs.cpp @@ -104,8 +104,8 @@ void ExtImportPrefs::PopulateOrExchange(ShuttleGui & S) S.StartScroller(); S.TieCheckBox(_("A&ttempt to use filter in OpenFile dialog first"), - wxT("/ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice"), - true); + {wxT("/ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice"), + true}); S.StartStatic(_("Rules to choose import filters"), 1); { S.SetSizerProportion(1); diff --git a/src/prefs/GUIPrefs.cpp b/src/prefs/GUIPrefs.cpp index 92bcdc087..d82446888 100644 --- a/src/prefs/GUIPrefs.cpp +++ b/src/prefs/GUIPrefs.cpp @@ -227,32 +227,32 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S) { // Start wording of options with a verb, if possible. S.TieCheckBox(_("Show 'How to Get &Help' at launch"), - wxT("/GUI/ShowSplashScreen"), - true); + {wxT("/GUI/ShowSplashScreen"), + true}); S.TieCheckBox(_("Show e&xtra menus"), - wxT("/GUI/ShowExtraMenus"), - false); + {wxT("/GUI/ShowExtraMenus"), + false}); #ifdef EXPERIMENTAL_THEME_PREFS // We do not want to make this option mainstream. It's a // convenience for developers. S.TieCheckBox(_("Show alternative &styling (Mac vs PC)"), - wxT("/GUI/ShowMac"), - false); + {wxT("/GUI/ShowMac"), + false}); #endif S.TieCheckBox(_("&Beep on completion of longer activities"), - wxT("/GUI/BeepOnCompletion"), - false); + {wxT("/GUI/BeepOnCompletion"), + false}); S.TieCheckBox(_("Re&tain labels if selection snaps to a label"), - wxT("/GUI/RetainLabels"), - false); + {wxT("/GUI/RetainLabels"), + false}); S.TieCheckBox(_("B&lend system and Audacity theme"), - wxT("/GUI/BlendThemes"), - true); + {wxT("/GUI/BlendThemes"), + true}); #ifndef __WXMAC__ /* i18n-hint: RTL stands for 'Right to Left' */ S.TieCheckBox(_("Use mostly Left-to-Right layouts in RTL languages"), - "/GUI/RtlWorkaround", - true); + {"/GUI/RtlWorkaround", + true}); #endif } S.EndStatic(); diff --git a/src/prefs/ImportExportPrefs.cpp b/src/prefs/ImportExportPrefs.cpp index 92c3c1064..583cd5abc 100644 --- a/src/prefs/ImportExportPrefs.cpp +++ b/src/prefs/ImportExportPrefs.cpp @@ -118,12 +118,12 @@ void ImportExportPrefs::PopulateOrExchange(ShuttleGui & S) S.EndRadioButtonGroup(); S.TieCheckBox(_("S&how Metadata Tags editor before export"), - wxT("/AudioFiles/ShowId3Dialog"), - true); + {wxT("/AudioFiles/ShowId3Dialog"), + true}); /* i18n-hint 'blank space' is space on the tracks with no audio in it*/ S.TieCheckBox(_("&Ignore blank space at the beginning"), - wxT("/AudioFiles/SkipSilenceAtBeginning"), - false); + {wxT("/AudioFiles/SkipSilenceAtBeginning"), + false}); } S.EndStatic(); #ifdef USE_MIDI diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 8e61a405c..295c662c4 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -159,8 +159,8 @@ void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) { mPlay = S.AddChoice(_("&Device:"), {} ); mLatency = S.TieIntegerTextBox(_("MIDI Synth L&atency (ms):"), - wxT("/MidiIO/SynthLatency"), - DEFAULT_SYNTH_LATENCY, 3); + {wxT("/MidiIO/SynthLatency"), + DEFAULT_SYNTH_LATENCY}, 3); } S.EndMultiColumn(); } diff --git a/src/prefs/PlaybackPrefs.cpp b/src/prefs/PlaybackPrefs.cpp index bf23c90a6..6b8066a74 100644 --- a/src/prefs/PlaybackPrefs.cpp +++ b/src/prefs/PlaybackPrefs.cpp @@ -87,8 +87,8 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { w = S.TieNumericTextBox(_("&Length:"), - wxT("/AudioIO/EffectsPreviewLen"), - 6.0, + {wxT("/AudioIO/EffectsPreviewLen"), + 6.0}, 9); S.AddUnits(_("seconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); @@ -103,15 +103,15 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { w = S.TieNumericTextBox(_("&Before cut region:"), - wxT("/AudioIO/CutPreviewBeforeLen"), - 2.0, + {wxT("/AudioIO/CutPreviewBeforeLen"), + 2.0}, 9); S.AddUnits(_("seconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); w = S.TieNumericTextBox(_("&After cut region:"), - wxT("/AudioIO/CutPreviewAfterLen"), - 1.0, + {wxT("/AudioIO/CutPreviewAfterLen"), + 1.0}, 9); S.AddUnits(_("seconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); @@ -125,15 +125,15 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { w = S.TieNumericTextBox(_("&Short period:"), - wxT("/AudioIO/SeekShortPeriod"), - 1.0, + {wxT("/AudioIO/SeekShortPeriod"), + 1.0}, 9); S.AddUnits(_("seconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); w = S.TieNumericTextBox(_("Lo&ng period:"), - wxT("/AudioIO/SeekLongPeriod"), - 15.0, + {wxT("/AudioIO/SeekLongPeriod"), + 15.0}, 9); S.AddUnits(_("seconds")); if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); @@ -146,11 +146,11 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartVerticalLay(); { - S.TieCheckBox(_("&Vari-Speed Play"), "/AudioIO/VariSpeedPlay", true); - S.TieCheckBox(_("&Micro-fades"), "/AudioIO/Microfades", false); + S.TieCheckBox(_("&Vari-Speed Play"), {"/AudioIO/VariSpeedPlay", true}); + S.TieCheckBox(_("&Micro-fades"), {"/AudioIO/Microfades", false}); S.TieCheckBox(_("Always scrub un&pinned"), - UnpinnedScrubbingPreferenceKey(), - UnpinnedScrubbingPreferenceDefault()); + {UnpinnedScrubbingPreferenceKey(), + UnpinnedScrubbingPreferenceDefault()}); } S.EndVerticalLay(); } diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index 8d507c3b9..8098e6cc5 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -154,8 +154,8 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) S.Id(ID_SAMPLE_RATE_CHOICE); // We make sure we have a pointer to it, so that we can drive it. mSampleRates = S.TieNumberAsChoice( {}, - wxT("/SamplingRate/DefaultProjectSampleRate"), - AudioIOBase::GetOptimalSupportedSampleRate(), + {wxT("/SamplingRate/DefaultProjectSampleRate"), + AudioIOBase::GetOptimalSupportedSampleRate()}, mSampleRateNames, &mSampleRateLabels); diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index 564a41993..d3df4e19a 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -88,35 +88,36 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) { // Start wording of options with a verb, if possible. S.TieCheckBox(_("Play &other tracks while recording (overdub)"), - wxT("/AudioIO/Duplex"), + {wxT("/AudioIO/Duplex"), #ifdef EXPERIMENTAL_DA - false); + false #else - true); + true #endif + }); //#if defined(__WXMAC__) // Bug 388. Feature not supported on any Mac Hardware. #if 0 S.TieCheckBox(_("Use &hardware to play other tracks"), - wxT("/AudioIO/Playthrough"), - false); + {wxT("/AudioIO/Playthrough"), + false}); #endif S.TieCheckBox(_("&Software playthrough of input"), - wxT("/AudioIO/SWPlaythrough"), - false); + {wxT("/AudioIO/SWPlaythrough"), + false}); #if !defined(__WXMAC__) //S.AddUnits(wxString(wxT(" ")) + _("(uncheck when recording computer playback)")); #endif S.TieCheckBox(_("Record on a new track"), - wxT("/GUI/PreferNewTrackRecord"), - false); + {wxT("/GUI/PreferNewTrackRecord"), + false}); /* i18n-hint: Dropout is a loss of a short sequence audio sample data from the recording */ S.TieCheckBox(_("Detect dropouts"), - WarningDialogKey(wxT("DropoutDetected")), - true); + {WarningDialogKey(wxT("DropoutDetected")), + true}); } @@ -125,8 +126,8 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(_("Sound Activated Recording")); { S.TieCheckBox(_("&Enable"), - wxT("/AudioIO/SoundActivatedRecord"), - false); + {wxT("/AudioIO/SoundActivatedRecord"), + false}); S.StartMultiColumn(2, wxEXPAND); { @@ -134,8 +135,8 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) int dBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE); S.TieSlider(_("Le&vel (dB):"), - wxT("/AudioIO/SilenceLevel"), - -50, + {wxT("/AudioIO/SilenceLevel"), + -50}, 0, -dBRange); } @@ -154,12 +155,12 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(3); { S.Id(UseCustomTrackNameID).TieCheckBox(_("Custom Track &Name"), - wxT("/GUI/TrackNames/RecordingNameCustom"), - mUseCustomTrackName ? true : false); + {wxT("/GUI/TrackNames/RecordingNameCustom"), + mUseCustomTrackName}); mToggleCustomName = S.TieTextBox( {}, - wxT("/GUI/TrackNames/RecodingTrackName"), - _("Recorded_Audio"), + {wxT("/GUI/TrackNames/RecodingTrackName"), + _("Recorded_Audio")}, 30); if( mToggleCustomName ) { mToggleCustomName->SetName(_("Custom name text")); @@ -172,16 +173,16 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(3); { S.TieCheckBox(_("&Track Number"), - wxT("/GUI/TrackNames/TrackNumber"), - false); + {wxT("/GUI/TrackNames/TrackNumber"), + false}); S.TieCheckBox(_("System &Date"), - wxT("/GUI/TrackNames/DateStamp"), - false); + {wxT("/GUI/TrackNames/DateStamp"), + false}); S.TieCheckBox(_("System T&ime"), - wxT("/GUI/TrackNames/TimeStamp"), - false); + {wxT("/GUI/TrackNames/TimeStamp"), + false}); } S.EndMultiColumn(); } @@ -193,8 +194,8 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(_("Automated Recording Level Adjustment")); { S.TieCheckBox(_("Enable Automated Recording Level Adjustment."), - wxT("/AudioIO/AutomatedInputLevelAdjustment"), - false); + {wxT("/AudioIO/AutomatedInputLevelAdjustment"), + false}); S.StartMultiColumn(2, wxEXPAND); { @@ -202,14 +203,14 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) /* i18n-hint: Desired maximum (peak) volume for sound */ S.TieSlider(_("Target Peak:"), - wxT("/AudioIO/TargetPeak"), - AILA_DEF_TARGET_PEAK, + {wxT("/AudioIO/TargetPeak"), + AILA_DEF_TARGET_PEAK}, 100, 0); S.TieSlider(_("Within:"), - wxT("/AudioIO/DeltaPeakVolume"), - AILA_DEF_DELTA_PEAK, + {wxT("/AudioIO/DeltaPeakVolume"), + AILA_DEF_DELTA_PEAK}, 100, 0); } @@ -218,14 +219,14 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { S.TieIntegerTextBox(_("Analysis Time:"), - wxT("/AudioIO/AnalysisTime"), - AILA_DEF_ANALYSIS_TIME, + {wxT("/AudioIO/AnalysisTime"), + AILA_DEF_ANALYSIS_TIME}, 9); S.AddUnits(_("milliseconds (time of one analysis)")); S.TieIntegerTextBox(_("Number of consecutive analysis:"), - wxT("/AudioIO/NumberAnalysis"), - AILA_DEF_NUMBER_ANALYSIS, + {wxT("/AudioIO/NumberAnalysis"), + AILA_DEF_NUMBER_ANALYSIS}, 2); S.AddUnits(_("0 means endless")); } @@ -240,16 +241,16 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { auto w = S.TieNumericTextBox(_("Pre-ro&ll:"), - AUDIO_PRE_ROLL_KEY, - DEFAULT_PRE_ROLL_SECONDS, + {AUDIO_PRE_ROLL_KEY, + DEFAULT_PRE_ROLL_SECONDS}, 9); S.AddUnits(_("seconds")); w->SetName(w->GetName() + wxT(" ") + _("seconds")); } { auto w = S.TieNumericTextBox(_("Cross&fade:"), - AUDIO_ROLL_CROSSFADE_KEY, - DEFAULT_ROLL_CROSSFADE_MS, + {AUDIO_ROLL_CROSSFADE_KEY, + DEFAULT_ROLL_CROSSFADE_MS}, 9); S.AddUnits(_("milliseconds")); w->SetName(w->GetName() + wxT(" ") + _("milliseconds")); diff --git a/src/prefs/TracksBehaviorsPrefs.cpp b/src/prefs/TracksBehaviorsPrefs.cpp index 6b6a41845..2552b3cd5 100644 --- a/src/prefs/TracksBehaviorsPrefs.cpp +++ b/src/prefs/TracksBehaviorsPrefs.cpp @@ -81,35 +81,35 @@ void TracksBehaviorsPrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(_("Behaviors")); { S.TieCheckBox(_("&Select all audio, if selection required"), - wxT("/GUI/SelectAllOnNone"), - false); + {wxT("/GUI/SelectAllOnNone"), + false}); /* i18n-hint: Cut-lines are lines that can expand to show the cut audio.*/ S.TieCheckBox(_("Enable cut &lines"), - wxT("/GUI/EnableCutLines"), - false); + {wxT("/GUI/EnableCutLines"), + false}); S.TieCheckBox(_("Enable &dragging selection edges"), - wxT("/GUI/AdjustSelectionEdges"), - true); + {wxT("/GUI/AdjustSelectionEdges"), + true}); S.TieCheckBox(_("Editing a clip can &move other clips"), - wxT("/GUI/EditClipCanMove"), - true); + {wxT("/GUI/EditClipCanMove"), + true}); S.TieCheckBox(_("\"Move track focus\" c&ycles repeatedly through tracks"), - wxT("/GUI/CircularTrackNavigation"), - false); + {wxT("/GUI/CircularTrackNavigation"), + false}); S.TieCheckBox(_("&Type to create a label"), - wxT("/GUI/TypeToCreateLabel"), - false); + {wxT("/GUI/TypeToCreateLabel"), + false}); S.TieCheckBox(_("Use dialog for the &name of a new label"), - wxT("/GUI/DialogForNameNewLabel"), - false); + {wxT("/GUI/DialogForNameNewLabel"), + false}); #ifdef EXPERIMENTAL_SCROLLING_LIMITS S.TieCheckBox(_("Enable scrolling left of &zero"), - ScrollingPreferenceKey(), - ScrollingPreferenceDefault()); + {ScrollingPreferenceKey(), + ScrollingPreferenceDefault()}); #endif S.TieCheckBox(_("Advanced &vertical zooming"), - wxT("/GUI/VerticalZooming"), - false); + {wxT("/GUI/VerticalZooming"), + false}); S.AddSpace(10); diff --git a/src/prefs/TracksPrefs.cpp b/src/prefs/TracksPrefs.cpp index 7897d4ac9..1fd2fd61b 100644 --- a/src/prefs/TracksPrefs.cpp +++ b/src/prefs/TracksPrefs.cpp @@ -268,24 +268,24 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(_("Display")); { S.TieCheckBox(_("Auto-&fit track height"), - wxT("/GUI/TracksFitVerticallyZoomed"), - false); + {wxT("/GUI/TracksFitVerticallyZoomed"), + false}); S.TieCheckBox(_("Sho&w audio track name as overlay"), - wxT("/GUI/ShowTrackNameInWaveform"), - false); + {wxT("/GUI/ShowTrackNameInWaveform"), + false}); #ifdef EXPERIMENTAL_HALF_WAVE S.TieCheckBox(_("Use &half-wave display when collapsed"), - wxT("/GUI/CollapseToHalfWave"), - false); + {wxT("/GUI/CollapseToHalfWave"), + false}); #endif #ifdef SHOW_PINNED_UNPINNED_IN_PREFS S.TieCheckBox(_("&Pinned Recording/Playback head"), - PinnedHeadPreferenceKey(), - PinnedHeadPreferenceDefault()); + {PinnedHeadPreferenceKey(), + PinnedHeadPreferenceDefault()}); #endif S.TieCheckBox(_("A&uto-scroll if head unpinned"), - wxT("/GUI/AutoScroll"), - true); + {wxT("/GUI/AutoScroll"), + true}); S.AddSpace(10); @@ -306,8 +306,8 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S) sampleDisplaySetting ); S.TieTextBox(_("Default audio track &name:"), - wxT("/GUI/TrackNames/DefaultTrackName"), - _("Audio Track"), + {wxT("/GUI/TrackNames/DefaultTrackName"), + _("Audio Track")}, 30); } S.EndMultiColumn(); diff --git a/src/prefs/WarningsPrefs.cpp b/src/prefs/WarningsPrefs.cpp index a0e8f9b50..cb5f0b25a 100644 --- a/src/prefs/WarningsPrefs.cpp +++ b/src/prefs/WarningsPrefs.cpp @@ -70,27 +70,27 @@ void WarningsPrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(_("Show Warnings/Prompts for")); { S.TieCheckBox(_("Saving &projects"), - wxT("/Warnings/FirstProjectSave"), - true); + {wxT("/Warnings/FirstProjectSave"), + true}); S.TieCheckBox(_("Saving &empty project"), - wxT("/GUI/EmptyCanBeDirty"), - true); + {wxT("/GUI/EmptyCanBeDirty"), + true}); S.TieCheckBox(_("&Low disk space at launch or new project"), - wxT("/Warnings/DiskSpaceWarning"), - true); + {wxT("/Warnings/DiskSpaceWarning"), + true}); S.TieCheckBox(_("Mixing down to &mono during export"), - wxT("/Warnings/MixMono"), - true); + {wxT("/Warnings/MixMono"), + true}); S.TieCheckBox(_("Mixing down to &stereo during export"), - wxT("/Warnings/MixStereo"), - true); + {wxT("/Warnings/MixStereo"), + true}); S.TieCheckBox(_("Mixing down on export (&Custom FFmpeg or external program)"), - wxT("/Warnings/MixUnknownChannels"), - true); + {wxT("/Warnings/MixUnknownChannels"), + true}); #ifdef EXPERIMENTAL_OD_DATA S.TieCheckBox(_("&Importing uncompressed audio files"), - wxT("/Warnings/CopyOrEditUncompressedDataAsk"), - true); + {wxT("/Warnings/CopyOrEditUncompressedDataAsk"), + true}); #endif } S.EndStatic();