Audacity 3.2.0
Public Member Functions | Protected Attributes | List of all members
DefaultEffectUIValidator Class Reference

#include <Effect.h>

Inheritance diagram for DefaultEffectUIValidator:
[legend]
Collaboration diagram for DefaultEffectUIValidator:
[legend]

Public Member Functions

 DefaultEffectUIValidator (EffectUIClientInterface &effect, EffectSettingsAccess &access, wxWindow *pParent=nullptr)
 
 ~DefaultEffectUIValidator () override
 Calls Disconnect. More...
 
bool ValidateUI () override
 Calls mEffect.ValidateUI() More...
 
bool IsGraphicalUI () override
 
void Disconnect () override
 On the first call only, may disconnect from further event handling. More...
 
- 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...
 

Protected Attributes

wxWindow * mpParent {}
 
- Protected Attributes inherited from EffectUIValidator
EffectUIClientInterfacemEffect
 
EffectSettingsAccessmAccess
 
bool mUIClosed { 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...
 

Detailed Description

Default implementation of EffectUIValidator invokes ValidateUI and IsGraphicalUI methods of an EffectUIClientInterface

Definition at line 36 of file Effect.h.

Constructor & Destructor Documentation

◆ DefaultEffectUIValidator()

DefaultEffectUIValidator::DefaultEffectUIValidator ( EffectUIClientInterface effect,
EffectSettingsAccess access,
wxWindow *  pParent = nullptr 
)
Parameters
pParentif not null, caller will push an event handler onto this window; then this object is responsible to pop it

Definition at line 820 of file Effect.cpp.

823 : EffectUIValidator{ effect, access }, mpParent{ pParent }
824{
825}
wxWindow * mpParent
Definition: Effect.h:57
Interface for transferring values from a panel of effect controls.
Definition: EffectPlugin.h:239

◆ ~DefaultEffectUIValidator()

DefaultEffectUIValidator::~DefaultEffectUIValidator ( )
override

Calls Disconnect.

Definition at line 827 of file Effect.cpp.

828{
829 Disconnect();
830}
void Disconnect() override
On the first call only, may disconnect from further event handling.
Definition: Effect.cpp:847

References Disconnect().

Here is the call graph for this function:

Member Function Documentation

◆ Disconnect()

void DefaultEffectUIValidator::Disconnect ( )
overridevirtual

On the first call only, may disconnect from further event handling.

Default implemantation does nothing

Reimplemented from EffectUIValidator.

Definition at line 847 of file Effect.cpp.

848{
849 if (mpParent) {
850 mpParent->PopEventHandler();
851 mpParent = nullptr;
852 }
853}

References mpParent.

Referenced by ~DefaultEffectUIValidator().

Here is the caller graph for this function:

◆ IsGraphicalUI()

bool DefaultEffectUIValidator::IsGraphicalUI ( )
overridevirtual
Returns
mEffect.IsGraphicalUI()

Reimplemented from EffectUIValidator.

Definition at line 842 of file Effect.cpp.

843{
844 return mEffect.IsGraphicalUI();
845}
virtual bool IsGraphicalUI()=0
EffectUIClientInterface & mEffect
Definition: EffectPlugin.h:296

References EffectUIClientInterface::IsGraphicalUI(), and EffectUIValidator::mEffect.

Here is the call graph for this function:

◆ ValidateUI()

bool DefaultEffectUIValidator::ValidateUI ( )
overridevirtual

Calls mEffect.ValidateUI()

Implements EffectUIValidator.

Definition at line 832 of file Effect.cpp.

833{
834 bool result {};
836 result = mEffect.ValidateUI(settings);
837 return nullptr;
838 });
839 return result;
840}
static Settings & settings()
Definition: TrackInfo.cpp:87
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
virtual bool ValidateUI(EffectSettings &settings)=0
EffectSettingsAccess & mAccess
Definition: EffectPlugin.h:297
Externalized state of a plug-in.

References EffectUIValidator::mAccess, EffectUIValidator::mEffect, EffectSettingsAccess::ModifySettings(), settings(), and EffectUIClientInterface::ValidateUI().

Here is the call graph for this function:

Member Data Documentation

◆ mpParent

wxWindow* DefaultEffectUIValidator::mpParent {}
protected

Definition at line 57 of file Effect.h.

Referenced by Disconnect().


The documentation for this class was generated from the following files: