Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
EffectReverb::Editor Struct Reference
Inheritance diagram for EffectReverb::Editor:
[legend]
Collaboration diagram for EffectReverb::Editor:
[legend]

Public Member Functions

 Editor (const EffectUIServices &services, EffectSettingsAccess &access, const ReverbSettings &settings)
 
virtual ~Editor ()=default
 
bool ValidateUI () override
 Get settings data from the panel; may make error dialogs and return false. More...
 
bool UpdateUI () override
 Update appearance of the panel for changes in settings. More...
 
void PopulateOrExchange (ShuttleGui &S)
 
 SpinSlider (RoomSize) SpinSlider(PreDelay) SpinSlider(Reverberance) SpinSlider(HfDamping) SpinSlider(ToneLow) SpinSlider(ToneHigh) SpinSlider(WetGain) SpinSlider(DryGain) SpinSlider(StereoWidth) wxCheckBox *mWetOnlyC
 
 SpinSliderHandlers (RoomSize) SpinSliderHandlers(PreDelay) SpinSliderHandlers(Reverberance) SpinSliderHandlers(HfDamping) SpinSliderHandlers(ToneLow) SpinSliderHandlers(ToneHigh) SpinSliderHandlers(WetGain) SpinSliderHandlers(DryGain) SpinSliderHandlers(StereoWidth) void OnCheckbox(wxCommandEvent &evt)
 
- Public Member Functions inherited from EffectEditor
 EffectEditor (const EffectUIServices &services, EffectSettingsAccess &access)
 
virtual ~EffectEditor ()
 
virtual bool ValidateUI ()=0
 Get settings data from the panel; may make error dialogs and return false. More...
 
virtual bool UpdateUI ()
 Update appearance of the panel for changes in settings. More...
 
virtual bool IsGraphicalUI ()
 
virtual void Disconnect ()
 On the first call only, may disconnect from further event handling. More...
 
virtual void OnClose ()
 
- Public Member Functions inherited from Observer::Publisher< EffectSettingChanged >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 
 Publisher (Publisher &&)=default
 
Publisheroperator= (Publisher &&)=default
 
Subscription Subscribe (Callback callback)
 Connect a callback to the Publisher; later-connected are called earlier. More...
 
Subscription Subscribe (Object &obj, Return(Object::*callback)(Args...))
 Overload of Subscribe takes an object and pointer-to-member-function. More...
 

Public Attributes

ReverbSettings mSettings
 
bool mProcessingEvent = false
 

Additional Inherited Members

- Public Types inherited from Observer::Publisher< EffectSettingChanged >
using message_type = EffectSettingChanged
 
using CallbackReturn = std::conditional_t< true, void, bool >
 
using Callback = std::function< CallbackReturn(const EffectSettingChanged &) >
 Type of functions that can be connected to the Publisher. More...
 
- Static Public Member Functions inherited from EffectEditor
static bool EnableApply (wxWindow *parent, bool enable=true)
 Enable or disable the Apply button of the dialog that contains parent. More...
 
static bool EnablePreview (wxWindow *parent, bool enable=true)
 
- Static Public Attributes inherited from EffectEditor
static constexpr int kPlayID = 20102
 
- Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged >
static constexpr bool notifies_all
 
