Audacity 3.2.0
|
#include <VSTEditor.h>
Public Member Functions | |
VSTEditor (VSTInstance &instance, EffectType type, bool gui, const EffectUIServices &services, EffectSettingsAccess &access, wxWindow *pParent, int numParams) | |
~VSTEditor () override | |
VSTInstance & | GetInstance () 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 | OnClose () override |
void | BuildPlain (EffectSettingsAccess &access, EffectType effectType, double projectRate) |
void | BuildFancy (EffectInstance &instance) |
void | OnTimer () |
void | RefreshParameters (int skip=-1) const |
void | Automate (int index, float value) override |
void | OnSlider (wxCommandEvent &evt) |
int | ShowDialog (bool nonModal) |
bool | IsGraphicalUI () override |
void | Flush () override |
Public Member Functions inherited from EffectEditor | |
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 | |
Publisher & | operator= (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... | |
virtual void | Idle () |
virtual void | NeedIdle () |
virtual void | SizeWindow (int w, int h) |
virtual void | Automate (int index, float value) |
virtual void | Flush () |
Public Attributes | |
std::unique_ptr< VSTTimer > | mTimer |
Protected Member Functions | |
void | SizeWindow (int w, int h) override |
Protected Member Functions inherited from EffectEditor | |
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... | |
Private Member Functions | |
void | NotifyParameterChanged (int index, float value) |
void | OnIdle (wxIdleEvent &evt) |
bool | FetchSettingsFromInstance (EffectSettings &settings) |
bool | StoreSettingsToInstance (const EffectSettings &settings) |
void | NeedEditIdle (bool state) |
void | NeedIdle () override |
void | Idle () override |
void | OnSizeWindow (wxCommandEvent &evt) |
Private Attributes | |
VSTInstance & | mInstance |
const EffectType | mType |
const bool | mGui |
int | mTimerGuard { 0 } |
bool | mWantsEditIdle { false } |
bool | mWantsIdle { false } |
std::vector< std::pair< int, double > > | mLastMovements {} |
ArrayOf< wxStaticText * > | mNames |
ArrayOf< wxSlider * > | mSliders |
ArrayOf< wxStaticText * > | mDisplays |
ArrayOf< wxStaticText * > | mLabels |
NumericTextCtrl * | mDuration |
wxWindow * | mParent |
wxWeakRef< wxDialog > | mDialog |
VSTControl * | mControl {} |
std::vector< wxString > | mParamNames |
int | mNumParams { 0 } |
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 EffectEditor | |
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 EffectEditor | |
static constexpr int | kPlayID = 20102 |
Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged > | |
static constexpr bool | notifies_all |
Protected Attributes inherited from EffectEditor | |
const EffectUIServices & | mUIServices |
EffectSettingsAccess & | mAccess |
bool | mUIClosed { false } |
Definition at line 31 of file VSTEditor.h.
VSTEditor::VSTEditor | ( | VSTInstance & | instance, |
EffectType | type, | ||
bool | gui, | ||
const EffectUIServices & | services, | ||
EffectSettingsAccess & | access, | ||
wxWindow * | pParent, | ||
int | numParams | ||
) |
Note the parameter names for later use
Definition at line 516 of file VSTEditor.cpp.
References VSTWrapper::ForEachParameter(), EffectSettingsAccess::Get(), GetInstance(), VSTWrapper::GetSettings(), EffectEditor::mAccess, VSTWrapper::MakeMessageFS(), mInstance, EffectSettingsAccess::ModifySettings(), mParamNames, mTimer, OnIdle(), MIR::anonymous_namespace{MirUtils.cpp}::pi, settings(), and StoreSettingsToInstance().
|
override |
Definition at line 510 of file VSTEditor.cpp.
References GetInstance(), and VSTInstance::SetOwningValidator().
|
overridevirtual |
Reimplemented from VSTUIWrapper.
Definition at line 559 of file VSTEditor.cpp.
References GetInstance(), EffectEditor::mAccess, mLastMovements, NotifyParameterChanged(), and EffectSettingsAccess::Set().
void VSTEditor::BuildFancy | ( | EffectInstance & | instance | ) |
Definition at line 242 of file VSTEditor.cpp.
References EffectEditor::BindTo(), mControl, mDialog, mParent, NeedEditIdle(), OnSize(), OnSizeWindow(), VSTInstance::PowerOn(), and safenew.
void VSTEditor::BuildPlain | ( | EffectSettingsAccess & | access, |
EffectType | effectType, | ||
double | projectRate | ||
) |
Definition at line 285 of file VSTEditor.cpp.
References _, NumericTextCtrl::Options::AutoPos(), EffectEditor::BindTo(), EffectTypeGenerate, effGetParamName, EffectSettings::extra, EffectSettingsAccess::Get(), GetInstance(), VSTWrapper::GetString(), ID_Duration, ID_Sliders, mDisplays, mDuration, mLabels, mNames, mNumParams, mParent, mSliders, NumericConverterType_TIME(), OnSlider(), RefreshParameters(), ArrayOf< X >::reinit(), safenew, FormatterContext::SampleRateContext(), NumericTextCtrl::SetName(), wxT(), and XO().
|
private |
Definition at line 567 of file VSTEditor.cpp.
References VSTWrapper::FetchSettings(), VSTWrapper::GetSettings(), mInstance, and settings().
Referenced by ValidateUI().
|
overridevirtual |
Reimplemented from VSTUIWrapper.
Definition at line 106 of file VSTEditor.cpp.
References EffectSettingsAccess::Flush(), and EffectEditor::mAccess.
VSTInstance & VSTEditor::GetInstance | ( | ) | const |
Definition at line 554 of file VSTEditor.cpp.
References mInstance.
Referenced by Automate(), BuildPlain(), NotifyParameterChanged(), OnClose(), OnIdle(), OnSlider(), OnTimer(), RefreshParameters(), ValidateUI(), VSTEditor(), and ~VSTEditor().
|
overrideprivatevirtual |
Reimplemented from VSTUIWrapper.
Definition at line 142 of file VSTEditor.cpp.
|
overridevirtual |
Default implementation returns false
Reimplemented from EffectEditor.
Definition at line 101 of file VSTEditor.cpp.
References mGui.
|
private |
Definition at line 147 of file VSTEditor.cpp.
References mTimer, and mWantsEditIdle.
Referenced by BuildFancy(), and OnClose().
|
overrideprivatevirtual |
Reimplemented from VSTUIWrapper.
Definition at line 136 of file VSTEditor.cpp.
References mTimer, and mWantsIdle.
|
private |
Definition at line 153 of file VSTEditor.cpp.
References VSTWrapper::ForEachParameter(), EffectSettingsAccess::Get(), GetInstance(), VSTWrapper::GetSettings(), EffectEditor::mAccess, MIR::anonymous_namespace{MirUtils.cpp}::pi, Observer::Publisher< EffectSettingChanged >::Publish(), and settings().
Referenced by Automate(), and OnSlider().
|
overridevirtual |
Handle the UI OnClose event. Default implementation calls mUIServices.CloseUI()
Reimplemented from EffectEditor.
Definition at line 592 of file VSTEditor.cpp.
References VSTControl::Close(), EffectSettingsAccess::Flush(), GetInstance(), EffectEditor::mAccess, mControl, mDialog, mDisplays, mLabels, mNames, mParent, mSliders, NeedEditIdle(), VSTInstance::SetOwningValidator(), and ValidateUI().
|
private |
Definition at line 177 of file VSTEditor.cpp.
References _, VSTInstance::DeferChunkApplication(), EffectSettingsAccess::Flush(), GetInstance(), EffectEditor::mAccess, mLastMovements, EffectSettingsAccess::ModifySettings(), mParamNames, RefreshParameters(), and settings().
Referenced by VSTEditor().
|
private |
Definition at line 468 of file VSTEditor.cpp.
References mControl, and mDialog.
Referenced by BuildFancy().
void VSTEditor::OnSlider | ( | wxCommandEvent & | evt | ) |
Definition at line 490 of file VSTEditor.cpp.
References GetInstance(), ID_Sliders, EffectEditor::mAccess, mLastMovements, NotifyParameterChanged(), and EffectSettingsAccess::Set().
Referenced by BuildPlain().
void VSTEditor::OnTimer | ( | ) |
Definition at line 111 of file VSTEditor.cpp.
References VSTWrapper::callDispatcher(), effEditIdle, effIdle, GetInstance(), mTimerGuard, mWantsEditIdle, and mWantsIdle.
Referenced by VSTTimer::Notify().
void VSTEditor::RefreshParameters | ( | int | skip = -1 | ) | const |
Definition at line 417 of file VSTEditor.cpp.
References effGetParamDisplay, effGetParamLabel, effGetParamName, GetInstance(), VSTWrapper::GetString(), mDisplays, mLabels, mNames, mNumParams, mSliders, name, and wxT().
Referenced by BuildPlain(), OnIdle(), and UpdateUI().
int VSTEditor::ShowDialog | ( | bool | nonModal | ) |
Definition at line 88 of file VSTEditor.cpp.
References mDialog.
Referenced by VSTEffect::ShowClientInterface().
|
overrideprotectedvirtual |
Reimplemented from VSTUIWrapper.
Definition at line 210 of file VSTEditor.cpp.
References mParent.
|
private |
Definition at line 572 of file VSTEditor.cpp.
References VSTWrapper::GetSettings(), mInstance, settings(), and VSTWrapper::StoreSettings().
Referenced by VSTEditor().
|
overridevirtual |
Update appearance of the panel for changes in settings.
Default implementation does nothing, returns true
Reimplemented from EffectEditor.
Definition at line 502 of file VSTEditor.cpp.
References RefreshParameters().
|
overridevirtual |
Get settings data from the panel; may make error dialogs and return false.
Implements EffectEditor.
Definition at line 577 of file VSTEditor.cpp.
References EffectTypeGenerate, FetchSettingsFromInstance(), GetInstance(), NumericConverter::GetValue(), EffectEditor::mAccess, VSTInstance::MakeMessage(), mDuration, EffectSettingsAccess::ModifySettings(), mType, and settings().
Referenced by OnClose().
|
private |
Definition at line 109 of file VSTEditor.h.
Referenced by BuildFancy(), OnClose(), and OnSizeWindow().
|
private |
Definition at line 107 of file VSTEditor.h.
Referenced by BuildFancy(), OnClose(), OnSizeWindow(), and ShowDialog().
|
private |
Definition at line 102 of file VSTEditor.h.
Referenced by BuildPlain(), OnClose(), and RefreshParameters().
|
private |
Definition at line 104 of file VSTEditor.h.
Referenced by BuildPlain(), and ValidateUI().
|
private |
Definition at line 82 of file VSTEditor.h.
Referenced by IsGraphicalUI().
|
private |
Definition at line 80 of file VSTEditor.h.
Referenced by FetchSettingsFromInstance(), GetInstance(), StoreSettingsToInstance(), and VSTEditor().
|
private |
Definition at line 103 of file VSTEditor.h.
Referenced by BuildPlain(), OnClose(), and RefreshParameters().
|
private |
Definition at line 98 of file VSTEditor.h.
Referenced by Automate(), OnIdle(), and OnSlider().
|
private |
Definition at line 100 of file VSTEditor.h.
Referenced by BuildPlain(), OnClose(), and RefreshParameters().
|
private |
Definition at line 114 of file VSTEditor.h.
Referenced by BuildPlain(), and RefreshParameters().
|
private |
Definition at line 112 of file VSTEditor.h.
Referenced by OnIdle(), and VSTEditor().
|
private |
Definition at line 106 of file VSTEditor.h.
Referenced by BuildFancy(), BuildPlain(), OnClose(), and SizeWindow().
|
private |
Definition at line 101 of file VSTEditor.h.
Referenced by BuildPlain(), OnClose(), and RefreshParameters().
std::unique_ptr<VSTTimer> VSTEditor::mTimer |
Definition at line 59 of file VSTEditor.h.
Referenced by NeedEditIdle(), NeedIdle(), and VSTEditor().
|
private |
Definition at line 92 of file VSTEditor.h.
Referenced by OnTimer().
|
private |
Definition at line 81 of file VSTEditor.h.
Referenced by ValidateUI().
|
private |
Definition at line 94 of file VSTEditor.h.
Referenced by NeedEditIdle(), and OnTimer().
|
private |
Definition at line 95 of file VSTEditor.h.
Referenced by NeedIdle(), and OnTimer().