mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-02 06:40:12 +01:00
Remove EffectHostInterface::Apply so Effect doesn't use EffectManager
This commit is contained in:
@@ -121,7 +121,6 @@ public:
|
||||
virtual NumericFormatSymbol GetDurationFormat() = 0;
|
||||
virtual void SetDuration(double seconds) = 0;
|
||||
|
||||
virtual bool Apply() = 0;
|
||||
virtual void Preview() = 0;
|
||||
|
||||
//
|
||||
|
||||
@@ -33,7 +33,6 @@ greater use in future.
|
||||
#include <wx/listbox.h>
|
||||
#include <wx/sizer.h>
|
||||
|
||||
#include "EffectManager.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../LabelTrack.h"
|
||||
#include "../Mix.h"
|
||||
@@ -52,7 +51,6 @@ greater use in future.
|
||||
#include "../widgets/NumericTextCtrl.h"
|
||||
#include "../widgets/AudacityMessageBox.h"
|
||||
#include "../widgets/ErrorDialog.h"
|
||||
#include "../commands/CommandContext.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -728,17 +726,6 @@ void Effect::SetDuration(double seconds)
|
||||
return;
|
||||
}
|
||||
|
||||
bool Effect::Apply()
|
||||
{
|
||||
auto &project = *GetActiveProject();
|
||||
CommandContext context( project );
|
||||
// This is absolute hackage...but easy and I can't think of another way just now.
|
||||
//
|
||||
// It should callback to the EffectManager to kick off the processing
|
||||
return EffectManager::DoEffect(GetID(), context,
|
||||
EffectManager::kConfigured);
|
||||
}
|
||||
|
||||
void Effect::Preview()
|
||||
{
|
||||
Preview(false);
|
||||
|
||||
@@ -177,7 +177,6 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
||||
virtual NumericFormatSymbol GetSelectionFormat() /* not override? */; // time format in Selection toolbar
|
||||
void SetDuration(double duration) override;
|
||||
|
||||
bool Apply() override;
|
||||
void Preview() override;
|
||||
|
||||
wxDialog *CreateUI(wxWindow *parent, EffectUIClientInterface *client) override;
|
||||
|
||||
@@ -1187,8 +1187,16 @@ void EffectUIHost::OnApply(wxCommandEvent & evt)
|
||||
mApplyBtn->Disable();
|
||||
auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
|
||||
|
||||
if( mEffect )
|
||||
mEffect->Apply();
|
||||
if( mEffect ) {
|
||||
auto &project = *GetActiveProject();
|
||||
CommandContext context( project );
|
||||
// This is absolute hackage...but easy and I can't think of another way just now.
|
||||
//
|
||||
// It should callback to the EffectManager to kick off the processing
|
||||
EffectManager::DoEffect(mEffect->GetID(), context,
|
||||
EffectManager::kConfigured);
|
||||
}
|
||||
|
||||
if( mCommand )
|
||||
// PRL: I don't like the global and would rather pass *mProject!
|
||||
// But I am preserving old behavior
|
||||
|
||||
Reference in New Issue
Block a user