Audacity 3.2.0
Noise.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 Noise.h
6
7 Dominic Mazzoni
8
9 An effect to add white noise.
10
11**********************************************************************/
12
13#ifndef __AUDACITY_EFFECT_NOISE__
14#define __AUDACITY_EFFECT_NOISE__
15
17#include "../ShuttleAutomation.h"
18
19class NumericTextCtrl;
20class ShuttleGui;
21
23{
24public:
25 static inline EffectNoise *
28
30 virtual ~EffectNoise();
31
32 // ComponentInterface implementation
33
34 ComponentInterfaceSymbol GetSymbol() const override;
35 TranslatableString GetDescription() const override;
36 ManualPageID ManualPage() const override;
37
38 // EffectDefinitionInterface implementation
39
40 EffectType GetType() const override;
41
42 unsigned GetAudioOutCount() const override;
44 const float *const *inBlock, float *const *outBlock, size_t blockLen)
45 override;
46
47 // Effect implementation
48
49 std::unique_ptr<EffectUIValidator> PopulateOrExchange(
50 ShuttleGui & S, EffectInstance &instance, EffectSettingsAccess &access)
51 override;
52 bool TransferDataToWindow(const EffectSettings &settings) override;
54
55private:
56 // EffectNoise implementation
57
58 int mType;
59 double mAmp;
60
61 float y, z, buf0, buf1, buf2, buf3, buf4, buf5, buf6;
62
64
65 const EffectParameterMethods& Parameters() const override;
66
67 enum kTypes
68 {
72 nTypes
73 };
75
77 L"Type", kWhite, 0, nTypes - 1, 1, kTypeStrings, nTypes };
79 L"Amplitude", 0.8, 0.0, 1.0, 1 };
80};
81
82#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,...
Performs effect computation.
An effect to add white noise.
Definition: Noise.h:23
TranslatableString GetDescription() const override
Definition: Noise.cpp:82
static constexpr EffectParameter Amp
Definition: Noise.h:78
float buf3
Definition: Noise.h:61
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
Add controls to effect panel; always succeeds.
Definition: Noise.cpp:172
@ nTypes
Definition: Noise.h:72
@ kPink
Definition: Noise.h:70
@ kBrownian
Definition: Noise.h:71
@ kWhite
Definition: Noise.h:69
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
Definition: Noise.cpp:104
bool TransferDataFromWindow(EffectSettings &settings) override
Update the given settings from controls.
Definition: Noise.cpp:212
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Definition: Noise.cpp:87
static const EnumValueSymbol kTypeStrings[nTypes]
Definition: Noise.h:74
static constexpr EnumParameter Type
Definition: Noise.h:76
float y
Definition: Noise.h:61
float buf0
Definition: Noise.h:61
const EffectParameterMethods & Parameters() const override
Definition: Noise.cpp:44
float buf4
Definition: Noise.h:61
double mAmp
Definition: Noise.h:59
float buf2
Definition: Noise.h:61
NumericTextCtrl * mNoiseDurationT
Definition: Noise.h:63
float buf6
Definition: Noise.h:61
float buf5
Definition: Noise.h:61
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
Definition: Noise.cpp:99
ComponentInterfaceSymbol GetSymbol() const override
Definition: Noise.cpp:77
static const ComponentInterfaceSymbol Symbol
Definition: Noise.h:27
bool TransferDataToWindow(const EffectSettings &settings) override
Update controls for the settings.
Definition: Noise.cpp:205
float z
Definition: Noise.h:61
float buf1
Definition: Noise.h:61
static EffectNoise * FetchParameters(EffectNoise &e, EffectSettings &)
Definition: Noise.h:26
int mType
Definition: Noise.h:58
EffectType GetType() const override
Type determines how it behaves.
Definition: Noise.cpp:94
EffectNoise()
Definition: Noise.cpp:62
virtual ~EffectNoise()
Definition: Noise.cpp:71
Interface for manipulations of an Effect's settings.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
Base class for many of the effects in Audacity.
Holds a msgid for the translation catalog; may also bind format arguments.
Externalized state of a plug-in.