diff --git a/src/commands/AudacityCommand.cpp b/src/commands/AudacityCommand.cpp index 7ed08d232..89e6dbfcf 100644 --- a/src/commands/AudacityCommand.cpp +++ b/src/commands/AudacityCommand.cpp @@ -37,7 +37,6 @@ ShuttleGui. #include "audacity/ConfigInterface.h" -#include "../Project.h" #include "../Shuttle.h" #include "../ShuttleGui.h" #include "../widgets/ProgressDialog.h" @@ -87,12 +86,6 @@ VendorSymbol AudacityCommand::GetVendor(){ return XO("Audacity");} wxString AudacityCommand::GetVersion(){ return AUDACITY_VERSION_STRING;} -bool AudacityCommand::Apply() { - AudacityProject * pProj = GetActiveProject(); - const CommandContext context( *pProj ); - return Apply( context ); -}; - bool AudacityCommand::Init(){ if( !mNeedsInit ) return true; diff --git a/src/commands/AudacityCommand.h b/src/commands/AudacityCommand.h index d454c337d..e26c0fb06 100644 --- a/src/commands/AudacityCommand.h +++ b/src/commands/AudacityCommand.h @@ -69,8 +69,7 @@ class AUDACITY_DLL_API AudacityCommand /* not final */ : public wxEvtHandler, virtual bool IsBatchProcessing(){ return mIsBatch;} virtual void SetBatchProcessing(bool start){ mIsBatch = start;}; - virtual bool Apply(const CommandContext & WXUNUSED(context) ) {return false;}; - virtual bool Apply(); // redirects to the command context version. + virtual bool Apply(const CommandContext & WXUNUSED(context) ) {return false;}; bool ShowInterface(wxWindow *parent, bool forceModal = false); virtual void SetHostUI(EffectUIHostInterface * WXUNUSED(host)){;}; diff --git a/src/commands/CompareAudioCommand.cpp b/src/commands/CompareAudioCommand.cpp index 70aaca13c..c3502b85b 100644 --- a/src/commands/CompareAudioCommand.cpp +++ b/src/commands/CompareAudioCommand.cpp @@ -46,10 +46,6 @@ bool CompareAudioCommand::DefineParams( ShuttleParams & S ){ return true; } -bool CompareAudioCommand::Apply(){ - return true; -} - void CompareAudioCommand::PopulateOrExchange(ShuttleGui & S) { S.AddSpace(0, 5); diff --git a/src/commands/CompareAudioCommand.h b/src/commands/CompareAudioCommand.h index 01a350181..de51d88fd 100644 --- a/src/commands/CompareAudioCommand.h +++ b/src/commands/CompareAudioCommand.h @@ -33,7 +33,6 @@ public: wxString GetDescription() override {return _("Compares a range on two tracks.");}; bool DefineParams( ShuttleParams & S ) override; void PopulateOrExchange(ShuttleGui & S) override; - bool Apply() override; // AudacityCommand overrides wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_II#compare_Audio");}; diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 7d70cf45b..bd322748f 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -3322,7 +3322,9 @@ void EffectUIHost::OnApply(wxCommandEvent & evt) if( mEffect ) mEffect->Apply(); if( mCommand ) - mCommand->Apply(); + // PRL: I don't like the global and would rather pass *mProject! + // But I am preserving old behavior + mCommand->Apply( CommandContext{ *GetActiveProject() } ); } void EffectUIHost::DoCancel()