mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 16:40:07 +02:00
Add GetInfo Preferences.
This commit is contained in:
parent
11fa48d66f
commit
ea4968e094
@ -94,6 +94,8 @@ for registering for changes.
|
|||||||
|
|
||||||
|
|
||||||
#include "Audacity.h"
|
#include "Audacity.h"
|
||||||
|
#include "Experimental.h"
|
||||||
|
#include "Shuttle.h"
|
||||||
#include "ShuttleGui.h"
|
#include "ShuttleGui.h"
|
||||||
|
|
||||||
#include "MemoryX.h"
|
#include "MemoryX.h"
|
||||||
@ -105,8 +107,6 @@ for registering for changes.
|
|||||||
#include <wx/spinctrl.h>
|
#include <wx/spinctrl.h>
|
||||||
#include <wx/bmpbuttn.h>
|
#include <wx/bmpbuttn.h>
|
||||||
#include "Internat.h"
|
#include "Internat.h"
|
||||||
#include "Experimental.h"
|
|
||||||
#include "Shuttle.h"
|
|
||||||
#include "WrappedType.h"
|
#include "WrappedType.h"
|
||||||
#include "widgets/wxPanelWrapper.h"
|
#include "widgets/wxPanelWrapper.h"
|
||||||
#include "AllThemeResources.h"
|
#include "AllThemeResources.h"
|
||||||
@ -142,9 +142,7 @@ void ShuttleGuiBase::Init()
|
|||||||
miSizerProp=0;
|
miSizerProp=0;
|
||||||
mSizerDepth=-1;
|
mSizerDepth=-1;
|
||||||
|
|
||||||
miIdSetByUser = -1;
|
ResetId();
|
||||||
miId = -1;
|
|
||||||
miIdNext = 3000;
|
|
||||||
|
|
||||||
miNoMatchSelector = 0;
|
miNoMatchSelector = 0;
|
||||||
|
|
||||||
@ -172,6 +170,13 @@ void ShuttleGuiBase::Init()
|
|||||||
mpSizer->SetMinSize(250,100);
|
mpSizer->SetMinSize(250,100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShuttleGuiBase::ResetId()
|
||||||
|
{
|
||||||
|
miIdSetByUser = -1;
|
||||||
|
miId = -1;
|
||||||
|
miIdNext = 3000;
|
||||||
|
}
|
||||||
|
|
||||||
void ShuttleGuiBase::EnableCtrl( bool bEnable )
|
void ShuttleGuiBase::EnableCtrl( bool bEnable )
|
||||||
{
|
{
|
||||||
if( mShuttleMode != eIsCreating )
|
if( mShuttleMode != eIsCreating )
|
||||||
@ -1038,6 +1043,8 @@ wxCheckBox * ShuttleGuiBase::TieCheckBox(const wxString &Prompt, WrappedType & W
|
|||||||
switch( mShuttleMode )
|
switch( mShuttleMode )
|
||||||
{
|
{
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxASSERT( pCheckBox );
|
wxASSERT( pCheckBox );
|
||||||
@ -1077,6 +1084,8 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight(const wxString &Prompt, WrappedT
|
|||||||
switch( mShuttleMode )
|
switch( mShuttleMode )
|
||||||
{
|
{
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxASSERT( pCheckBox );
|
wxASSERT( pCheckBox );
|
||||||
@ -1117,6 +1126,8 @@ wxSpinCtrl * ShuttleGuiBase::TieSpinCtrl( const wxString &Prompt, WrappedType &
|
|||||||
switch( mShuttleMode )
|
switch( mShuttleMode )
|
||||||
{
|
{
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxASSERT( pSpinCtrl );
|
wxASSERT( pSpinCtrl );
|
||||||
@ -1157,6 +1168,8 @@ wxTextCtrl * ShuttleGuiBase::TieTextBox( const wxString &Prompt, WrappedType & W
|
|||||||
switch( mShuttleMode )
|
switch( mShuttleMode )
|
||||||
{
|
{
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxASSERT( pTextBox );
|
wxASSERT( pTextBox );
|
||||||
@ -1197,6 +1210,8 @@ wxTextCtrl * ShuttleGuiBase::TieNumericTextBox( const wxString &Prompt, WrappedT
|
|||||||
switch( mShuttleMode )
|
switch( mShuttleMode )
|
||||||
{
|
{
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxASSERT( pTextBox );
|
wxASSERT( pTextBox );
|
||||||
@ -1236,6 +1251,8 @@ wxSlider * ShuttleGuiBase::TieSlider( const wxString &Prompt, WrappedType & Wrap
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
|
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
|
||||||
@ -1293,6 +1310,8 @@ wxChoice * ShuttleGuiBase::TieChoice(
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// IF setting internal storage from the controls.
|
// IF setting internal storage from the controls.
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
|
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
|
||||||
@ -1347,6 +1366,8 @@ wxRadioButton * ShuttleGuiBase::TieRadioButton(const wxString &Prompt, WrappedTy
|
|||||||
UpdateSizers();
|
UpdateSizers();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case eIsGettingMetadata:
|
||||||
|
break;
|
||||||
case eIsGettingFromDialog:
|
case eIsGettingFromDialog:
|
||||||
{
|
{
|
||||||
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
|
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
|
||||||
@ -1617,6 +1638,8 @@ bool ShuttleGuiBase::DoStep( int iStep )
|
|||||||
{
|
{
|
||||||
return (iStep==2) || (iStep==3);
|
return (iStep==2) || (iStep==3);
|
||||||
}
|
}
|
||||||
|
if( mShuttleMode == eIsGettingMetadata )
|
||||||
|
return iStep ==2;
|
||||||
wxASSERT( false );
|
wxASSERT( false );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -2295,3 +2318,172 @@ void ShuttleGui::SetSizeHints( int minX, int minY )
|
|||||||
{
|
{
|
||||||
ShuttleGuiBase::SetSizeHints( minX, minY );
|
ShuttleGuiBase::SetSizeHints( minX, minY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************* GetDefinition ******************************/
|
||||||
|
|
||||||
|
ShuttleGuiGetDefinition::ShuttleGuiGetDefinition(
|
||||||
|
wxWindow * pParent,CommandMessageTarget & target )
|
||||||
|
: CommandMessageTargetDecorator( target ),
|
||||||
|
ShuttleGui( pParent, eIsGettingMetadata )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
ShuttleGuiGetDefinition::~ShuttleGuiGetDefinition(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxCheckBox * ShuttleGuiGetDefinition::TieCheckBox(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const bool bDefault)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "bool", "type" );
|
||||||
|
AddBool( bDefault, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieCheckBox( Prompt, SettingName, bDefault );
|
||||||
|
}
|
||||||
|
wxCheckBox * ShuttleGuiGetDefinition::TieCheckBoxOnRight(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const bool bDefault)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "bool", "type" );
|
||||||
|
AddBool( bDefault, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieCheckBoxOnRight( Prompt, SettingName, bDefault );
|
||||||
|
}
|
||||||
|
wxChoice * ShuttleGuiGetDefinition::TieChoice(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const wxString &Default,
|
||||||
|
const wxArrayString &Choices,
|
||||||
|
const wxArrayString & TranslatedChoices )
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "enum", "type" );
|
||||||
|
AddItem( Default, "default" );
|
||||||
|
StartField( "enum" );
|
||||||
|
StartArray();
|
||||||
|
for( size_t i=0;i<Choices.Count(); i++ )
|
||||||
|
AddItem( Choices[i] );
|
||||||
|
EndArray();
|
||||||
|
EndField();
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieChoice( Prompt, SettingName, Default, Choices, TranslatedChoices );
|
||||||
|
}
|
||||||
|
wxChoice * ShuttleGuiGetDefinition::TieChoice(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const int Default,
|
||||||
|
const wxArrayString & Choices,
|
||||||
|
const std::vector<int> & TranslatedChoices)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "enum", "type" );
|
||||||
|
AddItem( Default, "default" );
|
||||||
|
StartField( "enum" );
|
||||||
|
StartArray();
|
||||||
|
for( size_t i=0;i<Choices.Count(); i++ )
|
||||||
|
AddItem( Choices[i] );
|
||||||
|
EndArray();
|
||||||
|
EndField();
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieChoice( Prompt, SettingName, Default, Choices, TranslatedChoices );
|
||||||
|
}
|
||||||
|
wxTextCtrl * ShuttleGuiGetDefinition::TieTextBox(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const wxString &Default,
|
||||||
|
const int nChars)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "string", "type" );
|
||||||
|
AddItem( Default, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieTextBox( Prompt, SettingName, Default, nChars );
|
||||||
|
}
|
||||||
|
wxTextCtrl * ShuttleGuiGetDefinition::TieTextBox(
|
||||||
|
const wxString & Prompt,
|
||||||
|
const wxString & SettingName,
|
||||||
|
const double & Default,
|
||||||
|
const int nChars)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "string", "type" );
|
||||||
|
AddItem( Default, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieTextBox( Prompt, SettingName, Default, nChars );
|
||||||
|
}
|
||||||
|
wxTextCtrl * ShuttleGuiGetDefinition::TieNumericTextBox(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const wxString &Default,
|
||||||
|
const int nChars)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "number", "type" );
|
||||||
|
AddItem( Default, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieNumericTextBox( Prompt, SettingName, Default, nChars );
|
||||||
|
}
|
||||||
|
wxTextCtrl * ShuttleGuiGetDefinition::TieNumericTextBox(
|
||||||
|
const wxString & Prompt,
|
||||||
|
const wxString & SettingName,
|
||||||
|
const double & Default,
|
||||||
|
const int nChars)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "number", "type" );
|
||||||
|
AddItem( Default, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieNumericTextBox( Prompt, SettingName, Default, nChars );
|
||||||
|
}
|
||||||
|
wxSlider * ShuttleGuiGetDefinition::TieSlider(
|
||||||
|
const wxString & Prompt,
|
||||||
|
const wxString & SettingName,
|
||||||
|
const int iDefault,
|
||||||
|
const int max,
|
||||||
|
const int min)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "number", "type" );
|
||||||
|
AddItem( iDefault, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieSlider( Prompt, SettingName, iDefault, max, min );
|
||||||
|
}
|
||||||
|
wxSpinCtrl * ShuttleGuiGetDefinition::TieSpinCtrl(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const int Value,
|
||||||
|
const int max,
|
||||||
|
const int min)
|
||||||
|
{
|
||||||
|
StartStruct();
|
||||||
|
AddItem( SettingName, "id" );
|
||||||
|
AddItem( Prompt, "prompt" );
|
||||||
|
AddItem( "number", "type" );
|
||||||
|
AddItem( Value, "default" );
|
||||||
|
EndStruct();
|
||||||
|
return ShuttleGui::TieSpinCtrl( Prompt, SettingName, Value, max, min );
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
#include "WrappedType.h"
|
#include "WrappedType.h"
|
||||||
|
|
||||||
|
// For ShuttleGuiGetDefinitions.
|
||||||
|
#include "commands/CommandTargets.h"
|
||||||
|
|
||||||
const int nMaxNestedSizers = 20;
|
const int nMaxNestedSizers = 20;
|
||||||
|
|
||||||
enum teShuttleMode
|
enum teShuttleMode
|
||||||
@ -33,6 +36,7 @@ enum teShuttleMode
|
|||||||
eIsSettingToDialog,
|
eIsSettingToDialog,
|
||||||
eIsSavingViaShuttle,
|
eIsSavingViaShuttle,
|
||||||
eIsGettingViaShuttle,
|
eIsGettingViaShuttle,
|
||||||
|
eIsGettingMetadata,
|
||||||
|
|
||||||
// Next two are only ever seen in constructor.
|
// Next two are only ever seen in constructor.
|
||||||
// After that they revert to one of the modes above.
|
// After that they revert to one of the modes above.
|
||||||
@ -76,6 +80,7 @@ public:
|
|||||||
ShuttleGuiBase(wxWindow * pParent,teShuttleMode ShuttleMode);
|
ShuttleGuiBase(wxWindow * pParent,teShuttleMode ShuttleMode);
|
||||||
~ShuttleGuiBase(void);
|
~ShuttleGuiBase(void);
|
||||||
void Init();
|
void Init();
|
||||||
|
void ResetId();
|
||||||
|
|
||||||
//-- Add functions. These only add a widget or 2.
|
//-- Add functions. These only add a widget or 2.
|
||||||
void AddPrompt(const wxString &Prompt);
|
void AddPrompt(const wxString &Prompt);
|
||||||
@ -193,53 +198,53 @@ public:
|
|||||||
// Note that unlike the other Tie functions, ALL the arguments are const.
|
// Note that unlike the other Tie functions, ALL the arguments are const.
|
||||||
// That's because the data is being exchanged between the dialog and mpShuttle
|
// That's because the data is being exchanged between the dialog and mpShuttle
|
||||||
// so it doesn't need an argument that is writeable.
|
// so it doesn't need an argument that is writeable.
|
||||||
wxCheckBox * TieCheckBox(
|
virtual wxCheckBox * TieCheckBox(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const bool bDefault);
|
const bool bDefault);
|
||||||
wxCheckBox * TieCheckBoxOnRight(
|
virtual wxCheckBox * TieCheckBoxOnRight(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const bool bDefault);
|
const bool bDefault);
|
||||||
wxChoice * TieChoice(
|
virtual wxChoice * TieChoice(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const wxString &Default,
|
const wxString &Default,
|
||||||
const wxArrayString &Choices,
|
const wxArrayString &Choices,
|
||||||
const wxArrayString & TranslatedChoices );
|
const wxArrayString & TranslatedChoices );
|
||||||
wxChoice * TieChoice(
|
virtual wxChoice * TieChoice(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const int Default,
|
const int Default,
|
||||||
const wxArrayString & Choices,
|
const wxArrayString & Choices,
|
||||||
const std::vector<int> & TranslatedChoices);
|
const std::vector<int> & TranslatedChoices);
|
||||||
wxTextCtrl * TieTextBox(
|
virtual wxTextCtrl * TieTextBox(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const wxString &Default,
|
const wxString &Default,
|
||||||
const int nChars);
|
const int nChars);
|
||||||
wxTextCtrl * TieTextBox(
|
virtual wxTextCtrl * TieTextBox(
|
||||||
const wxString & Prompt,
|
const wxString & Prompt,
|
||||||
const wxString & SettingName,
|
const wxString & SettingName,
|
||||||
const double & Default,
|
const double & Default,
|
||||||
const int nChars);
|
const int nChars);
|
||||||
wxTextCtrl * TieNumericTextBox(
|
virtual wxTextCtrl * TieNumericTextBox(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const wxString &Default,
|
const wxString &Default,
|
||||||
const int nChars);
|
const int nChars);
|
||||||
wxTextCtrl * TieNumericTextBox(
|
virtual wxTextCtrl * TieNumericTextBox(
|
||||||
const wxString & Prompt,
|
const wxString & Prompt,
|
||||||
const wxString & SettingName,
|
const wxString & SettingName,
|
||||||
const double & Default,
|
const double & Default,
|
||||||
const int nChars);
|
const int nChars);
|
||||||
wxSlider * TieSlider(
|
virtual wxSlider * TieSlider(
|
||||||
const wxString & Prompt,
|
const wxString & Prompt,
|
||||||
const wxString & SettingName,
|
const wxString & SettingName,
|
||||||
const int iDefault,
|
const int iDefault,
|
||||||
const int max,
|
const int max,
|
||||||
const int min = 0);
|
const int min = 0);
|
||||||
wxSpinCtrl * TieSpinCtrl(
|
virtual wxSpinCtrl * TieSpinCtrl(
|
||||||
const wxString &Prompt,
|
const wxString &Prompt,
|
||||||
const wxString &SettingName,
|
const wxString &SettingName,
|
||||||
const int Value,
|
const int Value,
|
||||||
@ -387,4 +392,72 @@ public:
|
|||||||
|
|
||||||
teShuttleMode GetMode() { return mShuttleMode; };
|
teShuttleMode GetMode() { return mShuttleMode; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************//**
|
||||||
|
\brief Shuttle that retrieves a JSON format definition of a command's parameters.
|
||||||
|
********************************************************************************/
|
||||||
|
class ShuttleGuiGetDefinition : public ShuttleGui, public CommandMessageTargetDecorator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ShuttleGuiGetDefinition(wxWindow * pParent,CommandMessageTarget & target );
|
||||||
|
~ShuttleGuiGetDefinition(void);
|
||||||
|
|
||||||
|
wxCheckBox * TieCheckBox(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const bool bDefault) override;
|
||||||
|
wxCheckBox * TieCheckBoxOnRight(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const bool bDefault) override;
|
||||||
|
wxChoice * TieChoice(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const wxString &Default,
|
||||||
|
const wxArrayString &Choices,
|
||||||
|
const wxArrayString & TranslatedChoices ) override;
|
||||||
|
wxChoice * TieChoice(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const int Default,
|
||||||
|
const wxArrayString & Choices,
|
||||||
|
const std::vector<int> & TranslatedChoices) override;
|
||||||
|
wxTextCtrl * TieTextBox(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const wxString &Default,
|
||||||
|
const int nChars) override;
|
||||||
|
wxTextCtrl * TieTextBox(
|
||||||
|
const wxString & Prompt,
|
||||||
|
const wxString & SettingName,
|
||||||
|
const double & Default,
|
||||||
|
const int nChars) override;
|
||||||
|
wxTextCtrl * TieNumericTextBox(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const wxString &Default,
|
||||||
|
const int nChars) override;
|
||||||
|
wxTextCtrl * TieNumericTextBox(
|
||||||
|
const wxString & Prompt,
|
||||||
|
const wxString & SettingName,
|
||||||
|
const double & Default,
|
||||||
|
const int nChars) override;
|
||||||
|
wxSlider * TieSlider(
|
||||||
|
const wxString & Prompt,
|
||||||
|
const wxString & SettingName,
|
||||||
|
const int iDefault,
|
||||||
|
const int max,
|
||||||
|
const int min = 0) override;
|
||||||
|
wxSpinCtrl * TieSpinCtrl(
|
||||||
|
const wxString &Prompt,
|
||||||
|
const wxString &SettingName,
|
||||||
|
const int Value,
|
||||||
|
const int max,
|
||||||
|
const int min) override;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -63,7 +63,7 @@ void CommandMessageTarget::AddItem(const wxString &value, const wxString &name){
|
|||||||
mCounts.Last() += 1;
|
mCounts.Last() += 1;
|
||||||
}
|
}
|
||||||
void CommandMessageTarget::AddBool(const bool value, const wxString &name){
|
void CommandMessageTarget::AddBool(const bool value, const wxString &name){
|
||||||
Update( wxString::Format( "%s%s%s%s", (mCounts.Last()>0)?", ":"", name, !name.IsEmpty()?":":"",value?"True":"False"));
|
Update( wxString::Format( "%s%s%s\"%s\"", (mCounts.Last()>0)?", ":"", name, !name.IsEmpty()?":":"",value?"true":"false"));
|
||||||
mCounts.Last() += 1;
|
mCounts.Last() += 1;
|
||||||
}
|
}
|
||||||
void CommandMessageTarget::AddItem(const double value, const wxString &name){
|
void CommandMessageTarget::AddItem(const double value, const wxString &name){
|
||||||
|
@ -39,10 +39,14 @@ This class now lists
|
|||||||
#include "../ShuttleGui.h"
|
#include "../ShuttleGui.h"
|
||||||
#include "CommandContext.h"
|
#include "CommandContext.h"
|
||||||
|
|
||||||
|
#include "../prefs/PrefsDialog.h"
|
||||||
|
#include "../ShuttleGui.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kCommands,
|
kCommands,
|
||||||
kCommandsPlus,
|
kCommandsPlus,
|
||||||
kMenus,
|
kMenus,
|
||||||
|
kPreferences,
|
||||||
kTracks,
|
kTracks,
|
||||||
kClips,
|
kClips,
|
||||||
kEnvelopes,
|
kEnvelopes,
|
||||||
@ -56,6 +60,7 @@ static const wxString kTypes[nTypes] =
|
|||||||
XO("Commands"),
|
XO("Commands"),
|
||||||
XO("Commands+"),
|
XO("Commands+"),
|
||||||
XO("Menus"),
|
XO("Menus"),
|
||||||
|
XO("Preferences"),
|
||||||
XO("Tracks"),
|
XO("Tracks"),
|
||||||
XO("Clips"),
|
XO("Clips"),
|
||||||
XO("Envelopes"),
|
XO("Envelopes"),
|
||||||
@ -133,6 +138,7 @@ bool GetInfoCommand::ApplyInner(const CommandContext &context)
|
|||||||
case kCommands : return SendCommands( context, 0 );
|
case kCommands : return SendCommands( context, 0 );
|
||||||
case kCommandsPlus : return SendCommands( context, 1 );
|
case kCommandsPlus : return SendCommands( context, 1 );
|
||||||
case kMenus : return SendMenus( context );
|
case kMenus : return SendMenus( context );
|
||||||
|
case kPreferences : return SendPreferences( context );
|
||||||
case kTracks : return SendTracks( context );
|
case kTracks : return SendTracks( context );
|
||||||
case kClips : return SendClips( context );
|
case kClips : return SendClips( context );
|
||||||
case kEnvelopes : return SendEnvelopes( context );
|
case kEnvelopes : return SendEnvelopes( context );
|
||||||
@ -171,6 +177,19 @@ bool GetInfoCommand::SendMenus(const CommandContext &context)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GetInfoCommand::SendPreferences(const CommandContext &context)
|
||||||
|
{
|
||||||
|
context.StartArray();
|
||||||
|
GlobalPrefsDialog dialog( context.GetProject() );
|
||||||
|
// wxCommandEvent Evt;
|
||||||
|
//dialog.Show();
|
||||||
|
wxWindow * pWin = context.GetProject();
|
||||||
|
ShuttleGuiGetDefinition S(pWin, *((context.pOutput)->mStatusTarget) );
|
||||||
|
dialog.ShuttleAll( S );
|
||||||
|
context.EndArray();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Send the list of commands.
|
Send the list of commands.
|
||||||
*/
|
*/
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool SendCommands(const CommandContext & context, int flags);
|
bool SendCommands(const CommandContext & context, int flags);
|
||||||
bool SendMenus(const CommandContext & context);
|
bool SendMenus(const CommandContext & context);
|
||||||
|
bool SendPreferences(const CommandContext & context);
|
||||||
bool SendTracks(const CommandContext & context);
|
bool SendTracks(const CommandContext & context);
|
||||||
bool SendLabels(const CommandContext & context);
|
bool SendLabels(const CommandContext & context);
|
||||||
bool SendClips(const CommandContext & context);
|
bool SendClips(const CommandContext & context);
|
||||||
|
@ -26,10 +26,10 @@ public:
|
|||||||
BatchPrefs(wxWindow * parent, wxWindowID winid);
|
BatchPrefs(wxWindow * parent, wxWindowID winid);
|
||||||
~BatchPrefs();
|
~BatchPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@ -178,14 +178,14 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
DEFAULT_LATENCY_DURATION,
|
DEFAULT_LATENCY_DURATION,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("milliseconds"));
|
S.AddUnits(_("milliseconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
|
||||||
|
|
||||||
w = S.TieNumericTextBox(_("Track &shift after record:"),
|
w = S.TieNumericTextBox(_("Track &shift after record:"),
|
||||||
wxT("/AudioIO/LatencyCorrection"),
|
wxT("/AudioIO/LatencyCorrection"),
|
||||||
DEFAULT_LATENCY_CORRECTION,
|
DEFAULT_LATENCY_CORRECTION,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("milliseconds"));
|
S.AddUnits(_("milliseconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds"));
|
||||||
}
|
}
|
||||||
S.EndThreeColumn();
|
S.EndThreeColumn();
|
||||||
}
|
}
|
||||||
|
@ -29,10 +29,10 @@ class DevicePrefs final : public PrefsPanel
|
|||||||
virtual ~DevicePrefs();
|
virtual ~DevicePrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void GetNamesAndLabels();
|
void GetNamesAndLabels();
|
||||||
|
|
||||||
void OnHost(wxCommandEvent & e);
|
void OnHost(wxCommandEvent & e);
|
||||||
|
@ -26,10 +26,10 @@ class DirectoriesPrefs final : public PrefsPanel
|
|||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
bool Validate() override;
|
bool Validate() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void UpdateFreeSpace(wxCommandEvent & e);
|
void UpdateFreeSpace(wxCommandEvent & e);
|
||||||
void OnChooseTempDir(wxCommandEvent & e);
|
void OnChooseTempDir(wxCommandEvent & e);
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
wxT("name"),
|
wxT("name"),
|
||||||
visualgroups,
|
visualgroups,
|
||||||
prefsgroups);
|
prefsgroups);
|
||||||
c->SetMinSize(c->GetBestSize());
|
if( c ) c->SetMinSize(c->GetBestSize());
|
||||||
|
|
||||||
S.TieNumericTextBox(_("&Maximum effects per group (0 to disable):"),
|
S.TieNumericTextBox(_("&Maximum effects per group (0 to disable):"),
|
||||||
wxT("/Effects/MaxPerGroup"),
|
wxT("/Effects/MaxPerGroup"),
|
||||||
|
@ -29,10 +29,10 @@ class EffectsPrefs final : public PrefsPanel
|
|||||||
~EffectsPrefs();
|
~EffectsPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class EffectsPrefsFactory final : public PrefsPanelFactory
|
class EffectsPrefsFactory final : public PrefsPanelFactory
|
||||||
|
@ -50,6 +50,7 @@ class ExtImportPrefs final : public PrefsPanel
|
|||||||
~ExtImportPrefs();
|
~ExtImportPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
void OnPluginKeyDown(wxListEvent& event);
|
void OnPluginKeyDown(wxListEvent& event);
|
||||||
void OnPluginBeginDrag(wxListEvent& event);
|
void OnPluginBeginDrag(wxListEvent& event);
|
||||||
@ -103,7 +104,6 @@ class ExtImportPrefs final : public PrefsPanel
|
|||||||
void DoOnRuleTableSelect (int toprow);
|
void DoOnRuleTableSelect (int toprow);
|
||||||
void AddItemToTable (int index, const ExtImportItem *item);
|
void AddItemToTable (int index, const ExtImportItem *item);
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,12 +29,12 @@ class GUIPrefs final : public PrefsPanel
|
|||||||
~GUIPrefs();
|
~GUIPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
static void GetRangeChoices(wxArrayString *pChoices, wxArrayString *pCodes);
|
static void GetRangeChoices(wxArrayString *pChoices, wxArrayString *pCodes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
|
|
||||||
wxArrayString mLangCodes;
|
wxArrayString mLangCodes;
|
||||||
wxArrayString mLangNames;
|
wxArrayString mLangNames;
|
||||||
|
@ -28,10 +28,10 @@ class ImportExportPrefs final : public PrefsPanel
|
|||||||
~ImportExportPrefs();
|
~ImportExportPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ImportExportPrefsFactory final : public PrefsPanelFactory
|
class ImportExportPrefsFactory final : public PrefsPanelFactory
|
||||||
|
@ -154,11 +154,11 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree"));
|
S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree"));
|
||||||
{
|
{
|
||||||
mViewByTree = S.Id(ViewByTreeID).TieRadioButton(_("&Tree"), 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 = 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 = S.Id(ViewByKeyID).TieRadioButton(_("&Key"), wxT("key"));
|
||||||
mViewByKey->SetName(_("View by key"));
|
if( mViewByKey ) mViewByKey->SetName(_("View by key"));
|
||||||
}
|
}
|
||||||
S.EndRadioButtonGroup();
|
S.EndRadioButtonGroup();
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,10 @@ public:
|
|||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
void Cancel() override;
|
void Cancel() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void RefreshBindings(bool bSort);
|
void RefreshBindings(bool bSort);
|
||||||
void FilterKeys( std::vector<NormalizedKeyString> & arr );
|
void FilterKeys( std::vector<NormalizedKeyString> & arr );
|
||||||
wxString NameFromKey(const NormalizedKeyString & key);
|
wxString NameFromKey(const NormalizedKeyString & key);
|
||||||
|
@ -158,7 +158,7 @@ void LibraryPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
wxT("/Library/FFmpegOnDemand"),
|
wxT("/Library/FFmpegOnDemand"),
|
||||||
false);
|
false);
|
||||||
#if !defined(USE_FFMPEG)
|
#if !defined(USE_FFMPEG)
|
||||||
checkbox->Enable(FALSE);
|
if( checkbox ) checkbox->Enable(FALSE);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -29,10 +29,10 @@ class LibraryPrefs final : public PrefsPanel
|
|||||||
~LibraryPrefs();
|
~LibraryPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void SetMP3VersionText(bool prompt = false);
|
void SetMP3VersionText(bool prompt = false);
|
||||||
void SetFFmpegVersionText();
|
void SetFFmpegVersionText();
|
||||||
|
|
||||||
|
@ -34,10 +34,10 @@ class MidiIOPrefs final : public PrefsPanel
|
|||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
bool Validate() override;
|
bool Validate() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void GetNamesAndLabels();
|
void GetNamesAndLabels();
|
||||||
|
|
||||||
void OnHost(wxCommandEvent & e);
|
void OnHost(wxCommandEvent & e);
|
||||||
|
@ -38,6 +38,7 @@ class ModulePrefs final : public PrefsPanel
|
|||||||
~ModulePrefs();
|
~ModulePrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
static int GetModuleStatus( const wxString &fname );
|
static int GetModuleStatus( const wxString &fname );
|
||||||
static void SetModuleStatus( const wxString &fname, int iStatus );
|
static void SetModuleStatus( const wxString &fname, int iStatus );
|
||||||
@ -45,7 +46,6 @@ class ModulePrefs final : public PrefsPanel
|
|||||||
private:
|
private:
|
||||||
void GetAllModuleStatuses();
|
void GetAllModuleStatuses();
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
wxArrayString mModules;
|
wxArrayString mModules;
|
||||||
std::vector<int> mStatuses;
|
std::vector<int> mStatuses;
|
||||||
wxArrayString mPaths;
|
wxArrayString mPaths;
|
||||||
|
@ -26,10 +26,10 @@ class MousePrefs final : public PrefsPanel
|
|||||||
~MousePrefs();
|
~MousePrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void CreateList();
|
void CreateList();
|
||||||
void AddItem(wxString const & buttons,
|
void AddItem(wxString const & buttons,
|
||||||
wxString const & tool,
|
wxString const & tool,
|
||||||
|
@ -65,7 +65,7 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
6.0,
|
6.0,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("seconds"));
|
S.AddUnits(_("seconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
||||||
}
|
}
|
||||||
S.EndThreeColumn();
|
S.EndThreeColumn();
|
||||||
}
|
}
|
||||||
@ -81,14 +81,14 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
2.0,
|
2.0,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("seconds"));
|
S.AddUnits(_("seconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
||||||
|
|
||||||
w = S.TieNumericTextBox(_("&After cut region:"),
|
w = S.TieNumericTextBox(_("&After cut region:"),
|
||||||
wxT("/AudioIO/CutPreviewAfterLen"),
|
wxT("/AudioIO/CutPreviewAfterLen"),
|
||||||
1.0,
|
1.0,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("seconds"));
|
S.AddUnits(_("seconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
||||||
}
|
}
|
||||||
S.EndThreeColumn();
|
S.EndThreeColumn();
|
||||||
}
|
}
|
||||||
@ -103,14 +103,14 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
1.0,
|
1.0,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("seconds"));
|
S.AddUnits(_("seconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
||||||
|
|
||||||
w = S.TieNumericTextBox(_("Lo&ng period:"),
|
w = S.TieNumericTextBox(_("Lo&ng period:"),
|
||||||
wxT("/AudioIO/SeekLongPeriod"),
|
wxT("/AudioIO/SeekLongPeriod"),
|
||||||
15.0,
|
15.0,
|
||||||
9);
|
9);
|
||||||
S.AddUnits(_("seconds"));
|
S.AddUnits(_("seconds"));
|
||||||
w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
|
||||||
}
|
}
|
||||||
S.EndThreeColumn();
|
S.EndThreeColumn();
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,10 @@ class PlaybackPrefs final : public PrefsPanel
|
|||||||
virtual ~PlaybackPrefs();
|
virtual ~PlaybackPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlaybackPrefsFactory final : public PrefsPanelFactory
|
class PlaybackPrefsFactory final : public PrefsPanelFactory
|
||||||
|
@ -428,6 +428,23 @@ void PrefsDialog::OnHelp(wxCommandEvent & WXUNUSED(event))
|
|||||||
HelpSystem::ShowHelp(this, page, true);
|
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)
|
void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
|
||||||
{
|
{
|
||||||
if(event.GetKeyCode() == WXK_RETURN)
|
if(event.GetKeyCode() == WXK_RETURN)
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
class PrefsPanel;
|
class PrefsPanel;
|
||||||
class PrefsPanelFactory;
|
class PrefsPanelFactory;
|
||||||
|
class ShuttleGui;
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define CONST
|
#define CONST
|
||||||
@ -56,6 +57,7 @@ class PrefsDialog /* not final */ : public wxDialogWrapper
|
|||||||
|
|
||||||
// Defined this so a protected virtual can be invoked after the constructor
|
// Defined this so a protected virtual can be invoked after the constructor
|
||||||
int ShowModal() override;
|
int ShowModal() override;
|
||||||
|
void ShuttleAll( ShuttleGui & S);
|
||||||
|
|
||||||
void OnCategoryChange(wxCommandEvent & e);
|
void OnCategoryChange(wxCommandEvent & e);
|
||||||
void OnOK(wxCommandEvent & e);
|
void OnOK(wxCommandEvent & e);
|
||||||
|
@ -40,6 +40,8 @@ ThemePrefs.
|
|||||||
#define TOP_LEVEL_BORDER 5
|
#define TOP_LEVEL_BORDER 5
|
||||||
#define GENERIC_CONTROL_BORDER 5
|
#define GENERIC_CONTROL_BORDER 5
|
||||||
|
|
||||||
|
class ShuttleGui;
|
||||||
|
|
||||||
class PrefsPanel /* not final */ : public wxPanelWrapper
|
class PrefsPanel /* not final */ : public wxPanelWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -59,6 +61,7 @@ class PrefsPanel /* not final */ : public wxPanelWrapper
|
|||||||
// If it returns True, the Preview button is added below the panel
|
// If it returns True, the Preview button is added below the panel
|
||||||
// Default returns false
|
// Default returns false
|
||||||
virtual bool ShowsPreviewButton();
|
virtual bool ShowsPreviewButton();
|
||||||
|
virtual void PopulateOrExchange( ShuttleGui & WXUNUSED(S) ){};
|
||||||
|
|
||||||
// If not empty string, the Help button is added below the panel
|
// If not empty string, the Help button is added below the panel
|
||||||
// Default returns empty string.
|
// Default returns empty string.
|
||||||
|
@ -28,10 +28,10 @@ class ProjectsPrefs final : public PrefsPanel
|
|||||||
~ProjectsPrefs();
|
~ProjectsPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProjectsPrefsFactory final : public PrefsPanelFactory
|
class ProjectsPrefsFactory final : public PrefsPanelFactory
|
||||||
|
@ -31,10 +31,10 @@ class QualityPrefs final : public PrefsPanel
|
|||||||
|
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void GetNamesAndLabels();
|
void GetNamesAndLabels();
|
||||||
void OnSampleRateChoice(wxCommandEvent & e);
|
void OnSampleRateChoice(wxCommandEvent & e);
|
||||||
|
|
||||||
|
@ -138,9 +138,11 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
wxT("/GUI/TrackNames/RecodingTrackName"),
|
wxT("/GUI/TrackNames/RecodingTrackName"),
|
||||||
_("Recorded_Audio"),
|
_("Recorded_Audio"),
|
||||||
30);
|
30);
|
||||||
|
if( mToggleCustomName ) {
|
||||||
mToggleCustomName->SetName(_("Custom name text"));
|
mToggleCustomName->SetName(_("Custom name text"));
|
||||||
mToggleCustomName->Enable(mUseCustomTrackName);
|
mToggleCustomName->Enable(mUseCustomTrackName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
|
|
||||||
S.AddFixedText( {} );
|
S.AddFixedText( {} );
|
||||||
|
@ -28,10 +28,10 @@ class RecordingPrefs final : public PrefsPanel
|
|||||||
virtual ~RecordingPrefs();
|
virtual ~RecordingPrefs();
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
void OnToggleCustomName(wxCommandEvent & /* Evt */);
|
void OnToggleCustomName(wxCommandEvent & /* Evt */);
|
||||||
|
|
||||||
wxTextCtrl *mToggleCustomName;
|
wxTextCtrl *mToggleCustomName;
|
||||||
|
@ -300,6 +300,8 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
|
|||||||
|
|
||||||
} S.EndScroller();
|
} S.EndScroller();
|
||||||
|
|
||||||
|
// Enabling and disabling belongs outside this function.
|
||||||
|
if( S.GetMode() != eIsGettingMetadata )
|
||||||
EnableDisableSTFTOnlyControls();
|
EnableDisableSTFTOnlyControls();
|
||||||
|
|
||||||
mPopulating = false;
|
mPopulating = false;
|
||||||
|
@ -46,6 +46,7 @@ class SpectrumPrefs final : public PrefsPanel
|
|||||||
virtual ~SpectrumPrefs();
|
virtual ~SpectrumPrefs();
|
||||||
void Preview() override;
|
void Preview() override;
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
void Rollback();
|
void Rollback();
|
||||||
bool ShowsPreviewButton() override;
|
bool ShowsPreviewButton() override;
|
||||||
bool Validate() override;
|
bool Validate() override;
|
||||||
@ -54,7 +55,6 @@ class SpectrumPrefs final : public PrefsPanel
|
|||||||
private:
|
private:
|
||||||
void Populate(size_t windowSize);
|
void Populate(size_t windowSize);
|
||||||
void PopulatePaddingChoices(size_t windowSize);
|
void PopulatePaddingChoices(size_t windowSize);
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
|
|
||||||
void OnControl(wxCommandEvent &event);
|
void OnControl(wxCommandEvent &event);
|
||||||
void OnWindowSize(wxCommandEvent &event);
|
void OnWindowSize(wxCommandEvent &event);
|
||||||
|
@ -30,7 +30,7 @@ class ThemePrefs final : public PrefsPanel
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
void OnLoadThemeComponents(wxCommandEvent & e);
|
void OnLoadThemeComponents(wxCommandEvent & e);
|
||||||
void OnSaveThemeComponents(wxCommandEvent & e);
|
void OnSaveThemeComponents(wxCommandEvent & e);
|
||||||
void OnLoadThemeCache(wxCommandEvent & e);
|
void OnLoadThemeCache(wxCommandEvent & e);
|
||||||
|
@ -31,7 +31,7 @@ class TracksBehaviorsPrefs final : public PrefsPanel
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
wxArrayString mSoloCodes;
|
wxArrayString mSoloCodes;
|
||||||
wxArrayString mSoloChoices;
|
wxArrayString mSoloChoices;
|
||||||
|
@ -38,7 +38,7 @@ class TracksPrefs final : public PrefsPanel
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
static int iPreferencePinned;
|
static int iPreferencePinned;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class WarningsPrefs final : public PrefsPanel
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WarningsPrefsFactory final : public PrefsPanelFactory
|
class WarningsPrefsFactory final : public PrefsPanelFactory
|
||||||
|
@ -28,10 +28,10 @@ public:
|
|||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
bool ShowsPreviewButton() override;
|
bool ShowsPreviewButton() override;
|
||||||
bool Validate() override;
|
bool Validate() override;
|
||||||
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
void PopulateOrExchange(ShuttleGui & S);
|
|
||||||
|
|
||||||
void OnControl(wxCommandEvent&);
|
void OnControl(wxCommandEvent&);
|
||||||
void OnScale(wxCommandEvent&);
|
void OnScale(wxCommandEvent&);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user