Audacity 3.2.0
ClickRemovalBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ClickRemovalBase.h
6
7 Craig DeForest
8
9***********************************************************************/
10#pragma once
11
12#include "SettingsVisitor.h"
13#include "StatefulEffect.h"
14
15class Envelope;
16class WaveChannel;
17
18class BUILTIN_EFFECTS_API ClickRemovalBase : public StatefulEffect
19{
20public:
21 static inline ClickRemovalBase*
23 {
24 return &e;
25 }
27
29 virtual ~ClickRemovalBase();
30
31 // ComponentInterface implementation
32
33 ComponentInterfaceSymbol GetSymbol() const override;
34 TranslatableString GetDescription() const override;
35 ManualPageID ManualPage() const override;
36
37 // EffectDefinitionInterface implementation
38
39 EffectType GetType() const override;
40
41 // Effect implementation
42
43 bool CheckWhetherSkipEffect(const EffectSettings& settings) const override;
44 bool Process(EffectInstance& instance, EffectSettings& settings) override;
45
46private:
47 bool ProcessOne(
48 int count, WaveChannel& track, sampleCount start, sampleCount len);
49
50 bool RemoveClicks(size_t len, float* buffer);
51
52protected:
54
55 bool mbDidSomething; // This effect usually does nothing on real-world data.
56 size_t windowSize;
59 int sep;
60
61 const EffectParameterMethods& Parameters() const override;
62
63 static constexpr EffectParameter Threshold {
64 &ClickRemovalBase::mThresholdLevel, L"Threshold", 200, 0, 900, 1
65 };
66 static constexpr EffectParameter Width {
67 &ClickRemovalBase::mClickWidth, L"Width", 20, 0, 40, 1
68 };
69};
EffectType
static Settings & settings()
Definition: TrackInfo.cpp:51
An Effect for removing clicks.
static const ComponentInterfaceSymbol Symbol
Envelope * mEnvelope
static ClickRemovalBase * FetchParameters(ClickRemovalBase &e, EffectSettings &)
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
virtual EffectType GetType() const =0
Type determines how it behaves.
virtual ManualPageID ManualPage() const
Name of a page in the Audacity alpha manual, default is empty.
virtual const EffectParameterMethods & Parameters() const
Definition: Effect.cpp:96
TranslatableString GetDescription() const override
Definition: Effect.cpp:64
bool CheckWhetherSkipEffect(const EffectSettings &settings) const override
Default implementation returns false.
Definition: Effect.cpp:379
ComponentInterfaceSymbol GetSymbol() const override
Definition: Effect.cpp:49
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
virtual bool Process(EffectInstance &instance, EffectSettings &settings)=0
Holds a msgid for the translation catalog; may also bind format arguments.
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
Externalized state of a plug-in.