- Protected Member Functions inherited from EffectEditor
template<typename EventTag , typename Class , typename Event >
void BindTo (wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
 
- Protected Member Functions inherited from Observer::Publisher< EffectSettingChanged >
CallbackReturn Publish (const EffectSettingChanged &message)
 Send a message to connected callbacks. More...
 
- Protected Attributes inherited from EffectEditor
const EffectUIServicesmUIServices
 
EffectSettingsAccessmAccess
 
bool mUIClosed { false }
 

Detailed Description

Definition at line 32 of file Reverb.cpp.

Constructor & Destructor Documentation

◆ Editor()

EffectReverb::Editor::Editor ( const EffectUIServices services,
EffectSettingsAccess access,
const ReverbSettings settings 
)
inline

Definition at line 35 of file Reverb.cpp.

37 : EffectEditor{ services, access }
39 {}
static Settings & settings()
Definition: TrackInfo.cpp:51
ReverbSettings mSettings
Definition: Reverb.cpp:47

◆ ~Editor()

virtual EffectReverb::Editor::~Editor ( )
virtualdefault

Member Function Documentation

◆ PopulateOrExchange()

void EffectReverb::Editor::PopulateOrExchange ( ShuttleGui S)

Definition at line 140 of file Reverb.cpp.

141{
142 S.AddSpace(0, 5);
143
144 S.StartMultiColumn(3, wxEXPAND);
145 {
146 S.SetStretchyCol(2);
147
148#define SpinSlider(n, p) \
149 m ## n ## T = S.AddSpinCtrl( p, n.def, n.max, n.min); \
150 BindTo(*m ## n ## T, wxEVT_SPINCTRL, &Editor::On ## n ## Text);\
151 \
152 m ## n ## S = S.Style(wxSL_HORIZONTAL).AddSlider( {}, n.def, n.max, n.min); \
153 BindTo(*m ## n ## S, wxEVT_SLIDER, &Editor::On ## n ## Slider);
154
155 SpinSlider(RoomSize, XXO("&Room Size (%):"))
156 SpinSlider(PreDelay, XXO("&Pre-delay (ms):"))
157 SpinSlider(Reverberance, XXO("Rever&berance (%):"))
158 SpinSlider(HfDamping, XXO("Da&mping (%):"))
159 SpinSlider(ToneLow, XXO("Tone &Low (%):"))
160 SpinSlider(ToneHigh, XXO("Tone &High (%):"))
161 SpinSlider(WetGain, XXO("Wet &Gain (dB):"))
162 SpinSlider(DryGain, XXO("Dr&y Gain (dB):"))
163 SpinSlider(StereoWidth, XXO("Stereo Wid&th (%):"))
164
165#undef SpinSlider
166
167 }
168 S.EndMultiColumn();
169
170 S.StartHorizontalLay(wxCENTER, false);
171 {
172 mWetOnlyC =
173 S.AddCheckBox(XXO("Wet O&nly"), WetOnly.def);
174 BindTo(*mWetOnlyC, wxEVT_CHECKBOX, &Editor::OnCheckbox);
175 }
176 S.EndHorizontalLay();
177
178}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
void BindTo(wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
Definition: EffectEditor.h:85
static constexpr EffectParameter WetOnly
Definition: ReverbBase.h:212
static constexpr EffectParameter StereoWidth
Definition: ReverbBase.h:203
static constexpr EffectParameter RoomSize
Definition: ReverbBase.h:143
static constexpr EffectParameter HfDamping
Definition: ReverbBase.h:166
static constexpr EffectParameter PreDelay
Definition: ReverbBase.h:150
static constexpr EffectParameter Reverberance
Definition: ReverbBase.h:157
static constexpr EffectParameter WetGain
Definition: ReverbBase.h:189
static constexpr EffectParameter DryGain
Definition: ReverbBase.h:196
static constexpr EffectParameter ToneHigh
Definition: ReverbBase.h:182
static constexpr EffectParameter ToneLow
Definition: ReverbBase.h:175
const Type def
Default value.
SpinSlider(RoomSize) SpinSlider(PreDelay) SpinSlider(Reverberance) SpinSlider(HfDamping) SpinSlider(ToneLow) SpinSlider(ToneHigh) SpinSlider(WetGain) SpinSlider(DryGain) SpinSlider(StereoWidth) wxCheckBox *mWetOnlyC

References EffectParameter< Structure, Member, Type, Value >::def, ReverbBase::DryGain, ReverbBase::HfDamping, ReverbBase::PreDelay, ReverbBase::Reverberance, ReverbBase::RoomSize, S, SpinSlider, ReverbBase::StereoWidth, ReverbBase::ToneHigh, ReverbBase::ToneLow, ReverbBase::WetGain, ReverbBase::WetOnly, and XXO().

Here is the call graph for this function:

◆ SpinSlider()

EffectReverb::Editor::SpinSlider ( RoomSize  )

◆ SpinSliderHandlers()

EffectReverb::Editor::SpinSliderHandlers ( RoomSize  ) &

◆ UpdateUI()

bool EffectReverb::Editor::UpdateUI ( )
overridevirtual

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

Returns
true if successful

Reimplemented from EffectEditor.

Definition at line 180 of file Reverb.cpp.

181{
182 // get the settings from the MessageBuffer and write them to our local copy
184
185 auto& rs = mSettings;
186
187#define SetSpinSlider(n) \
188 m ## n ## S->SetValue((int) rs.m ## n); \
189 m ## n ## T->SetValue(wxString::Format(wxT("%d"), (int) rs.m ## n));
190
200
201#undef SetSpinSlider
202
203 mWetOnlyC->SetValue((int) rs.mWetOnly);
204
205 return true;
206}
#define SetSpinSlider(n)
EffectSettingsAccess & mAccess
Definition: EffectEditor.h:92
virtual const EffectSettings & Get()=0
static ReverbSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:166

References ReverbBase::DryGain, EffectWithSettings< ReverbSettings, PerTrackEffect >::GetSettings(), ReverbBase::HfDamping, ReverbBase::PreDelay, ReverbBase::Reverberance, ReverbBase::RoomSize, SetSpinSlider, ReverbBase::StereoWidth, ReverbBase::ToneHigh, ReverbBase::ToneLow, and ReverbBase::WetGain.

Here is the call graph for this function:

◆ ValidateUI()

bool EffectReverb::Editor::ValidateUI ( )
overridevirtual

Get settings data from the panel; may make error dialogs and return false.

Returns
true only if panel settings are acceptable

Implements EffectEditor.

Definition at line 91 of file Reverb.cpp.

92{
93 auto& rs = mSettings;
94
95 rs.mRoomSize = mRoomSizeS->GetValue();
96 rs.mPreDelay = mPreDelayS->GetValue();
97 rs.mReverberance = mReverberanceS->GetValue();
98 rs.mHfDamping = mHfDampingS->GetValue();
99 rs.mToneLow = mToneLowS->GetValue();
100 rs.mToneHigh = mToneHighS->GetValue();
101 rs.mWetGain = mWetGainS->GetValue();
102 rs.mDryGain = mDryGainS->GetValue();
103 rs.mStereoWidth = mStereoWidthS->GetValue();
104 rs.mWetOnly = mWetOnlyC->GetValue();
105
107 (
108 [this](EffectSettings& settings)
109 {
110 // pass back the modified settings to the MessageBuffer
111
113 return nullptr;
114 }
115 );
116
117 return true;
118}
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
Externalized state of a plug-in.
double mRoomSize
Definition: ReverbBase.h:20

References EffectWithSettings< ReverbSettings, PerTrackEffect >::GetSettings(), EffectEditor::mAccess, EffectSettingsAccess::ModifySettings(), ReverbSettings::mRoomSize, mSettings, and settings().

Here is the call graph for this function:

Member Data Documentation

◆ mProcessingEvent

bool EffectReverb::Editor::mProcessingEvent = false

Definition at line 49 of file Reverb.cpp.

◆ mSettings

ReverbSettings EffectReverb::Editor::mSettings

Definition at line 47 of file Reverb.cpp.

Referenced by ValidateUI().


The documentation for this struct was generated from the following file: