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 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

EffectEchoSettings mSettings
 

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

Detailed Description

Definition at line 172 of file Echo.cpp.

Constructor & Destructor Documentation

◆ Validator()

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

Definition at line 175 of file Echo.cpp.

177 : EffectUIValidator{ effect, access }
179 {}
static Settings & settings()
Definition: TrackInfo.cpp:87
Interface for transferring values from a panel of effect controls.
Definition: EffectPlugin.h:239
EffectEchoSettings mSettings
Definition: Echo.cpp:189

◆ ~Validator()

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

Member Function Documentation

◆ GetEffect()

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

Definition at line 182 of file Echo.cpp.

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

References EffectUIValidator::mEffect.

◆ PopulateOrExchange()

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

Definition at line 206 of file Echo.cpp.

207{
208 auto& echoSettings = mSettings;
209
210 S.AddSpace(0, 5);
211
212 S.StartMultiColumn(2, wxALIGN_CENTER);
213 {
214 S.Validator<FloatingPointValidator<double>>(
215 3, &echoSettings.delay, NumValidatorStyle::NO_TRAILING_ZEROES,
216 Delay.min, Delay.max )
217 .AddTextBox(XXO("&Delay time (seconds):"), L"", 10);
218
219 S.Validator<FloatingPointValidator<double>>(
220 3, &echoSettings.decay, NumValidatorStyle::NO_TRAILING_ZEROES,
222 .AddTextBox(XXO("D&ecay factor:"), L"", 10);
223 }
224 S.EndMultiColumn();
225}
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
static constexpr EffectParameter Decay
Definition: Echo.h:81
static constexpr EffectParameter Delay
Definition: Echo.h:79
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().

Here is the call graph for this function:

◆ 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 245 of file Echo.cpp.

246{
247 // get the settings from the MessageBuffer and write them to our local copy
248 const auto& settings = mAccess.Get();
249
251
252 return true;
253}
virtual const EffectSettings & Get()=0
EffectSettingsAccess & mAccess
Definition: EffectPlugin.h:297
static EffectEchoSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:326

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 228 of file Echo.cpp.

229{
231 (
232 [this](EffectSettings& settings)
233 {
234 // pass back the modified settings to the MessageBuffer
235
237 return nullptr;
238 }
239 );
240
241 return true;
242}
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 189 of file Echo.cpp.


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