Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
EffectEditor Class Referenceabstract

#include <EffectEditor.h>

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

Public Member Functions

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

Static Public Member Functions

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

static constexpr int kPlayID = 20102
 
- Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged >
static constexpr bool notifies_all
 

Protected Member Functions

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

const EffectUIServicesmUIServices
 
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...
 

Detailed Description

Definition at line 31 of file EffectEditor.h.

Constructor & Destructor Documentation

◆ EffectEditor()

EffectEditor::EffectEditor ( const EffectUIServices services,
EffectSettingsAccess access 
)

Definition at line 19 of file EffectEditor.cpp.

21 : mUIServices{ services }
22 , mAccess{ access }
23{}
const EffectUIServices & mUIServices
Definition: EffectEditor.h:91
EffectSettingsAccess & mAccess
Definition: EffectEditor.h:92

◆ ~EffectEditor()

EffectEditor::~EffectEditor ( )
virtualdefault

Member Function Documentation

◆ BindTo()

template<typename EventTag , typename Class , typename Event >
void EffectEditor::BindTo ( wxEvtHandler &  src,
const EventTag &  eventType,
void(Class::*)(Event &)  pmf 
)
inlineprotected

Definition at line 85 of file EffectEditor.h.

87 {
88 src.Bind(eventType, pmf, static_cast<Class *>(this));
89 }

Referenced by VSTEditor::BuildFancy(), VSTEditor::BuildPlain(), and LadspaEditor::PopulateUI().

Here is the caller graph for this function:

◆ Disconnect()

void EffectEditor::Disconnect ( )
virtual

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

Default implemantation does nothing

Reimplemented in anonymous_namespace{EqualizationUI.cpp}::EqualizationUIEditor, LadspaEditor, LV2Editor, and anonymous_namespace{StatefulEffectUIServices.cpp}::DefaultEffectEditor.

Definition at line 37 of file EffectEditor.cpp.

38{
39}

◆ EnableApply()

bool EffectEditor::EnableApply ( wxWindow *  parent,
bool  enable = true 
)
static

Enable or disable the Apply button of the dialog that contains parent.

Definition at line 50 of file EffectEditor.cpp.

51{
52 // May be called during initialization, so try to find the dialog
53 if (auto dlg = wxGetTopLevelParent(parent)) {
54 wxWindow *apply = dlg->FindWindow(wxID_APPLY);
55
56 // Don't allow focus to get trapped
57 if (!enable)
58 {
59 wxWindow *focus = dlg->FindFocus();
60 if (focus == apply)
61 {
62 dlg->FindWindow(wxID_CLOSE)->SetFocus();
63 }
64 }
65
66 if (apply)
67 apply->Enable(enable);
68 }
69
70 EnablePreview(parent, enable);
71
72 return enable;
73}
static bool EnablePreview(wxWindow *parent, bool enable=true)

References EnablePreview().

Referenced by EffectAmplify::CheckClip(), EffectRepeat::DisplayNewTime(), EffectBassTreble::Editor::EnableApplyFromTransferDataFromWindow(), EffectPhaser::Editor::EnableApplyFromTransferDataFromWindow(), EffectWahwah::Editor::EnableApplyFromTransferDataToWindow(), EffectBassTreble::Editor::EnableApplyFromValidate(), EffectPhaser::Editor::EnableApplyFromValidate(), EffectWahwah::Editor::EnableApplyFromValidate(), EffectAmplify::OnAmpText(), EffectTruncSilence::OnControlChange(), EffectToneGen::OnControlUpdate(), EffectScienFilter::OnCutoff(), EffectAmplify::OnPeakText(), EffectScienFilter::OnRipple(), EffectScienFilter::OnStopbandRipple(), EffectPaulstretch::OnText(), EffectTimeScale::OnText_PitchHalfStepsEnd(), EffectTimeScale::OnText_PitchHalfStepsStart(), EffectTimeScale::OnText_PitchPercentChangeEnd(), EffectTimeScale::OnText_PitchPercentChangeStart(), EffectTimeScale::OnText_RatePercentChangeEnd(), EffectTimeScale::OnText_RatePercentChangeStart(), EffectChangeSpeed::UpdateUI(), EffectLoudness::UpdateUI(), and EffectNormalize::UpdateUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnablePreview()

bool EffectEditor::EnablePreview ( wxWindow *  parent,
bool  enable = true 
)
static

Enable or disable the preview play button of the dialog that contains parent

Definition at line 75 of file EffectEditor.cpp.

76{
77 // May be called during initialization, so try to find the dialog
78 if (auto dlg = wxGetTopLevelParent(parent)) {
79 wxWindow *play = dlg->FindWindow(kPlayID);
80 if (play)
81 {
82 // Don't allow focus to get trapped
83 if (!enable)
84 {
85 wxWindow *focus = dlg->FindFocus();
86 if (focus == play)
87 {
88 dlg->FindWindow(wxID_CLOSE)->SetFocus();
89 }
90 }
91
92 play->Enable(enable);
93 }
94 }
95
96 return enable;
97}
static constexpr int kPlayID
Definition: EffectEditor.h:76

References kPlayID.

Referenced by EnableApply(), and NyquistEffect::TransferDataToWindow().

Here is the caller graph for this function:

◆ IsGraphicalUI()

bool EffectEditor::IsGraphicalUI ( )
virtual

Default implementation returns false

Returns
true if using a native plug-in UI, not widgets

Reimplemented in AudioUnitEditor, LV2Editor, VSTEditor, and VST3Editor.

Definition at line 32 of file EffectEditor.cpp.

33{
34 return false;
35}

Referenced by VST3Effect::ShowClientInterface().

Here is the caller graph for this function:

◆ OnClose()

void EffectEditor::OnClose ( )
virtual

Handle the UI OnClose event. Default implementation calls mUIServices.CloseUI()

Reimplemented in VSTEditor, and VST3Editor.

Definition at line 41 of file EffectEditor.cpp.

42{
43 if (!mUIClosed)
44 {
46 mUIClosed = true;
47 }
48}
virtual bool CloseUI() const =0

References EffectUIServices::CloseUI(), mUIClosed, and mUIServices.

Referenced by VST3Editor::OnClose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateUI()

bool EffectEditor::UpdateUI ( )
virtual

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

Returns
true if successful

Reimplemented in AudioUnitEditor, EffectBassTreble::Editor, EffectDistortion::Editor, EffectDtmf::Editor, EffectEcho::Editor, LadspaEditor, LV2Editor, EffectPhaser::Editor, EffectReverb::Editor, VSTEditor, VST3Editor, and EffectWahwah::Editor.

Definition at line 27 of file EffectEditor.cpp.

28{
29 return true;
30}

◆ ValidateUI()

virtual bool EffectEditor::ValidateUI ( )
pure virtual

Member Data Documentation

◆ kPlayID

constexpr int EffectEditor::kPlayID = 20102
staticconstexpr

Definition at line 76 of file EffectEditor.h.

Referenced by EnablePreview().

◆ mAccess

EffectSettingsAccess& EffectEditor::mAccess
protected

◆ mUIClosed

bool EffectEditor::mUIClosed { false }
protected

Definition at line 94 of file EffectEditor.h.

Referenced by OnClose().

◆ mUIServices

const EffectUIServices& EffectEditor::mUIServices
protected

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