Audacity 3.2.0
AutoDuckBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 AutoDuckBase.h
6
7 Markus Meyer
8
9**********************************************************************/
10#pragma once
11
12#include "SettingsVisitor.h"
13#include "StatefulEffect.h"
14#include <cfloat>
15
16class WaveChannel;
17
18class BUILTIN_EFFECTS_API AutoDuckBase : public StatefulEffect
19{
20public:
22 {
23 return &e;
24 }
26
28 virtual ~AutoDuckBase();
29
30 // ComponentInterface implementation
31
32 ComponentInterfaceSymbol GetSymbol() const override;
33 TranslatableString GetDescription() const override;
34 ManualPageID ManualPage() const override;
35
36 // EffectDefinitionInterface implementation
37
38 EffectType GetType() const override;
39
40 // Effect implementation
41
42 bool Init() override;
43 bool Process(EffectInstance& instance, EffectSettings& settings) override;
44
45private:
46 // AutoDuckBase implementation
47
48 bool ApplyDuckFade(int trackNum, WaveChannel& track, double t0, double t1);
49
50protected:
58
59 const WaveTrack* mControlTrack {};
60
61 const EffectParameterMethods& Parameters() const override;
62
63 static constexpr EffectParameter DuckAmountDb {
64 &AutoDuckBase::mDuckAmountDb, L"DuckAmountDb", -12.0, -24.0, 0.0, 1
65 };
66 static constexpr EffectParameter InnerFadeDownLen {
67 &AutoDuckBase::mInnerFadeDownLen, L"InnerFadeDownLen", 0.0, 0.0, 3.0, 1
68 };
69 static constexpr EffectParameter InnerFadeUpLen {
70 &AutoDuckBase::mInnerFadeUpLen, L"InnerFadeUpLen", 0.0, 0.0, 3.0, 1
71 };
72 static constexpr EffectParameter OuterFadeDownLen {
73 &AutoDuckBase::mOuterFadeDownLen, L"OuterFadeDownLen", 0.5, 0.0, 3.0, 1
74 };
75 static constexpr EffectParameter OuterFadeUpLen {
76 &AutoDuckBase::mOuterFadeUpLen, L"OuterFadeUpLen", 0.5, 0.0, 3.0, 1
77 };
78 static constexpr EffectParameter ThresholdDb {
79 &AutoDuckBase::mThresholdDb, L"ThresholdDb", -30.0, -100.0, 0.0, 1
80 };
81 static constexpr EffectParameter MaximumPause {
82 &AutoDuckBase::mMaximumPause, L"MaximumPause", 1.0, 0.0, DBL_MAX, 1
83 };
84};
EffectType
static Settings & settings()
Definition: TrackInfo.cpp:51
Implements the Auto Ducking effect.
Definition: AutoDuckBase.h:19
double mOuterFadeUpLen
Definition: AutoDuckBase.h:55
double mInnerFadeDownLen
Definition: AutoDuckBase.h:52
double mThresholdDb
Definition: AutoDuckBase.h:56
static const ComponentInterfaceSymbol Symbol
Definition: AutoDuckBase.h:25
static AutoDuckBase * FetchParameters(AutoDuckBase &e, EffectSettings &)
Definition: AutoDuckBase.h:21
double mMaximumPause
Definition: AutoDuckBase.h:57
double mOuterFadeDownLen
Definition: AutoDuckBase.h:54
double mDuckAmountDb
Definition: AutoDuckBase.h:51
double mInnerFadeUpLen
Definition: AutoDuckBase.h:53
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
Performs effect computation.
Interface for manipulations of an Effect's settings.
virtual bool Process(EffectInstance &instance, EffectSettings &settings)=0
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
Externalized state of a plug-in.