Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
ClickRemovalBase Class Reference

An Effect for removing clicks. More...

#include <ClickRemovalBase.h>

Inheritance diagram for ClickRemovalBase:
[legend]
Collaboration diagram for ClickRemovalBase:
[legend]

Public Member Functions

 ClickRemovalBase ()
 
virtual ~ClickRemovalBase ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
ManualPageID ManualPage () const override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 After Init(), tell whether Process() should be skipped. More...
 
bool Process (EffectInstance &instance, EffectSettings &settings) override
 
- Public Member Functions inherited from StatefulEffect
 ~StatefulEffect () override
 
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from StatefulEffectBase
virtual bool Init ()
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (MessagePackage &package)
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
virtual size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
 
virtual bool RealtimeProcessEnd (EffectSettings &settings) noexcept
 settings can be updated to let a dialog change appearance at idle More...
 
virtual bool RealtimeFinalize (EffectSettings &settings) noexcept
 
virtual size_t SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 
virtual unsigned GetAudioInCount () const
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const
 How many output buffers to allocate at once. More...
 
virtual sampleCount GetLatency () const
 
virtual bool NeedsDither () const
 
virtual bool ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr)
 
virtual bool ProcessFinalize () noexcept
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () const override
 
bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings) override
 
bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
RealtimeSince RealtimeSupport () const override
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
OptionalMessage LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
OptionalMessage LoadFactoryPreset (int id, EffectSettings &settings) const override
 
OptionalMessage LoadFactoryDefaults (EffectSettings &settings) const override
 
virtual const EffectParameterMethodsParameters () const
 
bool CanExportPresets () const override
 Whether the effect supports export of presets to files, and importing too. More...
 
bool HasOptions () const override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatID GetSelectionFormat ()
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings, InstanceFinder finder={})
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
bool IsLinearEffect () const
 
bool PreviewsFullSelection () const
 
void SetTracks (TrackList *pTracks)
 
double GetDefaultDuration ()
 
virtual std::any BeginPreview (const EffectSettings &settings)
 Called when Preview() starts, to allow temporary effect state changes. More...
 
bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess) override
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void CountWaveTracks ()
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual bool HasOptions () const =0
 
virtual bool CanExportPresets () const =0
 Whether the effect supports export of presets to files, and importing too. More...
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
virtual std::unique_ptr< EffectOutputsMakeOutputs () const
 Produce an object to hold values to send to effect output meters. More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual RealtimeSince RealtimeSupport () const =0
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsRealtime () const
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Static Public Member Functions

static ClickRemovalBaseFetchParameters (ClickRemovalBase &e, EffectSettings &)
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
- Static Public Member Functions inherited from EffectBase
static std::optional< InstancePointerFindInstance (EffectPlugin &plugin)
 
static InstanceFinder DefaultInstanceFinder (EffectPlugin &plugin)
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Click Removal") }
 
- Static Public Attributes inherited from EffectPlugin
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Protected Member Functions

const EffectParameterMethodsParameters () const override
 
- Protected Member Functions inherited from Effect
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 Default implementation returns previewLength More...
 
bool TotalProgress (double frac, const TranslatableString &={}) const
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={}) const
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={}) const
 
int GetNumWaveTracks () const
 
int GetNumWaveGroups () const
 
void GetBounds (const WaveTrack &track, sampleCount *start, sampleCount *len)
 
- Protected Member Functions inherited from EffectBase
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 

Protected Attributes

EnvelopemEnvelope
 
bool mbDidSomething
 
size_t windowSize
 
int mThresholdLevel
 
int mClickWidth
 
int sep
 
- Protected Attributes inherited from EffectBase
double mF0 {}
 
double mF1 {}
 
wxArrayString mPresetNames
 
unsigned mUIFlags { 0 }
 

Static Protected Attributes

static constexpr EffectParameter Threshold
 
static constexpr EffectParameter Width
 

Private Member Functions

bool ProcessOne (int count, WaveChannel &track, sampleCount start, sampleCount len)
 
bool RemoveClicks (size_t len, float *buffer)
 

Additional Inherited Members

- Public Types inherited from StatefulEffectBase
using MessagePackage = EffectInstance::MessagePackage
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
using InstancePointer = std::shared_ptr< EffectInstanceEx >
 
using InstanceFinder = std::function< std::optional< InstancePointer >(EffectSettings &settings) >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , After_3_1 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Public Attributes inherited from EffectBase
std::shared_ptr< TrackListmTracks {}
 
