Audacity 3.2.0
|
Performs effect computation. More...
#include <EffectInterface.h>
Classes | |
struct | MessagePackage |
Public Types | |
using | Message = EffectSettingsAccess::Message |
using | SampleCount = uint64_t |
Public Member Functions | |
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... | |
Performs effect computation.
Definition at line 449 of file EffectInterface.h.
Type of messages to send from main thread to processing, which can describe the transitions of settings (instead of their states)
Definition at line 506 of file EffectInterface.h.
using EffectInstance::SampleCount = uint64_t |
Definition at line 562 of file EffectInterface.h.
|
virtualdefault |
|
pure virtual |
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
Implemented in AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, DtmfBase::Instance, EchoBase::Instance, PhaserBase::Instance, ReverbBase::Instance, WahWahBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Referenced by EffectStage::Process(), and PerTrackEffect::ProcessPass().
|
pure virtual |
How many output buffers to allocate at once.
The result is not necessarily well defined before RealtimeInitialize
Implemented in AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, DtmfBase::Instance, EchoBase::Instance, PhaserBase::Instance, ReverbBase::Instance, WahWahBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Referenced by EffectStage::Process(), and PerTrackEffect::ProcessPass().
|
pure virtual |
Implemented in AudioUnitInstance, EffectInstanceWithBlockSize, StatefulEffectBase::Instance, LV2Instance, VSTInstance, and VST3Instance.
|
virtual |
Default implementation returns 0
Reimplemented in AudioUnitInstance, CompressorInstance, StatefulEffect::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 197 of file EffectInterface.cpp.
|
virtual |
Function that has not yet found a use Correct definitions of it will likely depend on settings and state
Reimplemented in VST3Instance.
Definition at line 192 of file EffectInterface.cpp.
|
virtual |
Called on the main thread, in which the result may be cloned.
Default implementation returns a null
Reimplemented in AudioUnitInstance, and VSTInstance.
Definition at line 155 of file EffectInterface.cpp.
|
virtual |
If true (default result), then results require dither if later rendered to a narrower sample format
Reimplemented in StatefulEffectBase::Instance.
Definition at line 203 of file EffectInterface.cpp.
Referenced by PerTrackEffect::ProcessPass().
|
pure virtual |
Called for destructive effect computation.
Implemented in AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, DtmfBase::Instance, EchoBase::Instance, PhaserBase::Instance, ReverbBase::Instance, WahWahBase::Instance, StatefulEffect::Instance, StatefulPerTrackEffect::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Referenced by EffectStage::Process().
|
pure virtualnoexcept |
Called at end of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true This may be called during stack unwinding:
Implemented in AudioUnitInstance, CompressorInstance, EchoBase::Instance, PerTrackEffect::Instance, StatefulEffectBase::Instance, StatefulPerTrackEffect::Instance, LadspaInstance, VSTInstance, VST3Instance, and ReverbBase::Instance.
|
pure virtual |
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 Implemented in AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, DtmfBase::Instance, EchoBase::Instance, PhaserBase::Instance, ReverbBase::Instance, WahWahBase::Instance, PerTrackEffect::Instance, StatefulEffectBase::Instance, StatefulPerTrackEffect::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
|
virtual |
Reimplemented in ReverbBase::Instance, AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, PhaserBase::Instance, WahWahBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 139 of file EffectInterface.cpp.
|
virtualnoexcept |
Reimplemented in AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, PhaserBase::Instance, ReverbBase::Instance, WahWahBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 187 of file EffectInterface.cpp.
|
virtual |
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 in AudioUnitInstance, CompressorInstance, ReverbBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, VST3Instance, BassTrebleBase::Instance, DistortionBase::Instance, PhaserBase::Instance, and WahWahBase::Instance.
Definition at line 134 of file EffectInterface.cpp.
|
virtual |
Called instead of RealtimeProcess
when the effect is bypassed. Default implementation does nothing.
Reimplemented in CompressorInstance.
Definition at line 176 of file EffectInterface.cpp.
|
virtual |
Reimplemented in AudioUnitInstance, BassTrebleBase::Instance, CompressorInstance, DistortionBase::Instance, PhaserBase::Instance, ReverbBase::Instance, WahWahBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 170 of file EffectInterface.cpp.
|
virtualnoexcept |
settings can be updated to let a dialog change appearance at idle
Reimplemented in AudioUnitInstance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 182 of file EffectInterface.cpp.
|
virtual |
settings are possibly changed, since last call, by an asynchronous dialog
Reimplemented in AudioUnitInstance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 165 of file EffectInterface.cpp.
|
virtual |
Reimplemented in AudioUnitInstance, CompressorInstance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 150 of file EffectInterface.cpp.
|
virtual |
Reimplemented in AudioUnitInstance, ReverbBase::Instance, StatefulEffectBase::Instance, LadspaInstance, LV2Instance, VSTInstance, and VST3Instance.
Definition at line 145 of file EffectInterface.cpp.
|
pure virtual |
Implemented in AudioUnitInstance, EffectInstanceWithBlockSize, StatefulEffectBase::Instance, LV2Instance, VSTInstance, and VST3Instance.
Referenced by PerTrackEffect::ProcessPass().
|
virtualnoexcept |
If true, the effect makes no use EffectSettings for inter-thread comminication
Default implementation returns false. In future, all effects should be rewritten to use messages and this function will be removed.
Reimplemented in AudioUnitInstance, and VSTInstance.
Definition at line 160 of file EffectInterface.cpp.