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
15#include "PerTrackEffect.h"
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 // Effect implementation
53 std::unique_ptr<EffectUIValidator> PopulateOrExchange(
54 ShuttleGui & S, EffectInstance &instance,
55 EffectSettingsAccess &access, const EffectOutputs *pOutputs) override;
56
57 struct Validator;
58
59 struct Instance;
60
61 std::shared_ptr<EffectInstance> MakeInstance() const override;
62
63private:
64 // EffectEcho implementation
65
66
67 const EffectParameterMethods& Parameters() const override;
68
69#if 0
70 // TODO simplify like this in C++20
71 using ParametersType = CapturedParameters<EffectEcho,
73 &EffectEcho::delay, L"Delay", 1.0f, 0.001f, FLT_MAX, 1.0f }
75 &EffectEcho::decay, L"Decay", 0.5f, 0.0f, FLT_MAX, 1.0f }
76 >;
77#else
78
80 L"Delay", EffectEchoSettings::delayDefault, 0.001f, FLT_MAX, 1.0f };
82 L"Decay", EffectEchoSettings::decayDefault, 0.0f, FLT_MAX, 1.0f };
83
84#endif
85};
86
87#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
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Add controls to effect panel; always succeeds.
Definition: Echo.cpp:194
EffectEcho()
Definition: Echo.cpp:85
static const ComponentInterfaceSymbol Symbol
Definition: Echo.h:37
TranslatableString GetDescription() const override
Definition: Echo.cpp:101
ComponentInterfaceSymbol GetSymbol() const override
Definition: Echo.cpp:96
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
Definition: Echo.cpp:77
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Definition: Echo.cpp:106
static constexpr EffectParameter Decay
Definition: Echo.h:81
const EffectParameterMethods & Parameters() const override
Definition: Echo.cpp:30
EffectType GetType() const override
Type determines how it behaves.
Definition: Echo.cpp:113
static constexpr EffectParameter Delay
Definition: Echo.h:79
virtual ~EffectEcho()
Definition: Echo.cpp:90
Performs effect computation.
Hold values to send to effect output meters.
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