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

Public Member Functions

 Validator (EffectUIClientInterface &effect, EffectSettingsAccess &access, const EffectEchoSettings &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)
 
- Public Member Functions inherited from DefaultEffectUIValidator
 ~DefaultEffectUIValidator () override
 
bool ValidateUI () override
 Calls mEffect.ValidateUI() More...
 
 EffectUIValidator (EffectUIClientInterface &effect, EffectSettingsAccess &access)
 
- 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...
 

Public Attributes

EffectEchoSettings mSettings
 

Additional Inherited Members

- 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 Attributes inherited from EffectUIValidator
EffectUIClientInterfacemEffect
 
EffectSettingsAccessmAccess
 

Detailed Description

Definition at line 179 of file Echo.cpp.

Constructor & Destructor Documentation

◆ Validator()

EffectEcho::Validator::Validator ( EffectUIClientInterface effect,
EffectSettingsAccess access,
const EffectEchoSettings settings 
)
inline

Definition at line 182 of file Echo.cpp.

184 : DefaultEffectUIValidator{ effect, access }
186 {}
static Settings & settings()
Definition: TrackInfo.cpp:87
Default implementation of EffectUIValidator invokes ValidateUI method of an EffectUIClientInterface.
EffectEchoSettings mSettings
Definition: Echo.cpp:196

◆ ~Validator()

virtual EffectEcho::Validator::~Validator ( )
virtualdefault

Member Function Documentation

◆ GetEffect()

Effect & EffectEcho::Validator::GetEffect ( ) const
inline

Definition at line 189 of file Echo.cpp.

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

References EffectUIValidator::mEffect.

◆ PopulateOrExchange()

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

Definition at line 212 of file Echo.cpp.

213{
214 auto& echoSettings = mSettings;
215
216 S.AddSpace(0, 5);
217
218 S.StartMultiColumn(2, wxALIGN_CENTER);
219 {
220 S.Validator<FloatingPointValidator<double>>(
221 3, &echoSettings.delay, NumValidatorStyle::NO_TRAILING_ZEROES,
222 Delay.min, Delay.max )
223 .AddTextBox(XXO("&Delay time (seconds):"), L"", 10);
224
225 S.Validator<FloatingPointValidator<double>>(
226 3, &echoSettings.decay, NumValidatorStyle::NO_TRAILING_ZEROES,
228 .AddTextBox(XXO("D&ecay factor:"), L"", 10);
229 }
230 S.EndMultiColumn();
231}
#define XXO(s)
Definition: Internat.h:44
#define S(N)
Definition: ToChars.cpp:64
static constexpr EffectParameter Decay
Definition: Echo.h:84
static constexpr EffectParameter Delay
Definition: Echo.h:82
const Type min
Minimum value.
Definition: Shuttle.h:30
const Type max
Maximum value.
Definition: Shuttle.h:31

References EffectEcho::Decay, EffectEcho::Delay, EffectParameter< Structure, Member, Type, Value >::max, EffectParameter< Structure, Member, Type, Value >::min, S, and XXO.

◆ UpdateUI()

bool EffectEcho::Validator::UpdateUI ( )
overridevirtual

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

Returns
true if successful

Reimplemented from EffectUIValidator.

Definition at line 250 of file Echo.cpp.

251{
252 // get the settings from the MessageBuffer and write them to our local copy
253 const auto& settings = mAccess.Get();
254
256
257 return true;
258}
virtual const EffectSettings & Get()=0
EffectSettingsAccess & mAccess
static EffectEchoSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:415

References EffectWithSettings< EffectEchoSettings, PerTrackEffect >::GetSettings(), and settings().

Here is the call graph for this function:

◆ ValidateUI()

bool EffectEcho::Validator::ValidateUI ( )
overridevirtual

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

Returns
true only if panel settings are acceptable

Implements EffectUIValidator.

Definition at line 234 of file Echo.cpp.

235{
237 (
238 [this](EffectSettings& settings)
239 {
240 // pass back the modified settings to the MessageBuffer
241
243 }
244 );
245
246 return true;
247}
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
Externalized state of a plug-in.

References EffectWithSettings< EffectEchoSettings, PerTrackEffect >::GetSettings(), and settings().

Here is the call graph for this function:

Member Data Documentation

◆ mSettings

EffectEchoSettings EffectEcho::Validator::mSettings

Definition at line 196 of file Echo.cpp.


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