Audacity 3.2.0
NoiseBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 NoiseBase.h
6
7 Dominic Mazzoni
8
9**********************************************************************/
10#pragma once
11
12#include "ShuttleAutomation.h"
14
15class BUILTIN_EFFECTS_API NoiseBase : public StatefulPerTrackEffect
16{
17public:
19 {
20 return &e;
21 }
23
24 NoiseBase();
25 virtual ~NoiseBase();
26
27 // ComponentInterface implementation
28
29 ComponentInterfaceSymbol GetSymbol() const override;
30 TranslatableString GetDescription() const override;
31 ManualPageID ManualPage() const override;
32
33 // EffectDefinitionInterface implementation
34
35 EffectType GetType() const override;
36
37 unsigned GetAudioOutCount() const override;
40 ChannelNames chanMap) override;
41 size_t ProcessBlock(
42 EffectSettings& settings, const float* const* inBlock,
43 float* const* outBlock, size_t blockLen) override;
44
45protected:
46 // NoiseBase implementation
47
48 double mSampleRate {};
49 int mType;
50 double mAmp;
51
52 float y, z, buf0, buf1, buf2, buf3, buf4, buf5, buf6;
53
54 const EffectParameterMethods& Parameters() const override;
55
56 enum kTypes
57 {
61 nTypes
62 };
63 static const EnumValueSymbol kTypeStrings[nTypes];
64
65 static constexpr EnumParameter Type {
66 &NoiseBase::mType, L"Type", kWhite, 0, nTypes - 1, 1, kTypeStrings, nTypes
67 };
68 static constexpr EffectParameter Amp {
69 &NoiseBase::mAmp, L"Amplitude", 0.8, 0.0, 1.0, 1
70 };
71};
EffectType
ChannelName
@ nTypes
static Settings & settings()
Definition: TrackInfo.cpp:51
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
ComponentInterfaceSymbol GetSymbol() const override
Definition: Effect.cpp:49
Interface for manipulations of an Effect's settings.
static NoiseBase * FetchParameters(NoiseBase &e, EffectSettings &)
Definition: NoiseBase.h:18
static const ComponentInterfaceSymbol Symbol
Definition: NoiseBase.h:22
int mType
Definition: NoiseBase.h:49
float buf0
Definition: NoiseBase.h:52
@ kBrownian
Definition: NoiseBase.h:60
double mAmp
Definition: NoiseBase.h:50
virtual unsigned GetAudioOutCount() const
How many output buffers to allocate at once.
Base class for many of the effects in Audacity.
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr) override
virtual size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen)=0
Called for destructive effect computation.
Holds a msgid for the translation catalog; may also bind format arguments.
Externalized state of a plug-in.