Audacity  2.2.2
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 <wx/event.h>
20 #include <wx/slider.h>
21 #include <wx/string.h>
22 #include <wx/textctrl.h>
23 
24 #include "Effect.h"
25 
26 class Envelope;
27 class ShuttleGui;
28 
29 #define CLICKREMOVAL_PLUGIN_SYMBOL IdentInterfaceSymbol{ XO("Click Removal") }
30 
31 class EffectClickRemoval final : public Effect
32 {
33 public:
35  virtual ~EffectClickRemoval();
36 
37  // IdentInterface implementation
38 
40  wxString GetDescription() override;
41  wxString ManualPage() override;
42 
43  // EffectDefinitionInterface implementation
44 
45  EffectType GetType() override;
46 
47  // EffectClientInterface implementation
48 
49  bool DefineParams( ShuttleParams & S ) override;
50  bool GetAutomationParameters(CommandParameters & parms) override;
51  bool SetAutomationParameters(CommandParameters & parms) override;
52 
53  // Effect implementation
54 
55  bool CheckWhetherSkipEffect() override;
56  bool Startup() override;
57  bool Process() override;
58  void PopulateOrExchange(ShuttleGui & S) override;
59  bool TransferDataToWindow() override;
60  bool TransferDataFromWindow() override;
61 
62 private:
63  bool ProcessOne(int count, WaveTrack * track,
64  sampleCount start, sampleCount len);
65 
66  bool RemoveClicks(size_t len, float *buffer);
67 
68  void OnWidthText(wxCommandEvent & evt);
69  void OnThreshText(wxCommandEvent & evt);
70  void OnWidthSlider(wxCommandEvent & evt);
71  void OnThreshSlider(wxCommandEvent & evt);
72 
73 private:
75 
76  bool mbDidSomething; // This effect usually does nothing on real-world data.
77  size_t windowSize;
80  int sep;
81 
82  wxSlider *mWidthS;
83  wxSlider *mThreshS;
84  wxTextCtrl *mWidthT;
85  wxTextCtrl *mThreshT;
86 
87  DECLARE_EVENT_TABLE()
88 };
89 
90 #endif
bool DefineParams(ShuttleParams &S) override
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
bool SetAutomationParameters(CommandParameters &parms) override
Envelope * mEnvelope
Definition: ClickRemoval.h:74
wxSlider * mWidthS
Definition: ClickRemoval.h:82
bool TransferDataToWindow() override
void OnWidthText(wxCommandEvent &evt)
bool TransferDataFromWindow() override
Draggable curve used in TrackPanel for varying amplification.
Definition: Envelope.h:77
virtual ~EffectClickRemoval()
wxSlider * mThreshS
Definition: ClickRemoval.h:83
Base class for many of the effects in Audacity.
Definition: Effect.h:62
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:60
wxTextCtrl * mWidthT
Definition: ClickRemoval.h:84
IdentInterfaceSymbol GetSymbol() override
void OnThreshSlider(wxCommandEvent &evt)
wxString GetDescription() override
An Effect for removing clicks.
Definition: ClickRemoval.h:31
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
void OnWidthSlider(wxCommandEvent &evt)
wxString ManualPage() override
IdentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
bool GetAutomationParameters(CommandParameters &parms) override
bool ProcessOne(int count, WaveTrack *track, sampleCount start, sampleCount len)
void OnThreshText(wxCommandEvent &evt)
wxTextCtrl * mThreshT
Definition: ClickRemoval.h:85
bool Process() override
EffectType
EffectType GetType() override
bool RemoveClicks(size_t len, float *buffer)
void PopulateOrExchange(ShuttleGui &S) override
bool Startup() override
bool CheckWhetherSkipEffect() override