![]() |
Audacity 3.2.0
|
#include <LV2Validator.h>
Classes | |
struct | PlainUIControl |
struct | Timer |
This must be destroyed before mSuilInstance. More... | |
struct | UI |
Public Member Functions | |
LV2Validator (EffectBase &effect, const LilvPlugin &plug, LV2Instance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs, double sampleRate, const LV2FeaturesList &features, const LV2Ports &ports, wxWindow *parent, bool useGUI) | |
~LV2Validator () override | |
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... | |
bool | IsGraphicalUI () override |
void | Disconnect () override |
On the first call only, may disconnect from further event handling. More... | |
int | ui_resize (int width, int height) override |
void | ui_closed () override |
void | SizeRequest (GtkWidget *widget, GtkRequisition *requisition) |
bool | BuildFancy (std::unique_ptr< LV2Wrapper > pWrapper, const EffectSettings &settings) |
bool | BuildPlain (EffectSettingsAccess &access) |
void | suil_port_write (uint32_t port_index, uint32_t buffer_size, uint32_t protocol, const void *buffer) override |
uint32_t | suil_port_index (const char *port_symbol) override |
void | UpdateControlPortValue (LV2EffectSettings &settings, size_t controlPortIndex, float value) |
void | OnTrigger (wxCommandEvent &evt) |
void | OnToggle (wxCommandEvent &evt) |
void | OnChoice (wxCommandEvent &evt) |
void | OnText (wxCommandEvent &evt) |
void | OnSlider (wxCommandEvent &evt) |
void | OnIdle (wxIdleEvent &evt) |
void | OnSize (wxSizeEvent &evt) |
void | SetSlider (const LV2ControlPortState &state, const PlainUIControl &ctrl) |
![]() | |
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 () |
![]() | |
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 void | size_request (GtkWidget *widget, GtkRequisition *requisition, LV2Validator *pValidator) |
static std::shared_ptr< SuilHost > | GetSuilHost () |
![]() | |
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 LilvPlugin & | mPlug |
const EffectType | mType |
LV2Instance & | mInstance |
const EffectOutputs * | mpOutputs {} |
const double | mSampleRate |
const LV2Ports & | mPorts |
std::unique_ptr< LV2Wrapper > | mpWrapper |
std::optional< const LV2UIFeaturesList > | mUIFeatures |
LV2PortUIStates | mPortUIStates |
std::shared_ptr< SuilHost > | mSuilHost |
wxWindow * | mParent |
bool | mUseGUI {} |
std::vector< PlainUIControl > | mPlainUIControls |
Array in correspondence with the control ports. More... | |
struct LV2Validator::UI | mUI |
wxSize | mNativeWinInitialSize { wxDefaultSize } |
wxSize | mNativeWinLastSize { wxDefaultSize } |
bool | mResizing { false } |
bool | mResized { false } |
wxWeakRef< wxDialog > | mDialog |
bool | mExternalUIClosed { false } |
LV2Validator::Timer | mTimer |
const LV2UI_Idle_Interface * | mUIIdleInterface {} |
const LV2UI_Show_Interface * | mUIShowInterface {} |
NumericTextCtrl * | mDuration {} |
Additional Inherited Members | |
![]() | |
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 constexpr int | kPlayID = 20102 |
![]() | |
static constexpr bool | notifies_all |
![]() | |
template<typename EventTag , typename Class , typename Event > | |
void | BindTo (wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &)) |
![]() | |
CallbackReturn | Publish (const EffectSettingChanged &message) |
Send a message to connected callbacks. More... | |
![]() | |
EffectUIClientInterface & | mEffect |
EffectSettingsAccess & | mAccess |
bool | mUIClosed { false } |
![]() | |
virtual | ~UIHandler () |
virtual int | ui_resize (int width, int height)=0 |
virtual void | ui_closed ()=0 |
virtual void | suil_port_write (uint32_t port_index, uint32_t buffer_size, uint32_t protocol, const void *buffer)=0 |
virtual uint32_t | suil_port_index (const char *port_symbol)=0 |
Definition at line 50 of file LV2Validator.h.
LV2Validator::LV2Validator | ( | EffectBase & | effect, |
const LilvPlugin & | plug, | ||
LV2Instance & | instance, | ||
EffectSettingsAccess & | access, | ||
const EffectOutputs * | pOutputs, | ||
double | sampleRate, | ||
const LV2FeaturesList & | features, | ||
const LV2Ports & | ports, | ||
wxWindow * | parent, | ||
bool | useGUI | ||
) |
Definition at line 102 of file LV2Validator.cpp.
References mParent.
|
override |
Definition at line 181 of file LV2Validator.cpp.
References Disconnect().
bool LV2Validator::BuildFancy | ( | std::unique_ptr< LV2Wrapper > | pWrapper, |
const EffectSettings & | settings | ||
) |
pWrapper != nullptr
Definition at line 202 of file LV2Validator.cpp.
References GetSuilHost(), LV2Symbols::gWorld, cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, LV2_EXTERNAL_UI__Widget, LV2_EXTERNAL_UI_SHOW, LV2Validator::Timer::mExternalWidget, LV2Validator::UI::mNativeWin, mNativeWinInitialSize, mNativeWinLastSize, mParent, mPlug, mpWrapper, mSuilHost, LV2Validator::UI::mSuilInstance, mTimer, mUI, mUIFeatures, mUIIdleInterface, mUIShowInterface, OnSize(), safenew, and size_request().
bool LV2Validator::BuildPlain | ( | EffectSettingsAccess & | access | ) |
Captures a const reference to value!
Function to revisit the controls just added above
Definition at line 388 of file LV2Validator.cpp.
References _, NumericTextCtrl::Options::AutoPos(), EffectTypeGenerate, EffectSettingsAccess::Get(), GetSettings(), ID_Choices, ID_Duration, ID_Sliders, ID_Texts, ID_Toggles, ID_Triggers, label, lrintf, LV2Ports::mControlPorts, mDuration, LV2Ports::mGroupMap, LV2Ports::mGroups, min(), mParent, mPlainUIControls, mPorts, mPortUIStates, mpOutputs, mSampleRate, mType, safenew, NumericTextCtrl::SetName(), settings(), str, NumericConverter::TIME, Internat::ToDisplayString(), TranslatableString::Translation(), TranslationLess(), values, LV2EffectSettings::values, LV2EffectOutputs::values, wxT(), and XO().
|
overridevirtual |
On the first call only, may disconnect from further event handling.
Default implemantation does nothing
Reimplemented from EffectUIValidator.
Definition at line 158 of file LV2Validator.cpp.
References LV2Validator::UI::Destroy(), LV2Ports::mControlPorts, mParent, mPlainUIControls, mPorts, mpOutputs, and mUI.
Referenced by ~LV2Validator().
|
static |
Definition at line 186 of file LV2Validator.cpp.
References LV2UIFeaturesList::suil_port_index(), and LV2UIFeaturesList::suil_port_write().
Referenced by BuildFancy().
|
overridevirtual |
Default implementation returns false
Reimplemented from EffectUIValidator.
Definition at line 143 of file LV2Validator.cpp.
void LV2Validator::OnChoice | ( | wxCommandEvent & | evt | ) |
Definition at line 760 of file LV2Validator.cpp.
References GetSettings(), ID_Choices, EffectUIValidator::mAccess, LV2Ports::mControlPorts, EffectSettingsAccess::ModifySettings(), mPorts, settings(), and UpdateControlPortValue().
void LV2Validator::OnIdle | ( | wxIdleEvent & | evt | ) |
Definition at line 817 of file LV2Validator.cpp.
References EffectSettingsAccess::Flush(), EffectSettingsAccess::Get(), GetSettings(), EffectUIValidator::mAccess, mDialog, mExternalUIClosed, mPortUIStates, mpOutputs, LV2Validator::UI::mSuilInstance, mUI, mUIIdleInterface, mUIShowInterface, size, values, and LV2EffectSettings::values.
void LV2Validator::OnSize | ( | wxSizeEvent & | evt | ) |
Definition at line 887 of file LV2Validator.cpp.
References mDialog, LV2Validator::UI::mNativeWin, mNativeWinLastSize, mParent, mResized, mResizing, mUI, and mUIFeatures.
Referenced by BuildFancy().
void LV2Validator::OnSlider | ( | wxCommandEvent & | evt | ) |
Definition at line 788 of file LV2Validator.cpp.
References GetSettings(), ID_Sliders, EffectUIValidator::mAccess, LV2PortUIStates::mControlPortStates, EffectSettingsAccess::ModifySettings(), mPlainUIControls, mPortUIStates, mSampleRate, settings(), and UpdateControlPortValue().
void LV2Validator::OnText | ( | wxCommandEvent & | evt | ) |
Definition at line 771 of file LV2Validator.cpp.
References GetSettings(), ID_Texts, EffectUIValidator::mAccess, LV2PortUIStates::mControlPortStates, EffectSettingsAccess::ModifySettings(), mPlainUIControls, mPortUIStates, mSampleRate, SetSlider(), settings(), and UpdateControlPortValue().
void LV2Validator::OnToggle | ( | wxCommandEvent & | evt | ) |
Definition at line 750 of file LV2Validator.cpp.
References GetSettings(), ID_Toggles, EffectUIValidator::mAccess, EffectSettingsAccess::ModifySettings(), settings(), and UpdateControlPortValue().
void LV2Validator::OnTrigger | ( | wxCommandEvent & | evt | ) |
Definition at line 740 of file LV2Validator.cpp.
References GetSettings(), ID_Triggers, EffectUIValidator::mAccess, LV2Ports::mControlPorts, EffectSettingsAccess::ModifySettings(), mPorts, settings(), and UpdateControlPortValue().
void LV2Validator::SetSlider | ( | const LV2ControlPortState & | state, |
const PlainUIControl & | ctrl | ||
) |
Definition at line 706 of file LV2Validator.cpp.
References lrintf, LV2ControlPortState::mHi, LV2ControlPortState::mLo, LV2ControlPortState::mpPort, LV2ControlPortState::mTmp, and LV2Validator::PlainUIControl::slider.
Referenced by OnText(), and UpdateUI().
|
static |
Definition at line 1013 of file LV2Validator.cpp.
References SizeRequest().
Referenced by BuildFancy().
void LV2Validator::SizeRequest | ( | GtkWidget * | widget, |
GtkRequisition * | requisition | ||
) |
Definition at line 1019 of file LV2Validator.cpp.
References LV2Validator::UI::mNativeWin, mNativeWinLastSize, mResized, mResizing, and mUI.
Referenced by size_request().
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 996 of file LV2Validator.cpp.
References mPlug.
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 967 of file LV2Validator.cpp.
References GetSettings(), EffectUIValidator::mAccess, LV2PortUIStates::mControlIn, LV2Ports::mControlPortMap, EffectSettingsAccess::ModifySettings(), mPorts, mPortUIStates, Observer::Publisher< EffectSettingChanged >::Publish(), settings(), and LV2EffectSettings::values.
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 961 of file LV2Validator.cpp.
References mExternalUIClosed.
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 947 of file LV2Validator.cpp.
References LV2Validator::UI::mNativeWin, mNativeWinInitialSize, and mUI.
void LV2Validator::UpdateControlPortValue | ( | LV2EffectSettings & | settings, |
size_t | controlPortIndex, | ||
float | value | ||
) |
Definition at line 720 of file LV2Validator.cpp.
References LV2Ports::mControlPorts, mPorts, Observer::Publisher< EffectSettingChanged >::Publish(), and settings().
Referenced by OnChoice(), OnSlider(), OnText(), OnToggle(), and OnTrigger().
|
overridevirtual |
Update appearance of the panel for changes in settings.
Default implementation does nothing, returns true
Reimplemented from EffectUIValidator.
Definition at line 639 of file LV2Validator.cpp.
References EffectSettingsAccess::Get(), LV2Instance::GetMaster(), GetSettings(), EffectUIValidator::mAccess, LV2Ports::mControlPorts, LV2PortUIStates::mControlPortStates, LV2Ports::mGroupMap, LV2Ports::mGroups, mInstance, mParent, mPlainUIControls, mPorts, mPortUIStates, mSampleRate, LV2Validator::UI::mSuilInstance, mUI, mUseGUI, params, SetSlider(), and values.
|
overridevirtual |
Get settings data from the panel; may make error dialogs and return false.
Implements EffectUIValidator.
Definition at line 148 of file LV2Validator.cpp.
References EffectTypeGenerate, NumericConverter::GetValue(), EffectUIValidator::mAccess, mDuration, EffectSettingsAccess::ModifySettings(), mType, and settings().
wxWeakRef<wxDialog> LV2Validator::mDialog |
Definition at line 149 of file LV2Validator.h.
NumericTextCtrl* LV2Validator::mDuration {} |
Definition at line 160 of file LV2Validator.h.
Referenced by BuildPlain(), and ValidateUI().
bool LV2Validator::mExternalUIClosed { false } |
Definition at line 150 of file LV2Validator.h.
Referenced by OnIdle(), and ui_closed().
LV2Instance& LV2Validator::mInstance |
Definition at line 103 of file LV2Validator.h.
Referenced by UpdateUI().
wxSize LV2Validator::mNativeWinInitialSize { wxDefaultSize } |
Definition at line 142 of file LV2Validator.h.
Referenced by BuildFancy(), and ui_resize().
wxSize LV2Validator::mNativeWinLastSize { wxDefaultSize } |
Definition at line 143 of file LV2Validator.h.
Referenced by BuildFancy(), OnSize(), and SizeRequest().
wxWindow* LV2Validator::mParent |
Definition at line 112 of file LV2Validator.h.
Referenced by BuildFancy(), BuildPlain(), Disconnect(), LV2Validator(), OnSize(), and UpdateUI().
std::vector<PlainUIControl> LV2Validator::mPlainUIControls |
Array in correspondence with the control ports.
Definition at line 128 of file LV2Validator.h.
Referenced by BuildPlain(), Disconnect(), OnSlider(), OnText(), and UpdateUI().
const LilvPlugin& LV2Validator::mPlug |
Definition at line 101 of file LV2Validator.h.
Referenced by BuildFancy(), and suil_port_index().
const LV2Ports& LV2Validator::mPorts |
Definition at line 106 of file LV2Validator.h.
Referenced by BuildPlain(), Disconnect(), OnChoice(), OnTrigger(), suil_port_write(), UpdateControlPortValue(), and UpdateUI().
LV2PortUIStates LV2Validator::mPortUIStates |
Definition at line 109 of file LV2Validator.h.
Referenced by BuildPlain(), OnIdle(), OnSlider(), OnText(), suil_port_write(), and UpdateUI().
const EffectOutputs* LV2Validator::mpOutputs {} |
Definition at line 104 of file LV2Validator.h.
Referenced by BuildPlain(), Disconnect(), and OnIdle().
std::unique_ptr<LV2Wrapper> LV2Validator::mpWrapper |
Definition at line 107 of file LV2Validator.h.
Referenced by BuildFancy().
bool LV2Validator::mResized { false } |
Definition at line 146 of file LV2Validator.h.
Referenced by OnSize(), and SizeRequest().
bool LV2Validator::mResizing { false } |
Definition at line 144 of file LV2Validator.h.
Referenced by OnSize(), and SizeRequest().
const double LV2Validator::mSampleRate |
Definition at line 105 of file LV2Validator.h.
Referenced by BuildPlain(), OnSlider(), OnText(), and UpdateUI().
std::shared_ptr<SuilHost> LV2Validator::mSuilHost |
Definition at line 111 of file LV2Validator.h.
Referenced by BuildFancy().
LV2Validator::Timer LV2Validator::mTimer |
Referenced by BuildFancy().
const EffectType LV2Validator::mType |
Definition at line 102 of file LV2Validator.h.
Referenced by BuildPlain(), and ValidateUI().
struct LV2Validator::UI LV2Validator::mUI |
Referenced by BuildFancy(), Disconnect(), OnIdle(), OnSize(), SizeRequest(), ui_resize(), and UpdateUI().
std::optional<const LV2UIFeaturesList> LV2Validator::mUIFeatures |
Definition at line 108 of file LV2Validator.h.
Referenced by BuildFancy(), and OnSize().
const LV2UI_Idle_Interface* LV2Validator::mUIIdleInterface {} |
Definition at line 158 of file LV2Validator.h.
Referenced by BuildFancy(), and OnIdle().
const LV2UI_Show_Interface* LV2Validator::mUIShowInterface {} |
Definition at line 159 of file LV2Validator.h.
Referenced by BuildFancy(), and OnIdle().
bool LV2Validator::mUseGUI {} |
Definition at line 113 of file LV2Validator.h.
Referenced by UpdateUI().