Audacity 3.2.0
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#include "../ShuttleAutomation.h"
21
22class wxSlider;
23class wxTextCtrl;
24class Envelope;
25class ShuttleGui;
26
28{
29public:
30 static inline EffectClickRemoval *
33
35 virtual ~EffectClickRemoval();
36
37 // ComponentInterface implementation
38
39 ComponentInterfaceSymbol GetSymbol() const override;
40 TranslatableString GetDescription() const override;
41 ManualPageID ManualPage() const override;
42
43 // EffectDefinitionInterface implementation
44
45 EffectType GetType() const override;
46
47 // Effect implementation
48
49 bool CheckWhetherSkipEffect(const EffectSettings &settings) const override;
50 bool Process(EffectInstance &instance, EffectSettings &settings) override;
51 std::unique_ptr<EffectUIValidator> PopulateOrExchange(
52 ShuttleGui & S, EffectInstance &instance, EffectSettingsAccess &access)
53 override;
54
55private:
56 bool ProcessOne(int count, WaveTrack * track,
57 sampleCount start, sampleCount len);
58
59 bool RemoveClicks(size_t len, float *buffer);
60
61 void OnWidthText(wxCommandEvent & evt);
62 void OnThreshText(wxCommandEvent & evt);
63 void OnWidthSlider(wxCommandEvent & evt);
64 void OnThreshSlider(wxCommandEvent & evt);
65
66private:
68
69 bool mbDidSomething; // This effect usually does nothing on real-world data.
70 size_t windowSize;
73 int sep;
74
75 wxSlider *mWidthS;
76 wxSlider *mThreshS;
77 wxTextCtrl *mWidthT;
78 wxTextCtrl *mThreshT;
79
80 const EffectParameterMethods& Parameters() const override;
81 DECLARE_EVENT_TABLE()
82
84 L"Threshold", 200, 0, 900, 1 };
86 L"Width", 20, 0, 40, 1 };
87};
88
89#endif
EffectType
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:87
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
An Effect for removing clicks.
Definition: ClickRemoval.h:28
bool RemoveClicks(size_t len, float *buffer)
wxTextCtrl * mThreshT
Definition: ClickRemoval.h:78
static constexpr EffectParameter Width
Definition: ClickRemoval.h:85
const EffectParameterMethods & Parameters() const override
void OnWidthSlider(wxCommandEvent &evt)
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
Add controls to effect panel; always succeeds.
bool CheckWhetherSkipEffect(const EffectSettings &settings) const override
After Init(), tell whether Process() should be skipped.
static EffectClickRemoval * FetchParameters(EffectClickRemoval &e, EffectSettings &)
Definition: ClickRemoval.h:31
void OnThreshSlider(wxCommandEvent &evt)
EffectType GetType() const override
Type determines how it behaves.
wxTextCtrl * mWidthT
Definition: ClickRemoval.h:77
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
virtual ~EffectClickRemoval()
static const ComponentInterfaceSymbol Symbol
Definition: ClickRemoval.h:32
wxSlider * mThreshS
Definition: ClickRemoval.h:76
bool ProcessOne(int count, WaveTrack *track, sampleCount start, sampleCount len)
TranslatableString GetDescription() const override
Envelope * mEnvelope
Definition: ClickRemoval.h:67
ComponentInterfaceSymbol GetSymbol() const override
void OnWidthText(wxCommandEvent &evt)
bool Process(EffectInstance &instance, EffectSettings &settings) override
Actually do the effect here.
static constexpr EffectParameter Threshold
Definition: ClickRemoval.h:83
wxSlider * mWidthS
Definition: ClickRemoval.h:75
void OnThreshText(wxCommandEvent &evt)
Performs effect computation.
Interface for manipulations of an Effect's settings.
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
Externalized state of a plug-in.