Audacity 3.2.0
|
#include <LadspaInstance.h>
Public Member Functions | |
LadspaInstance (const PerTrackEffect &processor, const LADSPA_Descriptor *pData, const ArrayOf< unsigned long > &inputPorts, const ArrayOf< unsigned long > &outputPorts, unsigned audioIns, unsigned audioOuts, int latencyPort) | |
bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap) override |
bool | ProcessFinalize () noexcept override |
size_t | ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override |
Called for destructive effect computation. More... | |
SampleCount | GetLatency (const EffectSettings &settings, double sampleRate) const override |
bool | RealtimeInitialize (EffectSettings &settings, double sampleRate) override |
bool | RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) override |
bool | RealtimeSuspend () override |
bool | RealtimeResume () override |
bool | RealtimeProcessStart (MessagePackage &package) override |
settings are possibly changed, since last call, by an asynchronous dialog More... | |
size_t | RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples) override |
bool | RealtimeProcessEnd (EffectSettings &settings) noexcept override |
settings can be updated to let a dialog change appearance at idle More... | |
bool | RealtimeFinalize (EffectSettings &settings) noexcept override |
unsigned | GetAudioInCount () const override |
How many input buffers to allocate at once. More... | |
unsigned | GetAudioOutCount () const override |
How many output buffers to allocate at once. More... | |
LADSPA_Handle | InitInstance (float sampleRate, LadspaEffectSettings &settings, LadspaEffectOutputs *pOutputs) const |
void | FreeInstance (LADSPA_Handle handle) const |
Public Member Functions inherited from PerTrackEffect::Instance | |
Instance (const PerTrackEffect &processor) | |
~Instance () override | |
bool | Process (EffectSettings &settings) final |
Uses the other virtual functions of this class. More... | |
bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap) override |
bool | ProcessFinalize () noexcept override |
Public Member Functions inherited from EffectInstanceEx | |
virtual bool | Init () |
Call once to set up state for whole list of tracks to be processed. More... | |
virtual bool | Process (EffectSettings &settings)=0 |
Actually do the effect here. More... | |
~EffectInstanceEx () override | |
Public Member Functions inherited from EffectInstance | |
virtual | ~EffectInstance () |
virtual size_t | GetBlockSize () const =0 |
virtual size_t | SetBlockSize (size_t maxBlockSize)=0 |
virtual unsigned | GetAudioInCount () const =0 |
How many input buffers to allocate at once. More... | |
virtual unsigned | GetAudioOutCount () const =0 |
How many output buffers to allocate at once. More... | |
virtual bool | RealtimeInitialize (EffectSettings &settings, double sampleRate) |
virtual bool | RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) |
virtual bool | RealtimeSuspend () |
virtual bool | RealtimeResume () |
virtual std::unique_ptr< Message > | MakeMessage () const |
Called on the main thread, in which the result may be cloned. More... | |
virtual bool | UsesMessages () const noexcept |
virtual bool | RealtimeProcessStart (MessagePackage &package) |
settings are possibly changed, since last call, by an asynchronous dialog More... | |
virtual size_t | RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples) |
virtual void | RealtimePassThrough (size_t group, EffectSettings &settings, const float *const *inBuf, size_t numSamples) |
Called instead of RealtimeProcess when the effect is bypassed. Default implementation does nothing. More... | |
virtual bool | RealtimeProcessEnd (EffectSettings &settings) noexcept |
settings can be updated to let a dialog change appearance at idle More... | |
virtual bool | RealtimeFinalize (EffectSettings &settings) noexcept |
virtual size_t | GetTailSize () const |
virtual SampleCount | GetLatency (const EffectSettings &settings, double sampleRate) const |
virtual bool | NeedsDither () const |
virtual bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap)=0 |
virtual bool | ProcessFinalize () noexcept=0 |
virtual size_t | ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen)=0 |
Called for destructive effect computation. More... | |
Public Member Functions inherited from EffectInstanceWithBlockSize | |
~EffectInstanceWithBlockSize () override | |
size_t | GetBlockSize () const override |
size_t | SetBlockSize (size_t maxBlockSize) override |
Static Public Member Functions | |
static bool | LoadUseLatency (const EffectDefinitionInterface &effect) |
Get the preference for using latency. More... | |
static bool | SaveUseLatency (const EffectDefinitionInterface &effect, bool value) |
Set the preference for using latency. More... | |
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... | |
Public Attributes | |
const LADSPA_Descriptor *const | mData |
const ArrayOf< unsigned long > & | mInputPorts |
const ArrayOf< unsigned long > & | mOutputPorts |
bool | mReady { false } |
LADSPA_Handle | mMaster {} |
std::vector< LADSPA_Handle > | mSlaves |
const unsigned | mAudioIns |
const unsigned | mAudioOuts |
const int | mLatencyPort |
const bool | mUseLatency |
Additional Inherited Members | |
Public Types inherited from EffectInstance | |
using | Message = EffectSettingsAccess::Message |
using | SampleCount = uint64_t |
Protected Attributes inherited from PerTrackEffect::Instance | |
const PerTrackEffect & | mProcessor |
Protected Attributes inherited from EffectInstanceWithBlockSize | |
size_t | mBlockSize { 0 } |
Definition at line 39 of file LadspaInstance.h.
LadspaInstance::LadspaInstance | ( | const PerTrackEffect & | processor, |
const LADSPA_Descriptor * | pData, | ||
const ArrayOf< unsigned long > & | inputPorts, | ||
const ArrayOf< unsigned long > & | outputPorts, | ||
unsigned | audioIns, | ||
unsigned | audioOuts, | ||
int | latencyPort | ||
) |
Definition at line 117 of file LadspaInstance.cpp.
void LadspaInstance::FreeInstance | ( | LADSPA_Handle | handle | ) | const |
Definition at line 297 of file LadspaInstance.cpp.
References _LADSPA_Descriptor::cleanup, _LADSPA_Descriptor::deactivate, and mData.
Referenced by ProcessFinalize().
|
overridevirtual |
How many input buffers to allocate at once.
If the instance processes channels independently, this can return 1 The result is not necessarily well defined before RealtimeInitialize
Implements EffectInstance.
Definition at line 208 of file LadspaInstance.cpp.
References mAudioIns.
|
overridevirtual |
How many output buffers to allocate at once.
The result is not necessarily well defined before RealtimeInitialize
Implements EffectInstance.
Definition at line 203 of file LadspaInstance.cpp.
References mAudioOuts.
|
overridevirtual |
Default implementation returns 0
Reimplemented from EffectInstance.
Definition at line 131 of file LadspaInstance.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), and settings().
|
inlinestatic |
Assume settings originated from MakeSettings() and copies thereof.
Definition at line 59 of file LadspaInstance.h.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), and settings().
|
inlinestatic |
Assume settings originated from MakeSettings() and copies thereof.
Definition at line 51 of file LadspaInstance.h.
References settings().
Referenced by ProcessInitialize(), and RealtimeAddProcessor().
LADSPA_Handle LadspaInstance::InitInstance | ( | float | sampleRate, |
LadspaEffectSettings & | settings, | ||
LadspaEffectOutputs * | pOutputs | ||
) | const |
Definition at line 269 of file LadspaInstance.cpp.
References _LADSPA_Descriptor::activate, _LADSPA_Descriptor::connect_port, LadspaEffectOutputs::controls, _LADSPA_Descriptor::instantiate, LADSPA_IS_PORT_CONTROL, LADSPA_IS_PORT_INPUT, mData, _LADSPA_Descriptor::PortCount, _LADSPA_Descriptor::PortDescriptors, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
Referenced by ProcessInitialize(), and RealtimeAddProcessor().
|
static |
Get the preference for using latency.
Definition at line 20 of file LadspaInstance.cpp.
References PluginSettings::GetConfig(), OptionsKey, PluginSettings::Shared, and UseLatencyKey.
|
overridevirtual |
Called for destructive effect computation.
Implements EffectInstance.
Definition at line 168 of file LadspaInstance.cpp.
References _LADSPA_Descriptor::connect_port, mAudioIns, mAudioOuts, mData, mInputPorts, mMaster, mOutputPorts, and _LADSPA_Descriptor::run.
|
overridevirtualnoexcept |
Called at end of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true This may be called during stack unwinding:
Reimplemented from PerTrackEffect::Instance.
Definition at line 155 of file LadspaInstance.cpp.
References FreeInstance(), mMaster, and mReady.
|
overridevirtual |
Called at start of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true
chanMap | null or array terminated with ChannelNameEOL. Do not retain the pointer |
GetAudioInCount()
and GetAudioOutCount()
are well defined Reimplemented from PerTrackEffect::Instance.
Definition at line 140 of file LadspaInstance.cpp.
References GetSettings(), InitInstance(), mMaster, mReady, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 187 of file LadspaInstance.cpp.
References GetSettings(), InitInstance(), mSlaves, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
|
overridevirtualnoexcept |
Reimplemented from EffectInstance.
Definition at line 213 of file LadspaInstance.cpp.
|
overridevirtual |
GetAudioInCount()
and GetAudioOutCount()
are well definedDefault implementation does nothing, returns false (so assume realtime is not supported). Other member functions related to realtime return true or zero, but will not be called, unless a derived class overrides RealtimeInitialize.
Reimplemented from EffectInstance.
Definition at line 182 of file LadspaInstance.cpp.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 245 of file LadspaInstance.cpp.
References _LADSPA_Descriptor::connect_port, mAudioIns, mAudioOuts, mData, mInputPorts, mOutputPorts, mSlaves, and _LADSPA_Descriptor::run.
|
overridevirtualnoexcept |
settings can be updated to let a dialog change appearance at idle
Reimplemented from EffectInstance.
Definition at line 264 of file LadspaInstance.cpp.
|
overridevirtual |
settings are possibly changed, since last call, by an asynchronous dialog
Reimplemented from EffectInstance.
Definition at line 240 of file LadspaInstance.cpp.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 232 of file LadspaInstance.cpp.
References _LADSPA_Descriptor::activate, fn, mData, and mSlaves.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 224 of file LadspaInstance.cpp.
References _LADSPA_Descriptor::deactivate, fn, mData, and mSlaves.
|
static |
Set the preference for using latency.
Definition at line 28 of file LadspaInstance.cpp.
References OptionsKey, PluginSettings::SetConfig(), PluginSettings::Shared, and UseLatencyKey.
Referenced by LadspaEffectOptionsDialog::OnOk().
const unsigned LadspaInstance::mAudioIns |
Definition at line 111 of file LadspaInstance.h.
Referenced by GetAudioInCount(), ProcessBlock(), and RealtimeProcess().
const unsigned LadspaInstance::mAudioOuts |
Definition at line 112 of file LadspaInstance.h.
Referenced by GetAudioOutCount(), ProcessBlock(), and RealtimeProcess().
const LADSPA_Descriptor* const LadspaInstance::mData |
Definition at line 101 of file LadspaInstance.h.
Referenced by FreeInstance(), InitInstance(), LadspaEditor::OnSlider(), LadspaEditor::OnTextCtrl(), LadspaEditor::PopulateUI(), ProcessBlock(), RealtimeProcess(), RealtimeResume(), RealtimeSuspend(), LadspaEditor::RefreshControls(), and LadspaEditor::UpdateControls().
const ArrayOf<unsigned long>& LadspaInstance::mInputPorts |
Definition at line 102 of file LadspaInstance.h.
Referenced by ProcessBlock(), and RealtimeProcess().
const int LadspaInstance::mLatencyPort |
Definition at line 113 of file LadspaInstance.h.
LADSPA_Handle LadspaInstance::mMaster {} |
Definition at line 106 of file LadspaInstance.h.
Referenced by ProcessBlock(), ProcessFinalize(), and ProcessInitialize().
const ArrayOf<unsigned long>& LadspaInstance::mOutputPorts |
Definition at line 103 of file LadspaInstance.h.
Referenced by ProcessBlock(), and RealtimeProcess().
bool LadspaInstance::mReady { false } |
Definition at line 105 of file LadspaInstance.h.
Referenced by ProcessFinalize(), and ProcessInitialize().
std::vector<LADSPA_Handle> LadspaInstance::mSlaves |
Definition at line 109 of file LadspaInstance.h.
Referenced by RealtimeAddProcessor(), RealtimeProcess(), RealtimeResume(), and RealtimeSuspend().
const bool LadspaInstance::mUseLatency |
Definition at line 114 of file LadspaInstance.h.