Audacity  3.0.3
ClickRemoval.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ClickRemoval.h
6 
7  Craig DeForest
8 
9  (Structure largely stolen from NoiseRemoval.h by Dominic Mazzoni)
10 
11  This file is intended to become part of Audacity. You may modify and/or
12  distribute it under the same terms as Audacity itself.
13 
14 **********************************************************************/
15 
16 #ifndef __AUDACITY_EFFECT_CLICK_REMOVAL__
17 #define __AUDACITY_EFFECT_CLICK_REMOVAL__
18 
19 #include "Effect.h"
20 
21 class wxSlider;
22 class wxTextCtrl;
23 class Envelope;
24 class ShuttleGui;
25 
26 class EffectClickRemoval final : public Effect
27 {
28 public:
30 
32  virtual ~EffectClickRemoval();
33 
34  // ComponentInterface implementation
35 
38  ManualPageID ManualPage() override;
39 
40  // EffectDefinitionInterface implementation
41 
42  EffectType GetType() override;
43 
44  // EffectClientInterface implementation
45 
46  bool DefineParams( ShuttleParams & S ) override;
47  bool GetAutomationParameters(CommandParameters & parms) override;
48  bool SetAutomationParameters(CommandParameters & parms) override;
49 
50  // Effect implementation
51 
52  bool CheckWhetherSkipEffect() override;
53  bool Startup() override;
54  bool Process() override;
55  void PopulateOrExchange(ShuttleGui & S) override;
56  bool TransferDataToWindow() override;
57  bool TransferDataFromWindow() override;
58 
59 private:
60  bool ProcessOne(int count, WaveTrack * track,
61  sampleCount start, sampleCount len);
62 
63  bool RemoveClicks(size_t len, float *buffer);
64 
65  void OnWidthText(wxCommandEvent & evt);
66  void OnThreshText(wxCommandEvent & evt);
67  void OnWidthSlider(wxCommandEvent & evt);
68  void OnThreshSlider(wxCommandEvent & evt);
69 
70 private:
72 
73  bool mbDidSomething; // This effect usually does nothing on real-world data.
74  size_t windowSize;
77  int sep;
78 
79  wxSlider *mWidthS;
80  wxSlider *mThreshS;
81  wxTextCtrl *mWidthT;
82  wxTextCtrl *mThreshT;
83 
84  DECLARE_EVENT_TABLE()
85 };
86 
87 #endif
EffectClickRemoval::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: ClickRemoval.cpp:338
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
EffectClickRemoval::GetType
EffectType GetType() override
Definition: ClickRemoval.cpp:103
Effect.h
EffectClickRemoval::OnWidthText
void OnWidthText(wxCommandEvent &evt)
Definition: ClickRemoval.cpp:403
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:72
Envelope
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:71
EffectClickRemoval::mThresholdLevel
int mThresholdLevel
Definition: ClickRemoval.h:75
EffectClickRemoval::GetDescription
TranslatableString GetDescription() override
Definition: ClickRemoval.cpp:91
EffectClickRemoval::~EffectClickRemoval
virtual ~EffectClickRemoval()
Definition: ClickRemoval.cpp:80
EffectClickRemoval::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: ClickRemoval.cpp:123
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
EffectClickRemoval::mEnvelope
Envelope * mEnvelope
Definition: ClickRemoval.h:71
EffectClickRemoval::sep
int sep
Definition: ClickRemoval.h:77
EffectClickRemoval::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: ClickRemoval.cpp:109
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectClickRemoval::mThreshT
wxTextCtrl * mThreshT
Definition: ClickRemoval.h:82
EffectClickRemoval::CheckWhetherSkipEffect
bool CheckWhetherSkipEffect() override
Definition: ClickRemoval.cpp:136
EffectClickRemoval
An Effect for removing clicks.
Definition: ClickRemoval.h:27
EffectClickRemoval::windowSize
size_t windowSize
Definition: ClickRemoval.h:74
EffectClickRemoval::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: ClickRemoval.cpp:86
EffectClickRemoval::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ClickRemoval.cpp:393
EffectClickRemoval::Process
bool Process() override
Definition: ClickRemoval.cpp:177
EffectClickRemoval::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: ClickRemoval.h:29
EffectClickRemoval::mClickWidth
int mClickWidth
Definition: ClickRemoval.h:76
EffectClickRemoval::OnWidthSlider
void OnWidthSlider(wxCommandEvent &evt)
Definition: ClickRemoval.cpp:415
EffectClickRemoval::mbDidSomething
bool mbDidSomething
Definition: ClickRemoval.h:73
EffectClickRemoval::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ClickRemoval.cpp:383
EffectClickRemoval::EffectClickRemoval
EffectClickRemoval()
Definition: ClickRemoval.cpp:69
EffectClickRemoval::mThreshS
wxSlider * mThreshS
Definition: ClickRemoval.h:80
EffectClickRemoval::RemoveClicks
bool RemoveClicks(size_t len, float *buffer)
Definition: ClickRemoval.cpp:268
TaggedIdentifier< ManualPageIDTag >
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
EffectClickRemoval::ProcessOne
bool ProcessOne(int count, WaveTrack *track, sampleCount start, sampleCount len)
Definition: ClickRemoval.cpp:213
EffectClickRemoval::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: ClickRemoval.cpp:115
EffectClickRemoval::mWidthS
wxSlider * mWidthS
Definition: ClickRemoval.h:79
EffectClickRemoval::OnThreshSlider
void OnThreshSlider(wxCommandEvent &evt)
Definition: ClickRemoval.cpp:421
EffectClickRemoval::OnThreshText
void OnThreshText(wxCommandEvent &evt)
Definition: ClickRemoval.cpp:409
EffectType
EffectType
Definition: EffectInterface.h:55
EffectClickRemoval::ManualPage
ManualPageID ManualPage() override
Definition: ClickRemoval.cpp:96
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
EffectClickRemoval::Startup
bool Startup() override
Definition: ClickRemoval.cpp:141
EffectClickRemoval::mWidthT
wxTextCtrl * mWidthT
Definition: ClickRemoval.h:81