int mNumTracks {}
 
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
double mT0 {}
 
double mT1 {}
 
bool mIsPreview { false }
 

Detailed Description

An Effect for removing clicks.

Clicks are identified as small regions of high amplitude compared to the surrounding chunk of sound. Anything sufficiently tall compared to a large (2048 sample) window around it, and sufficiently narrow, is considered to be a click.

The structure was largely stolen from Domonic Mazzoni's NoiseRemoval module, and reworked for the NEW effect.

This file is intended to become part of Audacity. You may modify and/or distribute it under the same terms as Audacity itself.

Definition at line 18 of file ClickRemovalBase.h.

Constructor & Destructor Documentation

◆ ClickRemovalBase()

ClickRemovalBase::ClickRemovalBase ( )

Definition at line 42 of file ClickRemovalBase.cpp.

43{
44 Parameters().Reset(*this);
45
47
48 windowSize = 8192;
49 sep = 2049;
50}
const EffectParameterMethods & Parameters() const override
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: EffectBase.cpp:210
virtual void Reset(Effect &effect) const =0

References Parameters(), EffectParameterMethods::Reset(), sep, EffectBase::SetLinearEffectFlag(), and windowSize.

Here is the call graph for this function:

◆ ~ClickRemovalBase()

ClickRemovalBase::~ClickRemovalBase ( )
virtual

Definition at line 52 of file ClickRemovalBase.cpp.

53{
54}

Member Function Documentation

◆ CheckWhetherSkipEffect()

bool ClickRemovalBase::CheckWhetherSkipEffect ( const EffectSettings settings) const
overridevirtual

After Init(), tell whether Process() should be skipped.

Implements EffectBase.

Definition at line 82 of file ClickRemovalBase.cpp.

83{
84 return ((mClickWidth == 0) || (mThresholdLevel == 0));
85}

References mClickWidth, and mThresholdLevel.

◆ FetchParameters()

static ClickRemovalBase * ClickRemovalBase::FetchParameters ( ClickRemovalBase e,
EffectSettings  
)
inlinestatic

Definition at line 22 of file ClickRemovalBase.h.

23 {
24 return &e;
25 }

◆ GetDescription()

TranslatableString ClickRemovalBase::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 63 of file ClickRemovalBase.cpp.

64{
65 return XO("Click Removal is designed to remove clicks on audio tracks");
66}
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol ClickRemovalBase::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 58 of file ClickRemovalBase.cpp.

59{
60 return Symbol;
61}
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ GetType()

EffectType ClickRemovalBase::GetType ( ) const
overridevirtual

Type determines how it behaves.

Implements EffectDefinitionInterface.

Definition at line 75 of file ClickRemovalBase.cpp.

76{
77 return EffectTypeProcess;
78}
@ EffectTypeProcess

References EffectTypeProcess.

Referenced by Process().

Here is the caller graph for this function:

◆ ManualPage()

ManualPageID ClickRemovalBase::ManualPage ( ) const
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 68 of file ClickRemovalBase.cpp.

69{
70 return L"Click_Removal";
71}

◆ Parameters()

const EffectParameterMethods & ClickRemovalBase::Parameters ( ) const
overrideprotectedvirtual

Reimplemented from Effect.

Definition at line 34 of file ClickRemovalBase.cpp.

35{
37 return parameters;
38}
Generates EffectParameterMethods overrides from variadic template arguments.

Referenced by ClickRemovalBase().

Here is the caller graph for this function:

◆ Process()

bool ClickRemovalBase::Process ( EffectInstance instance,
EffectSettings settings 
)
overridevirtual

Implements StatefulEffectBase.

Definition at line 87 of file ClickRemovalBase.cpp.

