diff --git a/src/commands/CompareAudioCommand.cpp b/src/commands/CompareAudioCommand.cpp index a7845578b..476772be7 100644 --- a/src/commands/CompareAudioCommand.cpp +++ b/src/commands/CompareAudioCommand.cpp @@ -34,6 +34,9 @@ threshold of difference in two selected tracks #include "../widgets/valnum.h" #include "CommandContext.h" +const ComponentInterfaceSymbol CompareAudioCommand::Symbol +{ XO("Compare Audio") }; + extern void RegisterCompareAudio( Registrar & R){ R.AddCommand( std::make_unique() ); // std::unique_ptr &&target @@ -157,3 +160,4 @@ bool CompareAudioCommand::Apply(const CommandContext & context) context.Status(wxString::Format(wxT("Finished comparison: %li samples (%.3f seconds) exceeded the error threshold of %f."), errorCount, errorSeconds, errorThreshold)); return true; } + diff --git a/src/commands/CompareAudioCommand.h b/src/commands/CompareAudioCommand.h index d4e3473e9..87f61cd75 100644 --- a/src/commands/CompareAudioCommand.h +++ b/src/commands/CompareAudioCommand.h @@ -23,14 +23,14 @@ classes class WaveTrack; -#define COMPARE_AUDIO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Compare Audio") } - class CompareAudioCommand final : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return XO("Compare Audio");} - TranslatableString GetDescription() override {return XO("Compares a range on two tracks.");}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;} + TranslatableString GetDescription() override {return XO("Compares a range on two tracks.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/Demo.cpp b/src/commands/Demo.cpp index be4d1676a..db13e7192 100644 --- a/src/commands/Demo.cpp +++ b/src/commands/Demo.cpp @@ -32,6 +32,9 @@ parameters. It is for development purposes. #include "../widgets/valnum.h" #include "../commands/CommandContext.h" +const ComponentInterfaceSymbol DemoCommand::Symbol +{ XO("Demo") }; + bool DemoCommand::DefineParams( ShuttleParams & S ){ S.Define( delay, wxT("Delay"), 1.0f, 0.001f, FLT_MAX, 1.0f ); S.Define( decay, wxT("Decay"), 0.5f, 0.0f, FLT_MAX, 1.0f ); diff --git a/src/commands/Demo.h b/src/commands/Demo.h index 582d39945..cb717bc95 100644 --- a/src/commands/Demo.h +++ b/src/commands/Demo.h @@ -16,13 +16,13 @@ class ShuttleGui; -#define DEMO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Demo") } - class DemoCommand final : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return DEMO_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Does the demo action.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/DragCommand.cpp b/src/commands/DragCommand.cpp index 3b00f1ebf..f2b8567b7 100644 --- a/src/commands/DragCommand.cpp +++ b/src/commands/DragCommand.cpp @@ -27,6 +27,9 @@ #include +const ComponentInterfaceSymbol DragCommand::Symbol +{ XO("Drag") }; + DragCommand::DragCommand() { } diff --git a/src/commands/DragCommand.h b/src/commands/DragCommand.h index 779553a44..bdbc6b95d 100644 --- a/src/commands/DragCommand.h +++ b/src/commands/DragCommand.h @@ -19,14 +19,14 @@ #include "Command.h" #include "CommandType.h" -#define DRAG_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Drag") } - class DragCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + DragCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return DRAG_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Drags mouse from one place to another.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/GetInfoCommand.cpp b/src/commands/GetInfoCommand.cpp index 2abd09477..bfe94d024 100644 --- a/src/commands/GetInfoCommand.cpp +++ b/src/commands/GetInfoCommand.cpp @@ -50,6 +50,9 @@ This class now lists #include #include +const ComponentInterfaceSymbol GetInfoCommand::Symbol +{ XO("Get Info") }; + enum { kCommands, //kCommandsPlus, diff --git a/src/commands/GetInfoCommand.h b/src/commands/GetInfoCommand.h index 7035e540b..2c2392500 100644 --- a/src/commands/GetInfoCommand.h +++ b/src/commands/GetInfoCommand.h @@ -26,13 +26,13 @@ channel. class wxMenuBar; class wxPoint; -#define GET_INFO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Get Info") } - class GetInfoCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return GET_INFO_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Gets information in JSON format.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/GetTrackInfoCommand.cpp b/src/commands/GetTrackInfoCommand.cpp index 15696d408..d3ef4aad9 100644 --- a/src/commands/GetTrackInfoCommand.cpp +++ b/src/commands/GetTrackInfoCommand.cpp @@ -25,6 +25,9 @@ #include "../ShuttleGui.h" #include "CommandContext.h" +const ComponentInterfaceSymbol GetTrackInfoCommand::Symbol +{ XO("Get Track Info") }; + const int nTypes =3; static const EnumValueSymbol kTypes[nTypes] = { diff --git a/src/commands/GetTrackInfoCommand.h b/src/commands/GetTrackInfoCommand.h index bd383ce72..190899e55 100644 --- a/src/commands/GetTrackInfoCommand.h +++ b/src/commands/GetTrackInfoCommand.h @@ -19,14 +19,14 @@ #include "Command.h" #include "CommandType.h" -#define GET_TRACK_INFO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Get Track Info") } - class GetTrackInfoCommand final : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + GetTrackInfoCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return GET_TRACK_INFO_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Gets track values as JSON.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/HelpCommand.cpp b/src/commands/HelpCommand.cpp index 60d869265..5ff842dbe 100644 --- a/src/commands/HelpCommand.cpp +++ b/src/commands/HelpCommand.cpp @@ -22,6 +22,9 @@ #include "CommandContext.h" #include "../effects/EffectManager.h" +const ComponentInterfaceSymbol HelpCommand::Symbol +{ XO("Help") }; + bool HelpCommand::DefineParams( ShuttleParams & S ){ S.Define( mCommandName, wxT("Command"), "Help" ); return true; diff --git a/src/commands/HelpCommand.h b/src/commands/HelpCommand.h index 06881ed0b..376c20121 100644 --- a/src/commands/HelpCommand.h +++ b/src/commands/HelpCommand.h @@ -23,13 +23,13 @@ #include "CommandType.h" #include "Command.h" -#define HELP_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Help") } - class HelpCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return HELP_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Gives help on a command.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/ImportExportCommands.cpp b/src/commands/ImportExportCommands.cpp index a8fdcdef1..4db9b2669 100644 --- a/src/commands/ImportExportCommands.cpp +++ b/src/commands/ImportExportCommands.cpp @@ -24,6 +24,9 @@ #include "../ShuttleGui.h" #include "CommandContext.h" +const ComponentInterfaceSymbol ImportCommand::Symbol +{ XO("Import2") }; + bool ImportCommand::DefineParams( ShuttleParams & S ){ S.Define( mFileName, wxT("Filename"), "" ); return true; @@ -52,6 +55,9 @@ bool ExportCommand::DefineParams( ShuttleParams & S ){ return true; } +const ComponentInterfaceSymbol ExportCommand::Symbol +{ XO("Export2") }; + void ExportCommand::PopulateOrExchange(ShuttleGui & S) { S.AddSpace(0, 5); diff --git a/src/commands/ImportExportCommands.h b/src/commands/ImportExportCommands.h index 974866e8f..24adc7459 100644 --- a/src/commands/ImportExportCommands.h +++ b/src/commands/ImportExportCommands.h @@ -23,13 +23,13 @@ // Import -#define IMPORT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Import2") } - class ImportCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return IMPORT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Imports from a file.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -41,13 +41,13 @@ public: wxString mFileName; }; -#define EXPORT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Export2") } - class ExportCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return EXPORT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Exports to a file.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/LoadCommands.cpp b/src/commands/LoadCommands.cpp index 4edcfbdda..ed6ec3f2a 100644 --- a/src/commands/LoadCommands.cpp +++ b/src/commands/LoadCommands.cpp @@ -96,7 +96,7 @@ enum // Redefine COMMAND() to add the COMMAND's name to an array // #undef COMMAND -#define COMMAND(n, i, args) results.push_back( (n ## _PLUGIN_SYMBOL).Internal() ); +#define COMMAND(n, i, args) results.push_back( (i :: Symbol).Internal() ); // // Create the COMMAND name array diff --git a/src/commands/MessageCommand.cpp b/src/commands/MessageCommand.cpp index 283dc8541..3629c995d 100644 --- a/src/commands/MessageCommand.cpp +++ b/src/commands/MessageCommand.cpp @@ -20,6 +20,9 @@ #include "../Shuttle.h" #include "../ShuttleGui.h" +const ComponentInterfaceSymbol MessageCommand::Symbol +{ XO("Message") }; + bool MessageCommand::DefineParams( ShuttleParams & S ){ S.Define( mMessage, wxT("Text"), "Some message" ); return true; diff --git a/src/commands/MessageCommand.h b/src/commands/MessageCommand.h index 967ec3e24..4ac152d29 100644 --- a/src/commands/MessageCommand.h +++ b/src/commands/MessageCommand.h @@ -24,13 +24,13 @@ #include "CommandType.h" #include "Command.h" -#define MESSAGE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Message") } - class MessageCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return MESSAGE_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Echos a message.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/OpenSaveCommands.cpp b/src/commands/OpenSaveCommands.cpp index dc2ffef7b..8f814737d 100644 --- a/src/commands/OpenSaveCommands.cpp +++ b/src/commands/OpenSaveCommands.cpp @@ -26,6 +26,9 @@ #include "CommandContext.h" +const ComponentInterfaceSymbol OpenProjectCommand::Symbol +{ XO("Open Project2") }; + bool OpenProjectCommand::DefineParams( ShuttleParams & S ){ S.Define( mFileName, wxT("Filename"), "test.aup" ); S.OptionalN(bHasAddToHistory).Define( mbAddToHistory, wxT("AddToHistory"), false ); @@ -65,6 +68,9 @@ bool OpenProjectCommand::Apply(const CommandContext & context){ return !newFileName.empty() && newFileName != oldFileName; } +const ComponentInterfaceSymbol SaveProjectCommand::Symbol +{ XO("Save Project2") }; + bool SaveProjectCommand::DefineParams( ShuttleParams & S ){ S.Define( mFileName, wxT("Filename"), "name.aup" ); S.Define( mbAddToHistory, wxT("AddToHistory"), false ); diff --git a/src/commands/OpenSaveCommands.h b/src/commands/OpenSaveCommands.h index 93a9a199b..13ac8fd58 100644 --- a/src/commands/OpenSaveCommands.h +++ b/src/commands/OpenSaveCommands.h @@ -21,13 +21,13 @@ #include "Command.h" #include "CommandType.h" -#define OPEN_PROJECT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Open Project2") } - class OpenProjectCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return OPEN_PROJECT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Opens a project.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -41,13 +41,13 @@ public: bool bHasAddToHistory; }; -#define SAVE_PROJECT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Save Project2") } - class SaveProjectCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SAVE_PROJECT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Saves a project.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/PreferenceCommands.cpp b/src/commands/PreferenceCommands.cpp index d2afe9054..1945d70d4 100644 --- a/src/commands/PreferenceCommands.cpp +++ b/src/commands/PreferenceCommands.cpp @@ -24,6 +24,9 @@ SetPreferenceCommand classes #include "../commands/CommandContext.h" #include "../prefs/PrefsDialog.h" +const ComponentInterfaceSymbol GetPreferenceCommand::Symbol +{ XO("Get Preference") }; + bool GetPreferenceCommand::DefineParams( ShuttleParams & S ){ S.Define( mName, wxT("Name"), wxT("") ); return true; @@ -51,6 +54,9 @@ bool GetPreferenceCommand::Apply(const CommandContext & context) return true; } +const ComponentInterfaceSymbol SetPreferenceCommand::Symbol +{ XO("Set Preference") }; + bool SetPreferenceCommand::DefineParams( ShuttleParams & S ){ S.Define( mName, wxT("Name"), wxT("") ); S.Define( mValue, wxT("Value"), wxT("") ); diff --git a/src/commands/PreferenceCommands.h b/src/commands/PreferenceCommands.h index 3d551d7a9..f492ba029 100644 --- a/src/commands/PreferenceCommands.h +++ b/src/commands/PreferenceCommands.h @@ -26,14 +26,13 @@ // GetPreference -#define GET_PREFERENCE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Get Preference") } -#define SET_PREFERENCE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Preference") } - class GetPreferenceCommand final : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return GET_PREFERENCE_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Gets the value of a single preference.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -50,8 +49,10 @@ public: class SetPreferenceCommand final : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_PREFERENCE_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets the value of a single preference.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index 5ea5cca0c..961644f0c 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -44,6 +44,9 @@ small calculations of rectangles. #include "CommandContext.h" #include "CommandManager.h" +const ComponentInterfaceSymbol ScreenshotCommand::Symbol +{ XO("Screenshot") }; + static const EnumValueSymbol kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] = diff --git a/src/commands/ScreenshotCommand.h b/src/commands/ScreenshotCommand.h index 8f92e732e..3de857cb1 100644 --- a/src/commands/ScreenshotCommand.h +++ b/src/commands/ScreenshotCommand.h @@ -28,8 +28,6 @@ class AdornedRulerPanel; class AudacityProject; class CommandContext; -#define SCREENSHOT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Screenshot") } - class ScreenshotCommand : public AudacityCommand { public: @@ -78,9 +76,11 @@ public: nCaptureWhats }; + static const ComponentInterfaceSymbol Symbol; + ScreenshotCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SCREENSHOT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Takes screenshots.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/SelectCommand.cpp b/src/commands/SelectCommand.cpp index c7f4305ec..fc001aad1 100644 --- a/src/commands/SelectCommand.cpp +++ b/src/commands/SelectCommand.cpp @@ -44,6 +44,9 @@ explicitly code all three. #include "CommandContext.h" +const ComponentInterfaceSymbol SelectTimeCommand::Symbol +{ XO("Select Time") }; + // Relative to project and relative to selection cover MOST options, since you can already // set a selection to a clip. const int nRelativeTos =6; @@ -136,6 +139,9 @@ bool SelectTimeCommand::Apply(const CommandContext & context){ return true; } +const ComponentInterfaceSymbol SelectFrequenciesCommand::Symbol +{ XO("Select Frequencies") }; + bool SelectFrequenciesCommand::DefineParams( ShuttleParams & S ){ S.OptionalN( bHasTop ).Define( mTop, wxT("High"), 0.0, 0.0, (double)FLT_MAX); S.OptionalN( bHasBottom ).Define( mBottom, wxT("Low"), 0.0, 0.0, (double)FLT_MAX); @@ -170,6 +176,9 @@ bool SelectFrequenciesCommand::Apply(const CommandContext & context){ return true; } +const ComponentInterfaceSymbol SelectTracksCommand::Symbol +{ XO("Select Tracks") }; + const int nModes =3; static const EnumValueSymbol kModes[nModes] = { @@ -251,3 +260,5 @@ bool SelectTracksCommand::Apply(const CommandContext &context) return true; } +const ComponentInterfaceSymbol SelectCommand::Symbol +{ XO("Select") }; diff --git a/src/commands/SelectCommand.h b/src/commands/SelectCommand.h index f5a461155..d03bd660d 100644 --- a/src/commands/SelectCommand.h +++ b/src/commands/SelectCommand.h @@ -24,17 +24,13 @@ //#include "../commands/AudacityCommand.h" - -#define SELECT_TIME_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select Time") } -#define SELECT_FREQUENCIES_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select Frequencies") } -#define SELECT_TRACKS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select Tracks") } -#define SELECT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Select") } - class SelectTimeCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SELECT_TIME_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Selects a time range.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -57,8 +53,10 @@ public: class SelectFrequenciesCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SELECT_FREQUENCIES_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Selects a frequency range.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -78,8 +76,10 @@ public: class SelectTracksCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SELECT_TRACKS_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Selects a range of tracks.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -100,8 +100,10 @@ public: class SelectCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SELECT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Selects Audio.");}; bool DefineParams( ShuttleParams & S ) override { return diff --git a/src/commands/SetClipCommand.cpp b/src/commands/SetClipCommand.cpp index 0209b41d0..1789a11b2 100644 --- a/src/commands/SetClipCommand.cpp +++ b/src/commands/SetClipCommand.cpp @@ -24,6 +24,9 @@ #include "../Shuttle.h" #include "../ShuttleGui.h" +const ComponentInterfaceSymbol SetClipCommand::Symbol +{ XO("Set Clip") }; + SetClipCommand::SetClipCommand() { } diff --git a/src/commands/SetClipCommand.h b/src/commands/SetClipCommand.h index cfbb8a350..a2ff3f39e 100644 --- a/src/commands/SetClipCommand.h +++ b/src/commands/SetClipCommand.h @@ -18,14 +18,14 @@ #include "SetTrackInfoCommand.h" -#define SET_CLIP_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Clip") } - class SetClipCommand : public SetTrackBase { public: + static const ComponentInterfaceSymbol Symbol; + SetClipCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_CLIP_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a clip.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/SetEnvelopeCommand.cpp b/src/commands/SetEnvelopeCommand.cpp index 47a1cd3e2..be2b006cc 100644 --- a/src/commands/SetEnvelopeCommand.cpp +++ b/src/commands/SetEnvelopeCommand.cpp @@ -25,6 +25,9 @@ #include "../Shuttle.h" #include "../ShuttleGui.h" +const ComponentInterfaceSymbol SetEnvelopeCommand::Symbol +{ XO("Set Envelope") }; + SetEnvelopeCommand::SetEnvelopeCommand() { } diff --git a/src/commands/SetEnvelopeCommand.h b/src/commands/SetEnvelopeCommand.h index 6f7ce4f7a..07da8c9b8 100644 --- a/src/commands/SetEnvelopeCommand.h +++ b/src/commands/SetEnvelopeCommand.h @@ -18,14 +18,14 @@ #include "SetTrackInfoCommand.h" -#define SET_ENVELOPE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Envelope") } - class SetEnvelopeCommand : public SetTrackBase { public: + static const ComponentInterfaceSymbol Symbol; + SetEnvelopeCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_ENVELOPE_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets an envelope point position.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/SetLabelCommand.cpp b/src/commands/SetLabelCommand.cpp index 5a18f01cc..aa66205ef 100644 --- a/src/commands/SetLabelCommand.cpp +++ b/src/commands/SetLabelCommand.cpp @@ -27,6 +27,9 @@ #include "CommandContext.h" #include "../tracks/labeltrack/ui/LabelTrackView.h" +const ComponentInterfaceSymbol SetLabelCommand::Symbol +{ XO("Set Label") }; + SetLabelCommand::SetLabelCommand() { } diff --git a/src/commands/SetLabelCommand.h b/src/commands/SetLabelCommand.h index 2d881c7c6..74d152b5a 100644 --- a/src/commands/SetLabelCommand.h +++ b/src/commands/SetLabelCommand.h @@ -19,14 +19,14 @@ #include "Command.h" #include "CommandType.h" -#define SET_LABEL_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Label") } - class SetLabelCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + SetLabelCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_LABEL_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a label.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/SetProjectCommand.cpp b/src/commands/SetProjectCommand.cpp index d2109fad3..2dad6a6fd 100644 --- a/src/commands/SetProjectCommand.cpp +++ b/src/commands/SetProjectCommand.cpp @@ -29,6 +29,9 @@ #include +const ComponentInterfaceSymbol SetProjectCommand::Symbol +{ XO("Set Project") }; + SetProjectCommand::SetProjectCommand() { } diff --git a/src/commands/SetProjectCommand.h b/src/commands/SetProjectCommand.h index 38463e05a..16f02c1b7 100644 --- a/src/commands/SetProjectCommand.h +++ b/src/commands/SetProjectCommand.h @@ -20,14 +20,14 @@ #include "Command.h" #include "CommandType.h" -#define SET_PROJECT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Project") } - class SetProjectCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + SetProjectCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_PROJECT_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a project.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; diff --git a/src/commands/SetTrackInfoCommand.cpp b/src/commands/SetTrackInfoCommand.cpp index 214a2d08f..f462797e3 100644 --- a/src/commands/SetTrackInfoCommand.cpp +++ b/src/commands/SetTrackInfoCommand.cpp @@ -121,7 +121,10 @@ bool SetTrackBase::Apply(const CommandContext & context ) return true; } -bool SetTrackStatusCommand::DefineParams( ShuttleParams & S ){ +const ComponentInterfaceSymbol SetTrackStatusCommand::Symbol +{ XO("Set Track Status") }; + +bool SetTrackStatusCommand::DefineParams( ShuttleParams & S ){ SetTrackBase::DefineParams( S ); S.OptionalN( bHasTrackName ).Define( mTrackName, wxT("Name"), _("Unnamed") ); // There is also a select command. This is an alternative. @@ -178,6 +181,9 @@ bool SetTrackStatusCommand::ApplyInner(const CommandContext & context, Track * t +const ComponentInterfaceSymbol SetTrackAudioCommand::Symbol +{ XO("Set Track Audio") }; + bool SetTrackAudioCommand::DefineParams( ShuttleParams & S ){ SetTrackBase::DefineParams( S ); S.OptionalN( bHasMute ).Define( bMute, wxT("Mute"), false ); @@ -230,6 +236,9 @@ bool SetTrackAudioCommand::ApplyInner(const CommandContext & context, Track * t +const ComponentInterfaceSymbol SetTrackVisualsCommand::Symbol +{ XO("Set Track Visuals") }; + enum kColours { kColour0, @@ -418,6 +427,9 @@ bool SetTrackVisualsCommand::ApplyInner(const CommandContext & context, Track * } +const ComponentInterfaceSymbol SetTrackCommand::Symbol +{ XO("Set Track") }; + SetTrackCommand::SetTrackCommand() { mSetStatus.mbPromptForTracks = false; diff --git a/src/commands/SetTrackInfoCommand.h b/src/commands/SetTrackInfoCommand.h index 2ef6e525f..d6b695d70 100644 --- a/src/commands/SetTrackInfoCommand.h +++ b/src/commands/SetTrackInfoCommand.h @@ -20,11 +20,6 @@ #include "Command.h" #include "CommandType.h" -#define SET_TRACK_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Track") } -#define SET_TRACK_STATUS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Track Status") } -#define SET_TRACK_AUDIO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Track Audio") } -#define SET_TRACK_VISUALS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Track Visuals") } - class Track; class SetTrackBase : public AudacityCommand @@ -49,9 +44,11 @@ public: class SetTrackStatusCommand : public SetTrackBase { public: + static const ComponentInterfaceSymbol Symbol; + //SetTrackStatusCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_TRACK_STATUS_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a track.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -74,9 +71,11 @@ public: class SetTrackAudioCommand : public SetTrackBase { public: + static const ComponentInterfaceSymbol Symbol; + //SetTrackAudioCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_TRACK_AUDIO_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a track.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -101,9 +100,11 @@ public: class SetTrackVisualsCommand : public SetTrackBase { public: + static const ComponentInterfaceSymbol Symbol; + //SetTrackVisualsCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_TRACK_VISUALS_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a track.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -142,9 +143,11 @@ public: class SetTrackCommand : public SetTrackBase { public: + static const ComponentInterfaceSymbol Symbol; + SetTrackCommand(); // ComponentInterface overrides - ComponentInterfaceSymbol GetSymbol() override {return SET_TRACK_PLUGIN_SYMBOL;}; + ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; TranslatableString GetDescription() override {return XO("Sets various values for a track.");}; // AudacityCommand overrides wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_II#set_track");}; diff --git a/src/tracks/ui/CommonTrackControls.cpp b/src/tracks/ui/CommonTrackControls.cpp index 5994ae4b9..91142c78b 100644 --- a/src/tracks/ui/CommonTrackControls.cpp +++ b/src/tracks/ui/CommonTrackControls.cpp @@ -175,8 +175,6 @@ END_POPUP_MENU() -#define SET_TRACK_NAME_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Set Track Name") } - // An example of using an AudacityCommand simply to create a dialog. // We can add additional functions later, if we want to make it // available to scripting. @@ -184,9 +182,11 @@ END_POPUP_MENU() class SetTrackNameCommand : public AudacityCommand { public: + static const ComponentInterfaceSymbol Symbol; + // ComponentInterface overrides ComponentInterfaceSymbol GetSymbol() override - {return SET_TRACK_NAME_PLUGIN_SYMBOL;}; + { return Symbol; } //TranslatableString GetDescription() override {return XO("Sets the track name.");}; //bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; @@ -198,6 +198,9 @@ public: wxString mName; }; +const ComponentInterfaceSymbol SetTrackNameCommand::Symbol +{ XO("Set Track Name") }; + void SetTrackNameCommand::PopulateOrExchange(ShuttleGui & S) { S.AddSpace(0, 5);