2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
ClickRemoval.h
|
|
|
|
|
|
|
|
Craig DeForest
|
|
|
|
|
|
|
|
(Structure largely stolen from NoiseRemoval.h by Dominic Mazzoni)
|
|
|
|
|
|
|
|
This file is intended to become part of Audacity. You may modify and/or
|
|
|
|
distribute it under the same terms as Audacity itself.
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_EFFECT_CLICK_REMOVAL__
|
|
|
|
#define __AUDACITY_EFFECT_CLICK_REMOVAL__
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
#include <wx/event.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/slider.h>
|
2015-04-17 03:53:42 +00:00
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/textctrl.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#include "Effect.h"
|
|
|
|
|
2015-07-05 15:25:32 +00:00
|
|
|
class Envelope;
|
2015-06-18 14:24:36 +00:00
|
|
|
class ShuttleGui;
|
|
|
|
|
2015-04-19 03:49:05 +00:00
|
|
|
#define CLICKREMOVAL_PLUGIN_SYMBOL XO("Click Removal")
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
class EffectClickRemoval : public Effect
|
|
|
|
{
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
|
|
|
EffectClickRemoval();
|
|
|
|
virtual ~EffectClickRemoval();
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// IdentInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual wxString GetSymbol();
|
|
|
|
virtual wxString GetDescription();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectIdentInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual EffectType GetType();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectClientInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual bool GetAutomationParameters(EffectAutomationParameters & parms);
|
|
|
|
virtual bool SetAutomationParameters(EffectAutomationParameters & parms);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// Effect implementation
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual bool CheckWhetherSkipEffect();
|
|
|
|
virtual bool Startup();
|
2010-01-23 19:44:49 +00:00
|
|
|
virtual bool Process();
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual void PopulateOrExchange(ShuttleGui & S);
|
|
|
|
virtual bool TransferDataToWindow();
|
|
|
|
virtual bool TransferDataFromWindow();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool ProcessOne(int count, WaveTrack * track,
|
|
|
|
sampleCount start, sampleCount len);
|
|
|
|
|
2013-12-16 03:36:33 +00:00
|
|
|
bool RemoveClicks(sampleCount len, float *buffer);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void OnWidthText(wxCommandEvent & evt);
|
|
|
|
void OnThreshText(wxCommandEvent & evt);
|
|
|
|
void OnWidthSlider(wxCommandEvent & evt);
|
|
|
|
void OnThreshSlider(wxCommandEvent & evt);
|
|
|
|
|
|
|
|
private:
|
2010-01-23 19:44:49 +00:00
|
|
|
Envelope *mEnvelope;
|
|
|
|
|
2014-06-03 20:30:19 +00:00
|
|
|
bool mbDidSomething; // This effect usually does nothing on real-world data.
|
2015-04-17 03:53:42 +00:00
|
|
|
int windowSize;
|
|
|
|
int mThresholdLevel;
|
|
|
|
int mClickWidth;
|
|
|
|
int sep;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
wxSlider *mWidthS;
|
|
|
|
wxSlider *mThreshS;
|
|
|
|
wxTextCtrl *mWidthT;
|
|
|
|
wxTextCtrl *mThreshT;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
DECLARE_EVENT_TABLE();
|
2010-01-23 19:44:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|