diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index 36597d854..f9bbd24da 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -50,6 +50,7 @@ #include "../Prefs.h" #include "../Project.h" #include "../FileNames.h" +#include "../ShuttleGui.h" #include @@ -153,9 +154,9 @@ bool EffectNoiseRemoval::CheckWhetherSkipEffect() return (mLevel == 0); } -bool EffectNoiseRemoval::PromptUser() +bool EffectNoiseRemoval::PromptUser(wxWindow *parent) { - NoiseRemovalDialog dlog(this, mParent); + NoiseRemovalDialog dlog(this, parent); dlog.mSensitivity = mSensitivity; dlog.mGain = -mNoiseGain; dlog.mFreq = mFreqSmoothingHz; @@ -614,13 +615,12 @@ bool EffectNoiseRemoval::ProcessOne(int count, WaveTrack * track, double tLen = mOutputTrack->LongSamplesToTime(len); // Filtering effects always end up with more data than they started with. Delete this 'tail'. mOutputTrack->HandleClear(tLen, mOutputTrack->GetEndTime(), false, false); - bool bResult = track->ClearAndPaste(t0, t0 + tLen, mOutputTrack, true, false); + bool bResult = track->ClearAndPaste(t0, t0 + tLen, mOutputTrack.get(), true, false); wxASSERT(bResult); // TO DO: Actually handle this. } // Delete the outputTrack now that its data is inserted in place - delete mOutputTrack; - mOutputTrack = NULL; + mOutputTrack.reset(); } return bLoopSuccess; @@ -680,8 +680,8 @@ BEGIN_EVENT_TABLE(NoiseRemovalDialog,wxDialog) END_EVENT_TABLE() NoiseRemovalDialog::NoiseRemovalDialog(EffectNoiseRemoval * effect, - wxWindow *parent) : - EffectDialog( parent, _("Noise Removal"), PROCESS_EFFECT) + wxWindow *parent) + : EffectDialog( parent, _("Noise Removal"), EffectTypeProcess) { m_pEffect = effect; diff --git a/src/effects/NoiseRemoval.h b/src/effects/NoiseRemoval.h index 6a7df6bf9..f4d84cc01 100644 --- a/src/effects/NoiseRemoval.h +++ b/src/effects/NoiseRemoval.h @@ -20,6 +20,7 @@ #include "Effect.h" +#include "../MemoryX.h" #include #include @@ -30,8 +31,13 @@ class wxString; class Envelope; class WaveTrack; +class wxRadioButton; +class wxTextCtrl; + #include "../RealFFTf.h" +#define NOISEREMOVAL_PLUGIN_SYMBOL XO("Noise Removal") + class EffectNoiseRemoval final : public Effect { public: @@ -50,7 +56,7 @@ public: // Effect implementation - bool PromptUser() override; + bool PromptUser(wxWindow *parent) override; bool Init() override; bool CheckWhetherSkipEffect() override; bool Process() override; @@ -94,7 +100,7 @@ private: void Cleanup(); // Variables that only exist during processing - WaveTrack *mOutputTrack; + std::unique_ptr mOutputTrack; sampleCount mInSampleCount; sampleCount mOutSampleCount; int mInputPos;