Audacity  3.0.3
Reverb.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4  Audacity(R) is copyright (c) 1999-2013 Audacity Team.
5  License: GPL v2. See License.txt.
6 
7  Reverb.h
8  Rob Sykes, Vaughan Johnson
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_EFFECT_REVERB__
13 #define __AUDACITY_EFFECT_REVERB__
14 
15 #include "Effect.h"
16 
17 class wxCheckBox;
18 class wxSlider;
19 class wxSpinCtrl;
20 class ShuttleGui;
21 
22 struct Reverb_priv_t;
23 
24 class EffectReverb final : public Effect
25 {
26 public:
28 
30  virtual ~EffectReverb();
31 
32  struct Params
33  {
34  double mRoomSize;
35  double mPreDelay;
36  double mReverberance;
37  double mHfDamping;
38  double mToneLow;
39  double mToneHigh;
40  double mWetGain;
41  double mDryGain;
42  double mStereoWidth;
43  bool mWetOnly;
44  };
45 
46  // ComponentInterface implementation
47 
50  ManualPageID ManualPage() override;
51 
52  // EffectDefinitionInterface implementation
53 
54  EffectType GetType() override;
55 
56  // EffectClientInterface implementation
57 
58  unsigned GetAudioInCount() override;
59  unsigned GetAudioOutCount() override;
60  bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL) override;
61  bool ProcessFinalize() override;
62  size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override;
63  bool DefineParams( ShuttleParams & S ) override;
64  bool GetAutomationParameters(CommandParameters & parms) override;
65  bool SetAutomationParameters(CommandParameters & parms) override;
67  bool LoadFactoryPreset(int id) override;
68 
69  // Effect implementation
70 
71  bool Startup() override;
72  void PopulateOrExchange(ShuttleGui & S) override;
73  bool TransferDataToWindow() override;
74  bool TransferDataFromWindow() override;
75 
76 private:
77  // EffectReverb implementation
78 
79  void SetTitle(const wxString & name = {});
80 
81 #define SpinSliderHandlers(n) \
82  void On ## n ## Slider(wxCommandEvent & evt); \
83  void On ## n ## Text(wxCommandEvent & evt);
84 
85  SpinSliderHandlers(RoomSize)
86  SpinSliderHandlers(PreDelay)
87  SpinSliderHandlers(Reverberance)
88  SpinSliderHandlers(HfDamping)
89  SpinSliderHandlers(ToneLow)
90  SpinSliderHandlers(ToneHigh)
91  SpinSliderHandlers(WetGain)
92  SpinSliderHandlers(DryGain)
93  SpinSliderHandlers(StereoWidth)
94 
95 #undef SpinSliderHandlers
96 
97 private:
98  unsigned mNumChans {};
100 
102 
104 
105 #define SpinSlider(n) \
106  wxSpinCtrl *m ## n ## T; \
107  wxSlider *m ## n ## S;
108 
109  SpinSlider(RoomSize)
110  SpinSlider(PreDelay)
111  SpinSlider(Reverberance)
112  SpinSlider(HfDamping)
113  SpinSlider(ToneLow)
114  SpinSlider(ToneHigh)
115  SpinSlider(WetGain)
116  SpinSlider(DryGain)
117  SpinSlider(StereoWidth)
118 
119 #undef SpinSlider
120 
121  wxCheckBox *mWetOnlyC;
122 
123  DECLARE_EVENT_TABLE()
124 };
125 
126 #endif
EffectReverb::Params::mDryGain
double mDryGain
Definition: Reverb.h:41
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectReverb::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: Reverb.cpp:281
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
EffectReverb::mP
SpinSliderHandlers(RoomSize) SpinSliderHandlers(PreDelay) SpinSliderHandlers(Reverberance) SpinSliderHandlers(HfDamping) SpinSliderHandlers(ToneLow) SpinSliderHandlers(ToneHigh) SpinSliderHandlers(WetGain) SpinSliderHandlers(DryGain) SpinSliderHandlers(StereoWidth) private Reverb_priv_t * mP
Definition: Reverb.h:85
EffectReverb::GetFactoryPresets
RegistryPaths GetFactoryPresets() override
Definition: Reverb.cpp:338
EffectReverb::Startup
bool Startup() override
Definition: Reverb.cpp:369
Effect.h
EffectReverb::Params::mPreDelay
double mPreDelay
Definition: Reverb.h:35
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:72
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
EffectReverb::EffectReverb
EffectReverb()
Reverb_priv_t
Definition: Reverb.cpp:83
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectReverb::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Reverb.cpp:142
EffectReverb::~EffectReverb
virtual ~EffectReverb()
Definition: Reverb.cpp:136
EffectReverb::GetAudioOutCount
unsigned GetAudioOutCount() override
Definition: Reverb.cpp:171
SpinSliderHandlers
#define SpinSliderHandlers(n)
Definition: Reverb.h:81
EffectReverb::mParams
Params mParams
Definition: Reverb.h:101
EffectReverb::Params::mHfDamping
double mHfDamping
Definition: Reverb.h:37
EffectReverb::ProcessBlock
size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override
Definition: Reverb.cpp:221
EffectReverb::Params::mStereoWidth
double mStereoWidth
Definition: Reverb.h:42
name
const TranslatableString name
Definition: Distortion.cpp:98
EffectReverb::TransferDataToWindow
bool TransferDataToWindow() override
Definition: Reverb.cpp:478
EffectReverb::LoadFactoryPreset
bool LoadFactoryPreset(int id) override
Definition: Reverb.cpp:350
EffectReverb::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Reverb.cpp:295
EffectReverb::Params
Definition: Reverb.h:33
EffectReverb::GetType
EffectType GetType() override
Definition: Reverb.cpp:159
EffectReverb::Params::mToneLow
double mToneLow
Definition: Reverb.h:38
ChannelNames
enum ChannelName * ChannelNames
EffectReverb::GetDescription
TranslatableString GetDescription() override
Definition: Reverb.cpp:147
EffectReverb::ManualPage
ManualPageID ManualPage() override
Definition: Reverb.cpp:152
EffectReverb::SpinSlider
SpinSlider(RoomSize) SpinSlider(PreDelay) SpinSlider(Reverberance) SpinSlider(HfDamping) SpinSlider(ToneLow) SpinSlider(ToneHigh) SpinSlider(WetGain) SpinSlider(DryGain) SpinSlider(StereoWidth) wxCheckBox *mWetOnlyC
EffectReverb::Params::mRoomSize
double mRoomSize
Definition: Reverb.h:34
EffectReverb
A reverberation effect.
Definition: Reverb.h:25
TaggedIdentifier< ManualPageIDTag >
EffectReverb::Params::mToneHigh
double mToneHigh
Definition: Reverb.h:39
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
EffectReverb::ProcessFinalize
bool ProcessFinalize() override
Definition: Reverb.cpp:209
EffectReverb::Params::mReverberance
double mReverberance
Definition: Reverb.h:36
EffectReverb::ProcessInitialize
bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap=NULL) override
Definition: Reverb.cpp:178
EffectReverb::Params::mWetGain
double mWetGain
Definition: Reverb.h:40
EffectReverb::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: Reverb.cpp:501
EffectReverb::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: Reverb.cpp:437
EffectType
EffectType
Definition: EffectInterface.h:55
EffectReverb::SetTitle
void SetTitle(const wxString &name={})
EffectReverb::Params::mWetOnly
bool mWetOnly
Definition: Reverb.h:43
EffectReverb::GetAudioInCount
unsigned GetAudioInCount() override
Definition: Reverb.cpp:166
EffectReverb::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Reverb.h:27
EffectReverb::mProcessingEvent
bool mProcessingEvent
Definition: Reverb.h:103
EffectReverb::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Reverb.cpp:311
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631