1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 15:39:27 +02:00

Make old Noise Removal effect compilable again

This commit is contained in:
Paul Licameli 2016-04-02 12:41:36 -04:00
parent 2d57549f0c
commit 8e447493eb
2 changed files with 15 additions and 9 deletions

View File

@ -50,6 +50,7 @@
#include "../Prefs.h"
#include "../Project.h"
#include "../FileNames.h"
#include "../ShuttleGui.h"
#include <math.h>
@ -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;

View File

@ -20,6 +20,7 @@
#include "Effect.h"
#include "../MemoryX.h"
#include <wx/dialog.h>
#include <wx/slider.h>
@ -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<WaveTrack> mOutputTrack;
sampleCount mInSampleCount;
sampleCount mOutSampleCount;
int mInputPos;