Audacity 3.2.0
Echo.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 Echo.h
6
7 Dominic Mazzoni
8 Vaughan Johnson (dialog)
9
10**********************************************************************/
11
12#ifndef __AUDACITY_EFFECT_ECHO__
13#define __AUDACITY_EFFECT_ECHO__
14
16#include "../ShuttleAutomation.h"
17#include <float.h> // for FLT_MAX
18
19class ShuttleGui;
20
22
23
25{
26 static constexpr double delayDefault = 1.0;
27 static constexpr double decayDefault = 0.5;
28
31};
32
33class EffectEcho final : public EffectWithSettings<EffectEchoSettings, PerTrackEffect>
34{
35public:
36
38
39 EffectEcho();
40 virtual ~EffectEcho();
41
42 // ComponentInterface implementation
43
44 ComponentInterfaceSymbol GetSymbol() const override;
45 TranslatableString GetDescription() const override;
46 ManualPageID ManualPage() const override;
47
48 // EffectDefinitionInterface implementation
49
50 EffectType GetType() const override;
51
52 unsigned GetAudioInCount() const override;
53 unsigned GetAudioOutCount() const override;
54
55 // Effect implementation
56 std::unique_ptr<EffectUIValidator> PopulateOrExchange(
57 ShuttleGui & S, EffectInstance &instance, EffectSettingsAccess &access)
58 override;
59
60 struct Validator;
61
62 struct Instance;
63
64 std::shared_ptr<EffectInstance> MakeInstance() const override;
65
66private:
67 // EffectEcho implementation
68
69
70 const EffectParameterMethods& Parameters() const override;
71
72#if 0
73 // TODO simplify like this in C++20
74 using ParametersType = CapturedParameters<EffectEcho,
76 &EffectEcho::delay, L"Delay", 1.0f, 0.001f, FLT_MAX, 1.0f }
78 &EffectEcho::decay, L"Decay", 0.5f, 0.0f, FLT_MAX, 1.0f }
79 >;
80#else
81
83 L"Delay", EffectEchoSettings::delayDefault, 0.001f, FLT_MAX, 1.0f };
85 L"Decay", EffectEchoSettings::decayDefault, 0.0f, FLT_MAX, 1.0f };
86
87#endif
88};
89
90#endif // __AUDACITY_EFFECT_ECHO__
EffectType
#define S(N)
Definition: ToChars.cpp:64
Generates EffectParameterMethods overrides from variadic template arguments.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
An Effect that causes an echo, variable delay and volume.
Definition: Echo.h:34
EffectEcho()
Definition: Echo.cpp:77
static const ComponentInterfaceSymbol Symbol
Definition: Echo.h:37
TranslatableString GetDescription() const override
Definition: Echo.cpp:93
ComponentInterfaceSymbol GetSymbol() const override
Definition: Echo.cpp:88
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
Definition: Echo.cpp:69
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Definition: Echo.cpp:98
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
Definition: Echo.cpp:115
static constexpr EffectParameter Decay
Definition: Echo.h:84
const EffectParameterMethods & Parameters() const override
Definition: Echo.cpp:32
EffectType GetType() const override
Type determines how it behaves.
Definition: Echo.cpp:105
static constexpr EffectParameter Delay
Definition: Echo.h:82
virtual ~EffectEcho()
Definition: Echo.cpp:82
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
Definition: Echo.cpp:110
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
Add controls to effect panel; always succeeds.
Definition: Echo.cpp:196
Performs effect computation.
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:628
Holds a msgid for the translation catalog; may also bind format arguments.
static constexpr double delayDefault
Definition: Echo.h:26
static constexpr double decayDefault
Definition: Echo.h:27
double decay
Definition: Echo.h:30
double delay
Definition: Echo.h:29