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

Public Member Functions

 Editor (const EffectUIServices &services, EffectSettingsAccess &access, const EffectReverbSettings &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

EffectReverbSettings 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
bool mUIClosed { false }

Detailed Description

Definition at line 94 of file Reverb.cpp.

Constructor & Destructor Documentation

◆ Editor()

EffectReverb::Editor::Editor ( const EffectUIServices services,
EffectSettingsAccess access,
const EffectReverbSettings settings 

Definition at line 97 of file Reverb.cpp.

99 : EffectEditor{ services, access }
101 {}
static Settings & settings()
Definition: TrackInfo.cpp:83
EffectReverbSettings mSettings
Definition: Reverb.cpp:109

◆ ~Editor()

virtual EffectReverb::Editor::~Editor ( )

Member Function Documentation

◆ PopulateOrExchange()

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

Definition at line 525 of file Reverb.cpp.

527 S.AddSpace(0, 5);
529 S.StartMultiColumn(3, wxEXPAND);
530 {
531 S.SetStretchyCol(2);
533#define SpinSlider(n, p) \
534 m ## n ## T = S.AddSpinCtrl( p, n.def, n.max, n.min); \
535 BindTo(*m ## n ## T, wxEVT_SPINCTRL, &Editor::On ## n ## Text);\
536 \
537 m ## n ## S = S.Style(wxSL_HORIZONTAL).AddSlider( {}, n.def, n.max, n.min); \
538 BindTo(*m ## n ## S, wxEVT_SLIDER, &Editor::On ## n ## Slider);
540 SpinSlider(RoomSize, XXO("&Room Size (%):"))
541 SpinSlider(PreDelay, XXO("&Pre-delay (ms):"))
542 SpinSlider(Reverberance, XXO("Rever&berance (%):"))
543 SpinSlider(HfDamping, XXO("Da&mping (%):"))
544 SpinSlider(ToneLow, XXO("Tone &Low (%):"))
545 SpinSlider(ToneHigh, XXO("Tone &High (%):"))
546 SpinSlider(WetGain, XXO("Wet &Gain (dB):"))
547 SpinSlider(DryGain, XXO("Dr&y Gain (dB):"))
548 SpinSlider(StereoWidth, XXO("Stereo Wid&th (%):"))
550#undef SpinSlider
552 }
553 S.EndMultiColumn();
555 S.StartHorizontalLay(wxCENTER, false);
556 {
557 mWetOnlyC =
558 S.AddCheckBox(XXO("Wet O&nly"), WetOnly.def);
559 BindTo(*mWetOnlyC, wxEVT_CHECKBOX, &Editor::OnCheckbox);
560 }
561 S.EndHorizontalLay();
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 ToneLow
Definition: Reverb.h:111
static constexpr EffectParameter PreDelay
Definition: Reverb.h:102
static constexpr EffectParameter RoomSize
Definition: Reverb.h:99
static constexpr EffectParameter StereoWidth
Definition: Reverb.h:123
static constexpr EffectParameter Reverberance
Definition: Reverb.h:105
static constexpr EffectParameter WetGain
Definition: Reverb.h:117
static constexpr EffectParameter HfDamping
Definition: Reverb.h:108
static constexpr EffectParameter ToneHigh
Definition: Reverb.h:114
static constexpr EffectParameter WetOnly
Definition: Reverb.h:126
static constexpr EffectParameter DryGain
Definition: Reverb.h:120
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, EffectReverb::DryGain, EffectReverb::HfDamping, EffectReverb::PreDelay, EffectReverb::Reverberance, EffectReverb::RoomSize, S, SpinSlider, EffectReverb::StereoWidth, EffectReverb::ToneHigh, EffectReverb::ToneLow, EffectReverb::WetGain, EffectReverb::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 ( )

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

true if successful

Reimplemented from EffectEditor.

Definition at line 565 of file Reverb.cpp.

567 // get the settings from the MessageBuffer and write them to our local copy
570 auto& rs = mSettings;
572#define SetSpinSlider(n) \
573 m ## n ## S->SetValue((int) rs.m ## n); \
574 m ## n ## T->SetValue(wxString::Format(wxT("%d"), (int) rs.m ## n));
586#undef SetSpinSlider
588 mWetOnlyC->SetValue((int) rs.mWetOnly);
590 return true;
#define SetSpinSlider(n)
EffectSettingsAccess & mAccess
Definition: EffectEditor.h:92
virtual const EffectSettings & Get()=0
static EffectReverbSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:169

References EffectReverb::DryGain, EffectWithSettings< EffectReverbSettings, StatelessPerTrackEffect >::GetSettings(), EffectReverb::HfDamping, EffectReverb::PreDelay, EffectReverb::Reverberance, EffectReverb::RoomSize, SetSpinSlider, EffectReverb::StereoWidth, EffectReverb::ToneHigh, EffectReverb::ToneLow, and EffectReverb::WetGain.

Here is the call graph for this function:

◆ ValidateUI()

bool EffectReverb::Editor::ValidateUI ( )

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

true only if panel settings are acceptable

Implements EffectEditor.

Definition at line 153 of file Reverb.cpp.

155 auto& rs = mSettings;
157 rs.mRoomSize = mRoomSizeS->GetValue();
158 rs.mPreDelay = mPreDelayS->GetValue();
159 rs.mReverberance = mReverberanceS->GetValue();
160 rs.mHfDamping = mHfDampingS->GetValue();
161 rs.mToneLow = mToneLowS->GetValue();
162 rs.mToneHigh = mToneHighS->GetValue();
163 rs.mWetGain = mWetGainS->GetValue();
164 rs.mDryGain = mDryGainS->GetValue();
165 rs.mStereoWidth = mStereoWidthS->GetValue();
166 rs.mWetOnly = mWetOnlyC->GetValue();
169 (
170 [this](EffectSettings& settings)
171 {
172 // pass back the modified settings to the MessageBuffer
175 return nullptr;
176 }
177 );
179 return true;
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
double mRoomSize
Definition: Reverb.h:34
Externalized state of a plug-in.

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

Here is the call graph for this function:

Member Data Documentation

◆ mProcessingEvent

bool EffectReverb::Editor::mProcessingEvent = false

Definition at line 111 of file Reverb.cpp.

◆ mSettings

EffectReverbSettings EffectReverb::Editor::mSettings

Definition at line 109 of file Reverb.cpp.

Referenced by ValidateUI().

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