88{
89 EffectOutputTracks outputs { *mTracks, GetType(), { { mT0, mT1 } } };
90 bool bGoodResult = true;
91 mbDidSomething = false;
92
93 int count = 0;
94 for (auto track : outputs.Get().Selected<WaveTrack>())
95 {
96 double trackStart = track->GetStartTime();
97 double trackEnd = track->GetEndTime();
98 double t0 = std::max(mT0, trackStart);
99 double t1 = std::min(trackEnd, mT1);
100
101 if (t1 > t0)
102 {
103 auto start = track->TimeToLongSamples(t0);
104 auto end = track->TimeToLongSamples(t1);
105 auto len = end - start;
106 for (const auto pChannel : track->Channels())
107 if (!ProcessOne(count++, *pChannel, start, len))
108 {
109 bGoodResult = false;
110 goto done;
111 }
112 }
113 }
114done:
115 if (bGoodResult && !mbDidSomething) // Processing successful, but
116 // ineffective.
117 {
118 using namespace BasicUI;
120 XO("Algorithm not effective on this audio. Nothing changed."),
121 MessageBoxOptions {}.IconStyle(Icon::Error));
122 }
123
124 if (bGoodResult && mbDidSomething)
125 outputs.Commit();
126
127 return bGoodResult && mbDidSomething;
128}
int min(int a, int b)
bool ProcessOne(int count, WaveChannel &track, sampleCount start, sampleCount len)
EffectType GetType() const override
Type determines how it behaves.
double mT1
Definition: EffectBase.h:123
std::shared_ptr< TrackList > mTracks
Definition: EffectBase.h:116
double mT0
Definition: EffectBase.h:122
Use this object to copy the input tracks to tentative outputTracks.
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:287
const char * end(const char *str) noexcept
Definition: StringUtils.h:106
MessageBoxOptions && IconStyle(Icon style) &&
Definition: BasicUI.h:104

References details::end(), GetType(), BasicUI::MessageBoxOptions::IconStyle(), mbDidSomething, min(), EffectBase::mT0, EffectBase::mT1, EffectBase::mTracks, ProcessOne(), BasicUI::ShowMessageBox(), and XO().

Here is the call graph for this function:

◆ ProcessOne()

bool ClickRemovalBase::ProcessOne ( int  count,
WaveChannel track,
sampleCount  start,
sampleCount  len 
)
private

Definition at line 130 of file ClickRemovalBase.cpp.

