![]() |
Audacity 3.2.0
|
Manager of a handle to an LV2 plug-in instantiation. More...
#include <LV2Wrapper.h>
Classes | |
| struct | CreateToken |
| To compel use of the factory. More... | |
| struct | LV2Work |
Public Member Functions | |
| LV2Wrapper (CreateToken &&, LV2InstanceFeaturesList &baseFeatures, const LilvPlugin &plugin, float sampleRate) | |
| Constructor may spawn a thread. More... | |
| ~LV2Wrapper () | |
| If a thread was started, joins it. More... | |
| void | ConnectControlPorts (const LV2Ports &ports, const LV2EffectSettings &settings, EffectOutputs *pOutputs) |
| void | ConnectPorts (const LV2Ports &ports, LV2PortStates &portStates, const LV2EffectSettings &settings, EffectOutputs *pOutputs) |
| void | Activate () |
| void | Deactivate () |
| LilvInstance & | GetInstance () const |
| LV2_Handle | GetHandle () const |
| float | GetLatency () const |
| void | SetFreeWheeling (bool enable) |
| void | SendBlockSize () |
| void | ConsumeResponses () |
| LV2_Worker_Status | ScheduleWork (uint32_t size, const void *data) |
| LV2_Worker_Status | Respond (uint32_t size, const void *data) |
| LV2WrapperFeaturesList & | GetFeatures () |
| const LV2WrapperFeaturesList & | GetFeatures () const |
Static Public Member Functions | |
| static std::unique_ptr< LV2Wrapper > | Create (LV2InstanceFeaturesList &baseFeatures, const LV2Ports &ports, LV2PortStates &portStates, const LV2EffectSettings &settings, float sampleRate, EffectOutputs *pOutputs) |
| Factory. More... | |
| static LV2_Worker_Status | schedule_work (LV2_Worker_Schedule_Handle handle, uint32_t size, const void *data) |
| static LV2_Worker_Status | respond (LV2_Worker_Respond_Handle handle, uint32_t size, const void *data) |
Private Member Functions | |
| void | ThreadFunction () |
Private Attributes | |
| LV2_Worker_Schedule | mWorkerSchedule { this, LV2Wrapper::schedule_work } |
| LV2WrapperFeaturesList | mFeaturesList |
| const LilvInstancePtr | mInstance |
| const LV2_Handle | mHandle |
| const LV2_Options_Interface *const | mOptionsInterface |
| const LV2_State_Interface *const | mStateInterface |
| const LV2_Worker_Interface *const | mWorkerInterface |
| std::thread | mThread |
| wxMessageQueue< LV2Work > | mRequests |
| wxMessageQueue< LV2Work > | mResponses |
| float | mLatency { 0.0 } |
| bool | mFreeWheeling { false } |
| If true, do not spawn extra worker threads. More... | |
| bool | mStopWorker { false } |
| bool | mActivated { false } |
Manager of a handle to an LV2 plug-in instantiation.
Definition at line 44 of file LV2Wrapper.h.
| LV2Wrapper::LV2Wrapper | ( | CreateToken && | , |
| LV2InstanceFeaturesList & | baseFeatures, | ||
| const LilvPlugin & | plugin, | ||
| float | sampleRate | ||
| ) |
Constructor may spawn a thread.
Definition at line 124 of file LV2Wrapper.cpp.
References anonymous_namespace{ClipSegmentTest.cpp}::sampleRate.
| LV2Wrapper::~LV2Wrapper | ( | ) |
If a thread was started, joins it.
Definition at line 110 of file LV2Wrapper.cpp.
References Deactivate(), mInstance, mRequests, mStopWorker, and mThread.
| void LV2Wrapper::Activate | ( | ) |
Definition at line 161 of file LV2Wrapper.cpp.
References GetInstance(), and mActivated.
| void LV2Wrapper::ConnectControlPorts | ( | const LV2Ports & | ports, |
| const LV2EffectSettings & | settings, | ||
| EffectOutputs * | pOutputs | ||
| ) |
Definition at line 64 of file LV2Wrapper.cpp.
References GetInstance(), LV2Ports::mControlPorts, mLatency, LV2Ports::mLatencyPort, settings(), and values.
Referenced by ConnectPorts().
| void LV2Wrapper::ConnectPorts | ( | const LV2Ports & | ports, |
| LV2PortStates & | portStates, | ||
| const LV2EffectSettings & | settings, | ||
| EffectOutputs * | pOutputs | ||
| ) |
Definition at line 92 of file LV2Wrapper.cpp.
References ConnectControlPorts(), GetInstance(), LV2PortStates::mAtomPortStates, LV2PortStates::mCVPortStates, and settings().
| void LV2Wrapper::ConsumeResponses | ( | ) |
Definition at line 223 of file LV2Wrapper.cpp.
References mHandle, mResponses, and mWorkerInterface.
|
static |
Factory.
Definition at line 32 of file LV2Wrapper.cpp.
References LV2PortStates::mAtomPortStates, LV2FeaturesListBase::mPlug, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
Referenced by LV2Instance::MakeWrapper(), LV2Instance::RealtimeAddProcessor(), and anonymous_namespace{LoadLV2.cpp}::LV2PluginValidator::Validate().
| void LV2Wrapper::Deactivate | ( | ) |
Definition at line 169 of file LV2Wrapper.cpp.
References GetInstance(), and mActivated.
Referenced by ~LV2Wrapper().
|
inline |
Definition at line 92 of file LV2Wrapper.h.
|
inline |
Definition at line 93 of file LV2Wrapper.h.
| LV2_Handle LV2Wrapper::GetHandle | ( | ) | const |
| LilvInstance & LV2Wrapper::GetInstance | ( | ) | const |
Definition at line 177 of file LV2Wrapper.cpp.
References mInstance.
Referenced by Activate(), ConnectControlPorts(), ConnectPorts(), and Deactivate().
| float LV2Wrapper::GetLatency | ( | ) | const |
|
static |
Definition at line 260 of file LV2Wrapper.cpp.
References Respond(), and size.
Referenced by ScheduleWork(), and ThreadFunction().
| LV2_Worker_Status LV2Wrapper::Respond | ( | uint32_t | size, |
| const void * | data | ||
| ) |
Definition at line 266 of file LV2Wrapper.cpp.
References mResponses, and size.
Referenced by respond().
|
static |
Definition at line 238 of file LV2Wrapper.cpp.
References ScheduleWork(), and size.
| LV2_Worker_Status LV2Wrapper::ScheduleWork | ( | uint32_t | size, |
| const void * | data | ||
| ) |
Definition at line 244 of file LV2Wrapper.cpp.
References mFreeWheeling, mHandle, mRequests, mWorkerInterface, respond(), and size.
Referenced by schedule_work().
| void LV2Wrapper::SendBlockSize | ( | ) |
Definition at line 198 of file LV2Wrapper.cpp.
References LV2WrapperFeaturesList::Base(), mFeaturesList, mHandle, mOptionsInterface, and LV2InstanceFeaturesList::NominalBlockLengthOption().
| void LV2Wrapper::SetFreeWheeling | ( | bool | enable | ) |
Definition at line 193 of file LV2Wrapper.cpp.
References mFreeWheeling.
|
private |
Definition at line 212 of file LV2Wrapper.cpp.
References mHandle, mRequests, mStopWorker, mWorkerInterface, and respond().
|
private |
Definition at line 127 of file LV2Wrapper.h.
Referenced by Activate(), and Deactivate().
|
private |
Definition at line 101 of file LV2Wrapper.h.
Referenced by SendBlockSize().
|
private |
If true, do not spawn extra worker threads.
Definition at line 122 of file LV2Wrapper.h.
Referenced by ScheduleWork(), and SetFreeWheeling().
|
private |
Definition at line 105 of file LV2Wrapper.h.
Referenced by ConsumeResponses(), GetHandle(), ScheduleWork(), SendBlockSize(), and ThreadFunction().
|
private |
Definition at line 104 of file LV2Wrapper.h.
Referenced by GetInstance(), and ~LV2Wrapper().
|
private |
Definition at line 119 of file LV2Wrapper.h.
Referenced by ConnectControlPorts(), and GetLatency().
|
private |
Definition at line 110 of file LV2Wrapper.h.
Referenced by SendBlockSize().
|
private |
Definition at line 117 of file LV2Wrapper.h.
Referenced by ScheduleWork(), ThreadFunction(), and ~LV2Wrapper().
|
private |
Definition at line 118 of file LV2Wrapper.h.
Referenced by ConsumeResponses(), and Respond().
|
private |
Definition at line 112 of file LV2Wrapper.h.
|
private |
Written by main thread, read by worker, but atomic isn't needed because mRequests provides synchronization
Definition at line 126 of file LV2Wrapper.h.
Referenced by ThreadFunction(), and ~LV2Wrapper().
|
private |
Definition at line 116 of file LV2Wrapper.h.
Referenced by ~LV2Wrapper().
|
private |
Definition at line 114 of file LV2Wrapper.h.
Referenced by ConsumeResponses(), ScheduleWork(), and ThreadFunction().
|
private |
Definition at line 99 of file LV2Wrapper.h.