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

Public Member Functions

 Validator (EffectUIClientInterface &effect, EffectSettingsAccess &access, const EffectReverbSettings &settings)
virtual ~Validator ()=default
EffectGetEffect () const
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 EffectUIValidator
 EffectUIValidator (EffectUIClientInterface &effect, EffectSettingsAccess &access)
virtual ~EffectUIValidator ()
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 EffectUIValidator
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 EffectUIValidator
static constexpr int kPlayID = 20102
- Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged >
static constexpr bool notifies_all
- Protected Member Functions inherited from EffectUIValidator
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 EffectUIValidator
bool mUIClosed { false }

Detailed Description

Definition at line 95 of file Reverb.cpp.

Constructor & Destructor Documentation

◆ Validator()

EffectReverb::Validator::Validator ( EffectUIClientInterface effect,
EffectSettingsAccess access,
const EffectReverbSettings settings 

Definition at line 98 of file Reverb.cpp.

100 : EffectUIValidator{ effect, access }
102 {}
static Settings & settings()
Definition: TrackInfo.cpp:87
Interface for transferring values from a panel of effect controls.
Definition: EffectPlugin.h:239
EffectReverbSettings mSettings
Definition: Reverb.cpp:112

◆ ~Validator()

virtual EffectReverb::Validator::~Validator ( )

Member Function Documentation

◆ GetEffect()

Effect & EffectReverb::Validator::GetEffect ( ) const

Definition at line 105 of file Reverb.cpp.

105{ return static_cast<Effect&>(mEffect); }
Base class for many of the effects in Audacity.
Definition: Effect.h:62
EffectUIClientInterface & mEffect
Definition: EffectPlugin.h:296

References EffectUIValidator::mEffect.

◆ PopulateOrExchange()

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

Definition at line 528 of file Reverb.cpp.

530 S.AddSpace(0, 5);
532 S.StartMultiColumn(3, wxEXPAND);
533 {
534 S.SetStretchyCol(2);
536#define SpinSlider(n, p) \
537 m ## n ## T = S.AddSpinCtrl( p, n.def, n.max, n.min); \
538 BindTo(*m ## n ## T, wxEVT_SPINCTRL, &Validator::On ## n ## Text);\
539 \
540 m ## n ## S = S.Style(wxSL_HORIZONTAL).AddSlider( {}, n.def, n.max, n.min); \
541 BindTo(*m ## n ## S, wxEVT_SLIDER, &Validator::On ## n ## Slider);
543 SpinSlider(RoomSize, XXO("&Room Size (%):"))
544 SpinSlider(PreDelay, XXO("&Pre-delay (ms):"))
545 SpinSlider(Reverberance, XXO("Rever&berance (%):"))
546 SpinSlider(HfDamping, XXO("Da&mping (%):"))
547 SpinSlider(ToneLow, XXO("Tone &Low (%):"))
548 SpinSlider(ToneHigh, XXO("Tone &High (%):"))
549 SpinSlider(WetGain, XXO("Wet &Gain (dB):"))
550 SpinSlider(DryGain, XXO("Dr&y Gain (dB):"))
551 SpinSlider(StereoWidth, XXO("Stereo Wid&th (%):"))
553#undef SpinSlider
555 }
556 S.EndMultiColumn();
558 S.StartHorizontalLay(wxCENTER, false);
559 {
560 mWetOnlyC =
561 S.AddCheckBox(XXO("Wet O&nly"), WetOnly.def);
562 BindTo(*mWetOnlyC, wxEVT_CHECKBOX, &Validator::OnCheckbox);
563 }
564 S.EndHorizontalLay();
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
static constexpr EffectParameter ToneLow
Definition: Reverb.h:108
static constexpr EffectParameter PreDelay
Definition: Reverb.h:99
static constexpr EffectParameter RoomSize
Definition: Reverb.h:96
static constexpr EffectParameter StereoWidth
Definition: Reverb.h:120
static constexpr EffectParameter Reverberance
Definition: Reverb.h:102
static constexpr EffectParameter WetGain
Definition: Reverb.h:114
static constexpr EffectParameter HfDamping
Definition: Reverb.h:105
static constexpr EffectParameter ToneHigh
Definition: Reverb.h:111
static constexpr EffectParameter WetOnly
Definition: Reverb.h:123
static constexpr EffectParameter DryGain
Definition: Reverb.h:117
void BindTo(wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
Definition: EffectPlugin.h:290
const Type def
Default value.
Definition: Shuttle.h:29
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::Validator::SpinSlider ( RoomSize  )

◆ SpinSliderHandlers()

EffectReverb::Validator::SpinSliderHandlers ( RoomSize  ) &

◆ UpdateUI()

bool EffectReverb::Validator::UpdateUI ( )

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

true if successful

Reimplemented from EffectUIValidator.

Definition at line 568 of file Reverb.cpp.

570 // get the settings from the MessageBuffer and write them to our local copy
573 auto& rs = mSettings;
575#define SetSpinSlider(n) \
576 m ## n ## S->SetValue((int) rs.m ## n); \
577 m ## n ## T->SetValue(wxString::Format(wxT("%d"), (int) rs.m ## n));
589#undef SetSpinSlider
591 mWetOnlyC->SetValue((int) rs.mWetOnly);
593 return true;
#define SetSpinSlider(n)
virtual const EffectSettings & Get()=0
EffectSettingsAccess & mAccess
Definition: EffectPlugin.h:297
static EffectReverbSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:262

References EffectReverb::DryGain, EffectWithSettings< EffectReverbSettings, PerTrackEffect >::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::Validator::ValidateUI ( )

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

true only if panel settings are acceptable

Implements EffectUIValidator.

Definition at line 156 of file Reverb.cpp.

158 auto& rs = mSettings;
160 rs.mRoomSize = mRoomSizeS->GetValue();
161 rs.mPreDelay = mPreDelayS->GetValue();
162 rs.mReverberance = mReverberanceS->GetValue();
163 rs.mHfDamping = mHfDampingS->GetValue();
164 rs.mToneLow = mToneLowS->GetValue();
165 rs.mToneHigh = mToneHighS->GetValue();
166 rs.mWetGain = mWetGainS->GetValue();
167 rs.mDryGain = mDryGainS->GetValue();
168 rs.mStereoWidth = mStereoWidthS->GetValue();
169 rs.mWetOnly = mWetOnlyC->GetValue();
172 (
173 [this](EffectSettings& settings)
174 {
175 // pass back the modified settings to the MessageBuffer
178 return nullptr;
179 }
180 );
182 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, PerTrackEffect >::GetSettings(), EffectUIValidator::mAccess, EffectSettingsAccess::ModifySettings(), EffectReverbSettings::mRoomSize, mSettings, and settings().

Here is the call graph for this function:

Member Data Documentation

◆ mProcessingEvent

bool EffectReverb::Validator::mProcessingEvent = false

Definition at line 114 of file Reverb.cpp.

◆ mSettings

EffectReverbSettings EffectReverb::Validator::mSettings

Definition at line 112 of file Reverb.cpp.

Referenced by ValidateUI().

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