132{
133 if (len <= windowSize / 2)
134 {
135 using namespace BasicUI;
137 XO("Selection must be larger than %d samples.").Format(windowSize / 2),
138 MessageBoxOptions {}.IconStyle(Icon::Error));
139 return false;
140 }
141
142 auto idealBlockLen = track.GetMaxBlockSize() * 4;
143 if (idealBlockLen % windowSize != 0)
144 idealBlockLen += (windowSize - (idealBlockLen % windowSize));
145
146 bool bResult = true;
147 decltype(len) s = 0;
148 Floats buffer { idealBlockLen };
149 Floats datawindow { windowSize };
150 while ((len - s) > windowSize / 2)
151 {
152 auto block = limitSampleBufferSize(idealBlockLen, len - s);
153 track.GetFloats(buffer.get(), start + s, block);
154 for (decltype(block) i = 0; i + windowSize / 2 < block;
155 i += windowSize / 2)
156 {
157 auto wcopy = std::min(windowSize, block - i);
158 for (decltype(wcopy) j = 0; j < wcopy; ++j)
159 datawindow[j] = buffer[i + j];
160 for (auto j = wcopy; j < windowSize; ++j)
161 datawindow[j] = 0;
162 mbDidSomething |= RemoveClicks(windowSize, datawindow.get());
163 for (decltype(wcopy) j = 0; j < wcopy; ++j)
164 buffer[i + j] = datawindow[j];
165 }
166
167 if (mbDidSomething)
168 {
169 // RemoveClicks() actually did something.
170 if (!track.SetFloats(buffer.get(), start + s, block))
171 {
172 bResult = false;
173 break;
174 }
175 }
176 s += block;
177 if (TrackProgress(count, s.as_double() / len.as_double()))
178 {
179 bResult = false;
180 break;
181 }
182 }
183 return bResult;
184}
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:22
bool RemoveClicks(size_t len, float *buffer)
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={}) const
Definition: Effect.cpp:343
Abstract base class used in importing a file.
bool SetFloats(const float *buffer, sampleCount start, size_t len, sampleFormat effectiveFormat=widestSampleFormat)
Random-access assignment of a range of samples.
Definition: WaveTrack.h:162
bool GetFloats(float *buffer, sampleCount start, size_t len, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
"narrow" overload fetches from the unique channel
Definition: WaveTrack.h:129
size_t GetMaxBlockSize() const
Definition: WaveTrack.h:859
double as_double() const
Definition: SampleCount.h:46

References sampleCount::as_double(), WaveChannel::GetFloats(), WaveChannel::GetMaxBlockSize(), BasicUI::MessageBoxOptions::IconStyle(), limitSampleBufferSize(), mbDidSomething, min(), RemoveClicks(), WaveChannel::SetFloats(), BasicUI::ShowMessageBox(), Effect::TrackProgress(), windowSize, and XO().

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveClicks()

bool ClickRemovalBase::RemoveClicks ( size_t  len,
float *  buffer 
)
private

Definition at line 186 of file ClickRemovalBase.cpp.

187{
188 bool bResult = false; // This effect usually does nothing.
189 size_t i;
190 size_t j;
191 int left = 0;
192
193 float msw;
194 int ww;
195 int s2 = sep / 2;
196 Floats ms_seq { len };
197 Floats b2 { len };
198
199 for (i = 0; i < len; i++)
200 b2[i] = buffer[i] * buffer[i];
201
202 /* Shortcut for rms - multiple passes through b2, accumulating
203 * as we go.
204 */
205 for (i = 0; i < len; i++)
206 ms_seq[i] = b2[i];
207
208 for (i = 1; (int)i < sep; i *= 2)
209 {
210 for (j = 0; j < len - i; j++)
211 ms_seq[j] += ms_seq[j + i];
212 }
213
214 /* Cheat by truncating sep to next-lower power of two... */
215 sep = i;
216
217 for (i = 0; i < len - sep; i++)
218 {
219 ms_seq[i] /= sep;
220 }
221 /* ww runs from about 4 to mClickWidth. wrc is the reciprocal;
222 * chosen so that integer roundoff doesn't clobber us.
223 */
224 int wrc;
225 for (wrc = mClickWidth / 4; wrc >= 1; wrc /= 2)
226 {
227 ww = mClickWidth / wrc;
228
229 for (i = 0; i < len - sep; i++)
230 {
231 msw = 0;
232 for (j = 0; (int)j < ww; j++)
233 {
234 msw += b2[i + s2 + j];
235 }
236 msw /= ww;
237
238 if (msw >= mThresholdLevel * ms_seq[i] / 10)
239 {
240 if (left == 0)
241 {
242 left = i + s2;
243 }
244 }
245 else
246 {
247 if (left != 0 && ((int)i - left + s2) <= ww * 2)
248 {
249 float lv = buffer[left];
250 float rv = buffer[i + ww + s2];
251 for (j = left; j < i + ww + s2; j++)
252 {
253 bResult = true;
254 buffer[j] = (rv * (j - left) + lv * (i + ww + s2 - j)) /
255 (float)(i + ww + s2 - left);
256 b2[j] = buffer[j] * buffer[j];
257 }
258 left = 0;
259 }
260 else if (left != 0)
261 {
262 left = 0;
263 }
264 }
265 }
266 }
267 return bResult;
268}

References mClickWidth, mThresholdLevel, and sep.

Referenced by ProcessOne().

Here is the caller graph for this function:

Member Data Documentation

◆ mbDidSomething

bool ClickRemovalBase::mbDidSomething
protected

Definition at line 55 of file ClickRemovalBase.h.

Referenced by Process(), and ProcessOne().

◆ mClickWidth

int ClickRemovalBase::mClickWidth
protected

Definition at line 58 of file ClickRemovalBase.h.

Referenced by CheckWhetherSkipEffect(), and RemoveClicks().

◆ mEnvelope

Envelope* ClickRemovalBase::mEnvelope
protected

Definition at line 53 of file ClickRemovalBase.h.

◆ mThresholdLevel

int ClickRemovalBase::mThresholdLevel
protected

Definition at line 57 of file ClickRemovalBase.h.

Referenced by CheckWhetherSkipEffect(), and RemoveClicks().

◆ sep

int ClickRemovalBase::sep
protected

Definition at line 59 of file ClickRemovalBase.h.

Referenced by ClickRemovalBase(), and RemoveClicks().

◆ Symbol

const ComponentInterfaceSymbol ClickRemovalBase::Symbol { XO("Click Removal") }
static

Definition at line 26 of file ClickRemovalBase.h.

Referenced by GetSymbol().

◆ Threshold

constexpr EffectParameter ClickRemovalBase::Threshold
staticconstexprprotected
Initial value:
{
&ClickRemovalBase::mThresholdLevel, L"Threshold", 200, 0, 900, 1
}

Definition at line 63 of file ClickRemovalBase.h.

◆ Width

constexpr EffectParameter ClickRemovalBase::Width
staticconstexprprotected
Initial value:
{
&ClickRemovalBase::mClickWidth, L"Width", 20, 0, 40, 1
}

Definition at line 66 of file ClickRemovalBase.h.

◆ windowSize

size_t ClickRemovalBase::windowSize
protected

Definition at line 56 of file ClickRemovalBase.h.

Referenced by ClickRemovalBase(), and ProcessOne().


The documentation for this class was generated from the following files: