Audacity 3.2.0
|
#include <LV2Editor.h>
Classes | |
struct | PlainUIControl |
struct | Timer |
This must be destroyed before mSuilInstance. More... | |
struct | UI |
Public Member Functions | |
LV2Editor (const StatelessEffectUIServices &effect, EffectType type, const LilvPlugin &plug, LV2Instance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs, double sampleRate, const LV2FeaturesList &features, const LV2Ports &ports, wxWindow *parent, bool useGUI) | |
~LV2Editor () 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) |
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 void | size_request (GtkWidget *widget, GtkRequisition *requisition, LV2Editor *pEditor) |
static std::shared_ptr< SuilHost > | GetSuilHost () |
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 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 LV2Editor::UI | mUI |
wxSize | mNativeWinInitialSize { wxDefaultSize } |
wxSize | mNativeWinLastSize { wxDefaultSize } |
bool | mResizing { false } |
bool | mResized { false } |
wxWeakRef< wxDialog > | mDialog |
bool | mExternalUIClosed { false } |
LV2Editor::Timer | mTimer |
const LV2UI_Idle_Interface * | mUIIdleInterface {} |
const LV2UI_Show_Interface * | mUIShowInterface {} |
NumericTextCtrl * | mDuration {} |
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 } |
Private Member Functions inherited from LV2UIFeaturesList::UIHandler | |
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 53 of file LV2Editor.h.
LV2Editor::LV2Editor | ( | const StatelessEffectUIServices & | effect, |
EffectType | type, | ||
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 103 of file LV2Editor.cpp.
References mParent.
|
override |
Definition at line 182 of file LV2Editor.cpp.
References Disconnect().
bool LV2Editor::BuildFancy | ( | std::unique_ptr< LV2Wrapper > | pWrapper, |
const EffectSettings & | settings | ||
) |
pWrapper != nullptr
Definition at line 203 of file LV2Editor.cpp.
References GetSuilHost(), LV2Symbols::gWorld, audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, LV2_EXTERNAL_UI__Widget, LV2_EXTERNAL_UI_SHOW, LV2Editor::Timer::mExternalWidget, LV2Editor::UI::mNativeWin, mNativeWinInitialSize, mNativeWinLastSize, mParent, mPlug, mpWrapper, mSuilHost, LV2Editor::UI::mSuilInstance, mTimer, mUI, mUIFeatures, mUIIdleInterface, mUIShowInterface, OnSize(), safenew, and size_request().
bool LV2Editor::BuildPlain | ( | EffectSettingsAccess & | access | ) |
Captures a const reference to value!
Function to revisit the controls just added above
Definition at line 389 of file LV2Editor.cpp.
References _, NumericTextCtrl::Options::AutoPos(), EffectTypeGenerate, EffectSettingsAccess::Get(), anonymous_namespace{DynamicRangeProcessorEditor.cpp}::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, NumericConverterType_TIME(), safenew, FormatterContext::SampleRateContext(), NumericTextCtrl::SetName(), settings(), str, anonymous_namespace{AudacityDontAskAgainMessageDialog.cpp}::style, Internat::ToDisplayString(), TranslatableString::Translation(), TranslationLess(), values, LV2EffectOutputs::values, wxT(), and XO().
|
overridevirtual |
On the first call only, may disconnect from further event handling.
Default implemantation does nothing
Reimplemented from EffectEditor.
Definition at line 159 of file LV2Editor.cpp.
References LV2Editor::UI::Destroy(), LV2Ports::mControlPorts, mParent, mPlainUIControls, mPorts, mpOutputs, and mUI.
Referenced by ~LV2Editor().
|
static |
Definition at line 187 of file LV2Editor.cpp.
References LV2UIFeaturesList::suil_port_index(), and LV2UIFeaturesList::suil_port_write().
Referenced by BuildFancy().
|
overridevirtual |
Default implementation returns false
Reimplemented from EffectEditor.
Definition at line 144 of file LV2Editor.cpp.
void LV2Editor::OnChoice | ( | wxCommandEvent & | evt | ) |
Definition at line 762 of file LV2Editor.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), ID_Choices, EffectEditor::mAccess, LV2Ports::mControlPorts, EffectSettingsAccess::ModifySettings(), mPorts, settings(), and UpdateControlPortValue().
void LV2Editor::OnIdle | ( | wxIdleEvent & | evt | ) |
Definition at line 819 of file LV2Editor.cpp.
References EffectSettingsAccess::Flush(), EffectSettingsAccess::Get(), anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), EffectEditor::mAccess, mDialog, mExternalUIClosed, mPortUIStates, mpOutputs, LV2Editor::UI::mSuilInstance, mUI, mUIIdleInterface, mUIShowInterface, size, and values.
void LV2Editor::OnSize | ( | wxSizeEvent & | evt | ) |
Definition at line 889 of file LV2Editor.cpp.
References mDialog, LV2Editor::UI::mNativeWin, mNativeWinLastSize, mParent, mResized, mResizing, mUI, and mUIFeatures.
Referenced by BuildFancy().
void LV2Editor::OnSlider | ( | wxCommandEvent & | evt | ) |
Definition at line 790 of file LV2Editor.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), ID_Sliders, EffectEditor::mAccess, LV2PortUIStates::mControlPortStates, EffectSettingsAccess::ModifySettings(), mPlainUIControls, mPortUIStates, mSampleRate, settings(), and UpdateControlPortValue().
void LV2Editor::OnText | ( | wxCommandEvent & | evt | ) |
Definition at line 773 of file LV2Editor.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), ID_Texts, EffectEditor::mAccess, LV2PortUIStates::mControlPortStates, EffectSettingsAccess::ModifySettings(), mPlainUIControls, mPortUIStates, mSampleRate, SetSlider(), settings(), and UpdateControlPortValue().
void LV2Editor::OnToggle | ( | wxCommandEvent & | evt | ) |
Definition at line 752 of file LV2Editor.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), ID_Toggles, EffectEditor::mAccess, EffectSettingsAccess::ModifySettings(), settings(), and UpdateControlPortValue().
void LV2Editor::OnTrigger | ( | wxCommandEvent & | evt | ) |
Definition at line 742 of file LV2Editor.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), ID_Triggers, EffectEditor::mAccess, LV2Ports::mControlPorts, EffectSettingsAccess::ModifySettings(), mPorts, settings(), and UpdateControlPortValue().
void LV2Editor::SetSlider | ( | const LV2ControlPortState & | state, |
const PlainUIControl & | ctrl | ||
) |
Definition at line 708 of file LV2Editor.cpp.
References lrintf, LV2ControlPortState::mHi, LV2ControlPortState::mLo, LV2ControlPortState::mpPort, LV2ControlPortState::mTmp, and LV2Editor::PlainUIControl::slider.
Referenced by OnText(), and UpdateUI().
|
static |
Definition at line 1015 of file LV2Editor.cpp.
References SizeRequest().
Referenced by BuildFancy().
void LV2Editor::SizeRequest | ( | GtkWidget * | widget, |
GtkRequisition * | requisition | ||
) |
Definition at line 1021 of file LV2Editor.cpp.
References LV2Editor::UI::mNativeWin, mNativeWinLastSize, mResized, mResizing, and mUI.
Referenced by size_request().
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 998 of file LV2Editor.cpp.
References mPlug.
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 969 of file LV2Editor.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), EffectEditor::mAccess, LV2PortUIStates::mControlIn, LV2Ports::mControlPortMap, EffectSettingsAccess::ModifySettings(), mPorts, mPortUIStates, Observer::Publisher< EffectSettingChanged >::Publish(), and settings().
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 963 of file LV2Editor.cpp.
References mExternalUIClosed.
|
overridevirtual |
Implements LV2UIFeaturesList::UIHandler.
Definition at line 949 of file LV2Editor.cpp.
References LV2Editor::UI::mNativeWin, mNativeWinInitialSize, and mUI.
void LV2Editor::UpdateControlPortValue | ( | LV2EffectSettings & | settings, |
size_t | controlPortIndex, | ||
float | value | ||
) |
Definition at line 722 of file LV2Editor.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 EffectEditor.
Definition at line 641 of file LV2Editor.cpp.
References EffectSettingsAccess::Get(), LV2Instance::GetMaster(), anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), EffectEditor::mAccess, LV2Ports::mControlPorts, LV2PortUIStates::mControlPortStates, LV2Ports::mGroupMap, LV2Ports::mGroups, mInstance, mParent, mPlainUIControls, mPorts, mPortUIStates, mSampleRate, LV2Editor::UI::mSuilInstance, mUI, mUseGUI, params, SetSlider(), and values.
|
overridevirtual |
Get settings data from the panel; may make error dialogs and return false.
Implements EffectEditor.
Definition at line 149 of file LV2Editor.cpp.
References EffectTypeGenerate, NumericConverter::GetValue(), EffectEditor::mAccess, mDuration, EffectSettingsAccess::ModifySettings(), mType, and settings().
wxWeakRef<wxDialog> LV2Editor::mDialog |
Definition at line 152 of file LV2Editor.h.
NumericTextCtrl* LV2Editor::mDuration {} |
Definition at line 163 of file LV2Editor.h.
Referenced by BuildPlain(), and ValidateUI().
bool LV2Editor::mExternalUIClosed { false } |
Definition at line 153 of file LV2Editor.h.
Referenced by OnIdle(), and ui_closed().
LV2Instance& LV2Editor::mInstance |
Definition at line 106 of file LV2Editor.h.
Referenced by UpdateUI().
wxSize LV2Editor::mNativeWinInitialSize { wxDefaultSize } |
Definition at line 145 of file LV2Editor.h.
Referenced by BuildFancy(), and ui_resize().
wxSize LV2Editor::mNativeWinLastSize { wxDefaultSize } |
Definition at line 146 of file LV2Editor.h.
Referenced by BuildFancy(), OnSize(), and SizeRequest().
wxWindow* LV2Editor::mParent |
Definition at line 115 of file LV2Editor.h.
Referenced by BuildFancy(), BuildPlain(), Disconnect(), LV2Editor(), OnSize(), and UpdateUI().
std::vector<PlainUIControl> LV2Editor::mPlainUIControls |
Array in correspondence with the control ports.
Definition at line 131 of file LV2Editor.h.
Referenced by BuildPlain(), Disconnect(), OnSlider(), OnText(), and UpdateUI().
const LilvPlugin& LV2Editor::mPlug |
Definition at line 104 of file LV2Editor.h.
Referenced by BuildFancy(), and suil_port_index().
const LV2Ports& LV2Editor::mPorts |
Definition at line 109 of file LV2Editor.h.
Referenced by BuildPlain(), Disconnect(), OnChoice(), OnTrigger(), suil_port_write(), UpdateControlPortValue(), and UpdateUI().
LV2PortUIStates LV2Editor::mPortUIStates |
Definition at line 112 of file LV2Editor.h.
Referenced by BuildPlain(), OnIdle(), OnSlider(), OnText(), suil_port_write(), and UpdateUI().
const EffectOutputs* LV2Editor::mpOutputs {} |
Definition at line 107 of file LV2Editor.h.
Referenced by BuildPlain(), Disconnect(), and OnIdle().
std::unique_ptr<LV2Wrapper> LV2Editor::mpWrapper |
Definition at line 110 of file LV2Editor.h.
Referenced by BuildFancy().
bool LV2Editor::mResized { false } |
Definition at line 149 of file LV2Editor.h.
Referenced by OnSize(), and SizeRequest().
bool LV2Editor::mResizing { false } |
Definition at line 147 of file LV2Editor.h.
Referenced by OnSize(), and SizeRequest().
const double LV2Editor::mSampleRate |
Definition at line 108 of file LV2Editor.h.
Referenced by BuildPlain(), OnSlider(), OnText(), and UpdateUI().
std::shared_ptr<SuilHost> LV2Editor::mSuilHost |
Definition at line 114 of file LV2Editor.h.
Referenced by BuildFancy().
LV2Editor::Timer LV2Editor::mTimer |
Referenced by BuildFancy().
const EffectType LV2Editor::mType |
Definition at line 105 of file LV2Editor.h.
Referenced by BuildPlain(), and ValidateUI().
struct LV2Editor::UI LV2Editor::mUI |
Referenced by BuildFancy(), Disconnect(), OnIdle(), OnSize(), SizeRequest(), ui_resize(), and UpdateUI().
std::optional<const LV2UIFeaturesList> LV2Editor::mUIFeatures |
Definition at line 111 of file LV2Editor.h.
Referenced by BuildFancy(), and OnSize().
const LV2UI_Idle_Interface* LV2Editor::mUIIdleInterface {} |
Definition at line 161 of file LV2Editor.h.
Referenced by BuildFancy(), and OnIdle().
const LV2UI_Show_Interface* LV2Editor::mUIShowInterface {} |
Definition at line 162 of file LV2Editor.h.
Referenced by BuildFancy(), and OnIdle().
bool LV2Editor::mUseGUI {} |
Definition at line 116 of file LV2Editor.h.
Referenced by UpdateUI().