Audacity 3.2.0
|
#include <LadspaEditor.h>
Public Member Functions | |
LadspaEditor (const EffectUIServices &effect, const LadspaInstance &instance, unsigned numInputControls, unsigned numOutputControls, EffectSettingsAccess &access, double sampleRate, EffectType type, const LadspaEffectOutputs *pOutputs) | |
bool | UpdateUI () override |
Update appearance of the panel for changes in settings. More... | |
bool | ValidateUI () override |
Get settings data from the panel; may make error dialogs and return false. More... | |
void | Disconnect () override |
On the first call only, may disconnect from further event handling. More... | |
void | PopulateUI (ShuttleGui &S) |
void | OnCheckBox (wxCommandEvent &evt) |
void | OnSlider (wxCommandEvent &evt) |
void | OnTextCtrl (wxCommandEvent &evt) |
void | RefreshControls () |
void | UpdateControl (int index, float value, float epsilon) |
void | UpdateControls (const LadspaEffectSettings &src) |
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... | |
Static Public Member Functions | |
static LadspaEffectSettings & | GetSettings (EffectSettings &settings) |
Assume settings originated from MakeSettings() and copies thereof. More... | |
static const LadspaEffectSettings & | GetSettings (const EffectSettings &settings) |
Assume settings originated from MakeSettings() and copies thereof. 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) |
Public Attributes | |
const LadspaInstance & | mInstance |
const unsigned | mNumInputControls |
const unsigned | mNumOutputControls |
const double | mSampleRate |
const EffectType | mType |
LadspaEffectSettings | mSettings |
const LadspaEffectOutputs *const | mpOutputs |
NumericTextCtrl * | mDuration {} |
wxWeakRef< wxDialog > | mDialog |
wxWindow * | mParent {} |
ArrayOf< wxSlider * > | mSliders |
ArrayOf< wxTextCtrl * > | mFields |
ArrayOf< wxStaticText * > | mLabels |
ArrayOf< wxCheckBox * > | mToggles |
std::vector< LadspaEffectMeter * > | mMeters |
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 Attributes inherited from EffectEditor | |
static constexpr int | kPlayID = 20102 |
Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged > | |
static constexpr bool | notifies_all |
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... | |
Protected Attributes inherited from EffectEditor | |
const EffectUIServices & | mUIServices |
EffectSettingsAccess & | mAccess |
bool | mUIClosed { false } |
Definition at line 29 of file LadspaEditor.h.
LadspaEditor::LadspaEditor | ( | const EffectUIServices & | effect, |
const LadspaInstance & | instance, | ||
unsigned | numInputControls, | ||
unsigned | numOutputControls, | ||
EffectSettingsAccess & | access, | ||
double | sampleRate, | ||
EffectType | type, | ||
const LadspaEffectOutputs * | pOutputs | ||
) |
Definition at line 428 of file LadspaEditor.cpp.
|
overridevirtual |
On the first call only, may disconnect from further event handling.
Default implemantation does nothing
Reimplemented from EffectEditor.
Definition at line 455 of file LadspaEditor.cpp.
References mMeters.
|
inlinestatic |
Assume settings originated from MakeSettings() and copies thereof.
Definition at line 39 of file LadspaEditor.h.
References GetSettings(), and settings().
|
inlinestatic |
Assume settings originated from MakeSettings() and copies thereof.
Definition at line 31 of file LadspaEditor.h.
References settings().
Referenced by GetSettings(), RefreshControls(), and ValidateUI().
void LadspaEditor::OnCheckBox | ( | wxCommandEvent & | evt | ) |
Definition at line 464 of file LadspaEditor.cpp.
References ID_Toggles, mToggles, UpdateControl(), and ValidateUI().
Referenced by PopulateUI().
void LadspaEditor::OnSlider | ( | wxCommandEvent & | evt | ) |
Definition at line 472 of file LadspaEditor.cpp.
References ControlValueTolerance, _LADSPA_PortRangeHint::HintDescriptor, ID_Sliders, LADSPA_IS_HINT_BOUNDED_ABOVE, LADSPA_IS_HINT_BOUNDED_BELOW, LADSPA_IS_HINT_INTEGER, LADSPA_IS_HINT_SAMPLE_RATE, _LADSPA_PortRangeHint::LowerBound, LadspaInstance::mData, mFields, mInstance, mSampleRate, mSliders, _LADSPA_Descriptor::PortRangeHints, str, Internat::ToDisplayString(), UpdateControl(), _LADSPA_PortRangeHint::UpperBound, ValidateUI(), and wxT().
Referenced by PopulateUI().
void LadspaEditor::OnTextCtrl | ( | wxCommandEvent & | evt | ) |
Definition at line 507 of file LadspaEditor.cpp.
References Internat::CompatibleToDouble(), ControlValueTolerance, _LADSPA_PortRangeHint::HintDescriptor, ID_Texts, LADSPA_IS_HINT_BOUNDED_ABOVE, LADSPA_IS_HINT_BOUNDED_BELOW, LADSPA_IS_HINT_SAMPLE_RATE, _LADSPA_PortRangeHint::LowerBound, LadspaInstance::mData, mFields, mInstance, mSampleRate, mSliders, _LADSPA_Descriptor::PortRangeHints, UpdateControl(), _LADSPA_PortRangeHint::UpperBound, and ValidateUI().
Referenced by PopulateUI().
void LadspaEditor::PopulateUI | ( | ShuttleGui & | S | ) |
Definition at line 156 of file LadspaEditor.cpp.
References _, NumericTextCtrl::Options::AutoPos(), EffectEditor::BindTo(), LadspaEffectSettings::controls, LadspaEffectOutputs::controls, EffectTypeGenerate, EffectSettings::extra, EffectSettingsAccess::Get(), _LADSPA_PortRangeHint::HintDescriptor, ID_Duration, ID_Sliders, ID_Texts, ID_Toggles, LADSPA_IS_HINT_BOUNDED_ABOVE, LADSPA_IS_HINT_BOUNDED_BELOW, LADSPA_IS_HINT_INTEGER, LADSPA_IS_HINT_SAMPLE_RATE, LADSPA_IS_HINT_TOGGLED, LADSPA_IS_PORT_AUDIO, LADSPA_IS_PORT_INPUT, LADSPA_IS_PORT_OUTPUT, LAT1CTOWX, _LADSPA_PortRangeHint::LowerBound, EffectEditor::mAccess, LadspaInstance::mData, mDuration, mFields, min(), mInstance, mLabels, mMeters, mNumInputControls, mNumOutputControls, mParent, mpOutputs, mSampleRate, mSettings, mSliders, mToggles, mType, NumericConverterType_TIME(), OnCheckBox(), OnSlider(), OnTextCtrl(), ArrayOf< X >::reinit(), S, safenew, FormatterContext::SampleRateContext(), NumericTextCtrl::SetName(), str, Internat::ToDisplayString(), _LADSPA_PortRangeHint::UpperBound, wxEVT_COMMAND_TEXT_UPDATED, wxT(), and XO().
void LadspaEditor::RefreshControls | ( | ) |
Definition at line 539 of file LadspaEditor.cpp.
References LadspaEffectSettings::controls, EffectSettingsAccess::Get(), GetSettings(), _LADSPA_PortRangeHint::HintDescriptor, LADSPA_IS_HINT_INTEGER, LADSPA_IS_HINT_SAMPLE_RATE, LADSPA_IS_HINT_TOGGLED, LADSPA_IS_PORT_CONTROL, LADSPA_IS_PORT_OUTPUT, EffectEditor::mAccess, LadspaInstance::mData, mFields, mInstance, mParent, mSettings, mToggles, _LADSPA_Descriptor::PortDescriptors, Internat::ToDisplayString(), UpdateControls(), and wxT().
Referenced by UpdateUI().
void LadspaEditor::UpdateControl | ( | int | index, |
float | value, | ||
float | epsilon | ||
) |
Definition at line 581 of file LadspaEditor.cpp.
References LadspaEffectSettings::controls, mSettings, and Observer::Publisher< EffectSettingChanged >::Publish().
Referenced by OnCheckBox(), OnSlider(), OnTextCtrl(), and UpdateControls().
void LadspaEditor::UpdateControls | ( | const LadspaEffectSettings & | src | ) |
Definition at line 594 of file LadspaEditor.cpp.
References LadspaEffectSettings::controls, ControlValueTolerance, _LADSPA_PortRangeHint::HintDescriptor, LADSPA_IS_HINT_INTEGER, LADSPA_IS_HINT_SAMPLE_RATE, LADSPA_IS_HINT_TOGGLED, LADSPA_IS_PORT_CONTROL, LADSPA_IS_PORT_OUTPUT, LadspaInstance::mData, mInstance, _LADSPA_Descriptor::PortDescriptors, _LADSPA_Descriptor::PortRangeHints, and UpdateControl().
Referenced by RefreshControls().
|
overridevirtual |
Update appearance of the panel for changes in settings.
Default implementation does nothing, returns true
Reimplemented from EffectEditor.
Definition at line 150 of file LadspaEditor.cpp.
References RefreshControls().
|
overridevirtual |
Get settings data from the panel; may make error dialogs and return false.
Implements EffectEditor.
Definition at line 444 of file LadspaEditor.cpp.
References EffectTypeGenerate, GetSettings(), NumericConverter::GetValue(), EffectEditor::mAccess, mDuration, EffectSettingsAccess::ModifySettings(), mSettings, mType, and settings().
Referenced by OnCheckBox(), OnSlider(), and OnTextCtrl().
wxWeakRef<wxDialog> LadspaEditor::mDialog |
Definition at line 74 of file LadspaEditor.h.
NumericTextCtrl* LadspaEditor::mDuration {} |
Definition at line 73 of file LadspaEditor.h.
Referenced by PopulateUI(), and ValidateUI().
ArrayOf<wxTextCtrl*> LadspaEditor::mFields |
Definition at line 77 of file LadspaEditor.h.
Referenced by OnSlider(), OnTextCtrl(), PopulateUI(), and RefreshControls().
const LadspaInstance& LadspaEditor::mInstance |
Definition at line 64 of file LadspaEditor.h.
Referenced by OnSlider(), OnTextCtrl(), PopulateUI(), RefreshControls(), and UpdateControls().
ArrayOf<wxStaticText*> LadspaEditor::mLabels |
Definition at line 78 of file LadspaEditor.h.
Referenced by PopulateUI().
std::vector<LadspaEffectMeter *> LadspaEditor::mMeters |
Definition at line 80 of file LadspaEditor.h.
Referenced by Disconnect(), and PopulateUI().
const unsigned LadspaEditor::mNumInputControls |
Definition at line 65 of file LadspaEditor.h.
Referenced by PopulateUI().
const unsigned LadspaEditor::mNumOutputControls |
Definition at line 66 of file LadspaEditor.h.
Referenced by PopulateUI().
wxWindow* LadspaEditor::mParent {} |
Definition at line 75 of file LadspaEditor.h.
Referenced by PopulateUI(), and RefreshControls().
const LadspaEffectOutputs* const LadspaEditor::mpOutputs |
Definition at line 71 of file LadspaEditor.h.
Referenced by PopulateUI().
const double LadspaEditor::mSampleRate |
Definition at line 68 of file LadspaEditor.h.
Referenced by OnSlider(), OnTextCtrl(), and PopulateUI().
LadspaEffectSettings LadspaEditor::mSettings |
Definition at line 70 of file LadspaEditor.h.
Referenced by PopulateUI(), RefreshControls(), UpdateControl(), and ValidateUI().
ArrayOf<wxSlider*> LadspaEditor::mSliders |
Definition at line 76 of file LadspaEditor.h.
Referenced by OnSlider(), OnTextCtrl(), and PopulateUI().
ArrayOf<wxCheckBox*> LadspaEditor::mToggles |
Definition at line 79 of file LadspaEditor.h.
Referenced by OnCheckBox(), PopulateUI(), and RefreshControls().
const EffectType LadspaEditor::mType |
Definition at line 69 of file LadspaEditor.h.
Referenced by PopulateUI(), and ValidateUI().