diff --git a/src/effects/ChangePitch.cpp b/src/effects/ChangePitch.cpp index 0f958318b..5a3d745f6 100644 --- a/src/effects/ChangePitch.cpp +++ b/src/effects/ChangePitch.cpp @@ -211,12 +211,11 @@ bool EffectChangePitch::Process() if (mUseSBSMS) { double pitchRatio = 1.0 + m_dPercentChange / 100.0; - SelectedRegion region(mT0, mT1); EffectSBSMS proxy; proxy.mProxyEffectName = XO("High Quality Pitch Change"); proxy.setParameters(1.0, pitchRatio); - return Delegate(proxy, mUIParent, ®ion, false); + return Delegate(proxy, mUIParent, false); } else #endif diff --git a/src/effects/ChangeTempo.cpp b/src/effects/ChangeTempo.cpp index c6c1d0fcd..c6daa34cb 100644 --- a/src/effects/ChangeTempo.cpp +++ b/src/effects/ChangeTempo.cpp @@ -197,11 +197,10 @@ bool EffectChangeTempo::Process() if (mUseSBSMS) { double tempoRatio = 1.0 + m_PercentChange / 100.0; - SelectedRegion region(mT0, mT1); EffectSBSMS proxy; proxy.mProxyEffectName = XO("High Quality Tempo Change"); proxy.setParameters(tempoRatio, 1.0); - success = Delegate(proxy, mUIParent, ®ion, false); + success = Delegate(proxy, mUIParent, false); } else #endif diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 4fed26210..fb9820502 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -1180,6 +1180,7 @@ bool Effect::DoEffect(wxWindow *parent, mOutputTracks.reset(); + mpSelectedRegion = selectedRegion; mFactory = factory; mProjectRate = projectRate; mTracks = list; @@ -1288,11 +1289,10 @@ bool Effect::DoEffect(wxWindow *parent, return returnVal; } -bool Effect::Delegate( Effect &delegate, - wxWindow *parent, SelectedRegion *selectedRegion, bool shouldPrompt) +bool Effect::Delegate( Effect &delegate, wxWindow *parent, bool shouldPrompt) { return delegate.DoEffect( parent, mProjectRate, mTracks, mFactory, - selectedRegion, shouldPrompt ); + mpSelectedRegion, shouldPrompt ); } // All legacy effects should have this overridden diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 758d144c5..1f5382792 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -249,8 +249,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler, TrackFactory *factory, SelectedRegion *selectedRegion, bool shouldPrompt = true); - bool Delegate( Effect &delegate, - wxWindow *parent, SelectedRegion *selectedRegion, bool shouldPrompt); + bool Delegate( Effect &delegate, wxWindow *parent, bool shouldPrompt); // Realtime Effect Processing /* not virtual */ bool RealtimeAddProcessor(int group, unsigned chans, float rate); @@ -458,6 +457,7 @@ protected: double mProjectRate; // Sample rate of the project - NEW tracks should // be created with this rate... double mSampleRate; + SelectedRegion *mpSelectedRegion{}; TrackFactory *mFactory; const TrackList *inputTracks() const { return mTracks; } std::shared_ptr mOutputTracks; // used only if CopyInputTracks() is called. diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 797af3879..75db3670d 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -968,8 +968,7 @@ bool NyquistEffect::ShowInterface(wxWindow *parent, bool forceModal) effect.SetCommand(mInputCmd); effect.mDebug = (mUIResultID == eDebugID); - SelectedRegion region(mT0, mT1); - bool result = Delegate(effect, parent, ®ion, true); + bool result = Delegate(effect, parent, true); mT0 = effect.mT0; mT1 = effect.mT1; return result;