Audacity 3.2.0
|
#include <LV2Instance.h>
Public Member Functions | |
LV2Instance (const PerTrackEffect &effect, const LV2FeaturesList &features, const LV2Ports &ports) | |
~LV2Instance () override | |
bool | IsOk () const |
const LV2PortStates & | GetPortStates () const |
bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap) 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 |
const LV2Wrapper * | GetMaster () const |
void | MakeMaster (const EffectSettings &settings, double sampleRate) |
std::unique_ptr< LV2Wrapper > | MakeWrapper (const EffectSettings &settings, double sampleRate, EffectOutputs *pOutputs) |
size_t | GetBlockSize () const override |
size_t | SetBlockSize (size_t maxBlockSize) 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... | |
bool | RealtimeInitialize (EffectSettings &settings, double sampleRate) override |
bool | RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) override |
bool | RealtimeFinalize (EffectSettings &settings) noexcept 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... | |
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... | |
Private Attributes | |
LV2InstanceFeaturesList | mFeatures |
const LV2Ports & | mPorts |
LV2PortStates | mPortStates { mPorts } |
std::unique_ptr< LV2Wrapper > | mMaster |
Holds lv2 library state for destructive processing. More... | |
std::vector< std::unique_ptr< LV2Wrapper > > | mSlaves |
Each holds lv2 library state for realtime processing of one track. More... | |
LV2_Atom_Forge | mForge {} |
float | mPositionSpeed { 1.0f } |
int64_t | mPositionFrame { 0 } |
size_t | mUserBlockSize {} |
size_t | mNumSamples {} |
bool | mRolling { true } |
bool | mUseLatency { false } |
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 |
Definition at line 27 of file LV2Instance.h.
LV2Instance::LV2Instance | ( | const PerTrackEffect & | effect, |
const LV2FeaturesList & | features, | ||
const LV2Ports & | ports | ||
) |
Definition at line 27 of file LV2Instance.cpp.
References LV2InstanceFeaturesList::Base(), LV2Preferences::GetBufferSize(), LV2Preferences::GetUseLatency(), mFeatures, mForge, mUseLatency, mUserBlockSize, and LV2FeaturesList::URIDMapFeature().
|
overridedefault |
|
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 82 of file LV2Instance.cpp.
References LV2Ports::mAudioIn, and mPorts.
|
overridevirtual |
How many output buffers to allocate at once.
The result is not necessarily well defined before RealtimeInitialize
Implements EffectInstance.
Definition at line 87 of file LV2Instance.cpp.
References LV2Ports::mAudioOut, and mPorts.
|
overridevirtual |
Implements EffectInstance.
Definition at line 77 of file LV2Instance.cpp.
References LV2InstanceFeaturesList::mBlockSize, and mFeatures.
Referenced by ProcessBlock(), ProcessInitialize(), RealtimeInitialize(), RealtimeProcess(), and SetBlockSize().
|
overridevirtual |
Default implementation returns 0
Reimplemented from EffectInstance.
Definition at line 92 of file LV2Instance.cpp.
|
inline |
Definition at line 46 of file LV2Instance.h.
Referenced by LV2Editor::UpdateUI().
|
inline |
Definition at line 36 of file LV2Instance.h.
|
inline |
Definition at line 34 of file LV2Instance.h.
void LV2Instance::MakeMaster | ( | const EffectSettings & | settings, |
double | sampleRate | ||
) |
Do nothing if there is already an LV2Wrapper with the desired rate. The wrapper object remains until this is destroyed or the wrapper is re-made with another rate.
Definition at line 44 of file LV2Instance.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), MakeWrapper(), mFeatures, mMaster, mPorts, LV2InstanceFeaturesList::mSampleRate, mUserBlockSize, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, SetBlockSize(), and settings().
Referenced by ProcessInitialize().
std::unique_ptr< LV2Wrapper > LV2Instance::MakeWrapper | ( | const EffectSettings & | settings, |
double | sampleRate, | ||
EffectOutputs * | pOutputs | ||
) |
Definition at line 59 of file LV2Instance.cpp.
References LV2Wrapper::Create(), anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), mFeatures, mPorts, mPortStates, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
Referenced by MakeMaster(), and LV2Effect::PopulateUI().
|
overridevirtual |
Called for destructive effect computation.
Implements EffectInstance.
Definition at line 113 of file LV2Instance.cpp.
References GetBlockSize(), LV2PortStates::mAtomPortStates, LV2Ports::mAudioPorts, mForge, mMaster, mPorts, mPortStates, mPositionFrame, mPositionSpeed, and size.
|
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 101 of file LV2Instance.cpp.
References GetBlockSize(), MakeMaster(), LV2PortStates::mCVPortStates, mMaster, mPortStates, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 160 of file LV2Instance.cpp.
References LV2Wrapper::Create(), anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings(), mFeatures, mPorts, mPortStates, mSlaves, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
|
overridevirtualnoexcept |
Reimplemented from EffectInstance.
Definition at line 150 of file LV2Instance.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 143 of file LV2Instance.cpp.
References GetBlockSize(), LV2PortStates::mCVPortStates, and mPortStates.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 212 of file LV2Instance.cpp.
References GetBlockSize(), LV2PortStates::mAtomPortStates, LV2Ports::mAudioPorts, mNumSamples, mPorts, mPortStates, mPositionFrame, mRolling, and mSlaves.
|
overridevirtualnoexcept |
settings can be updated to let a dialog change appearance at idle
Reimplemented from EffectInstance.
Definition at line 253 of file LV2Instance.cpp.
|
overridevirtual |
settings are possibly changed, since last call, by an asynchronous dialog
Reimplemented from EffectInstance.
Definition at line 204 of file LV2Instance.cpp.
References LV2PortStates::mAtomPortStates, mForge, mNumSamples, mPortStates, mPositionFrame, and mPositionSpeed.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 190 of file LV2Instance.cpp.
References mMaster, mPositionFrame, mPositionSpeed, mRolling, and mSlaves.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 176 of file LV2Instance.cpp.
References mMaster, mPositionFrame, mPositionSpeed, mRolling, and mSlaves.
|
overridevirtual |
Implements EffectInstance.
Definition at line 66 of file LV2Instance.cpp.
References GetBlockSize(), LV2InstanceFeaturesList::mBlockSize, mFeatures, min(), mMaster, LV2InstanceFeaturesList::mMinBlockSize, and mSlaves.
Referenced by MakeMaster().
|
private |
Definition at line 76 of file LV2Instance.h.
Referenced by GetBlockSize(), LV2Instance(), MakeMaster(), MakeWrapper(), RealtimeAddProcessor(), and SetBlockSize().
|
private |
Definition at line 86 of file LV2Instance.h.
Referenced by LV2Instance(), ProcessBlock(), and RealtimeProcessStart().
|
private |
Holds lv2 library state for destructive processing.
Definition at line 81 of file LV2Instance.h.
Referenced by MakeMaster(), ProcessBlock(), ProcessInitialize(), RealtimeResume(), RealtimeSuspend(), and SetBlockSize().
|
private |
Definition at line 94 of file LV2Instance.h.
Referenced by RealtimeProcess(), and RealtimeProcessStart().
|
private |
Definition at line 77 of file LV2Instance.h.
Referenced by GetAudioInCount(), GetAudioOutCount(), MakeMaster(), MakeWrapper(), ProcessBlock(), RealtimeAddProcessor(), and RealtimeProcess().
|
private |
Definition at line 78 of file LV2Instance.h.
Referenced by MakeWrapper(), ProcessBlock(), ProcessInitialize(), RealtimeAddProcessor(), RealtimeInitialize(), RealtimeProcess(), and RealtimeProcessStart().
|
private |
Definition at line 90 of file LV2Instance.h.
Referenced by ProcessBlock(), RealtimeProcess(), RealtimeProcessStart(), RealtimeResume(), and RealtimeSuspend().
|
private |
Definition at line 89 of file LV2Instance.h.
Referenced by ProcessBlock(), RealtimeProcessStart(), RealtimeResume(), and RealtimeSuspend().
|
private |
Definition at line 95 of file LV2Instance.h.
Referenced by RealtimeProcess(), RealtimeResume(), and RealtimeSuspend().
|
private |
Each holds lv2 library state for realtime processing of one track.
Definition at line 84 of file LV2Instance.h.
Referenced by RealtimeAddProcessor(), RealtimeProcess(), RealtimeResume(), RealtimeSuspend(), and SetBlockSize().
|
private |
Definition at line 96 of file LV2Instance.h.
Referenced by LV2Instance().
|
private |
Definition at line 92 of file LV2Instance.h.
Referenced by LV2Instance(), and MakeMaster().