Audacity 3.2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StatefulEffectBase::Instance Class Reference

Calls through to members of StatefulEffectBase. More...

#include <StatefulEffectBase.h>

Inheritance diagram for StatefulEffectBase::Instance:
[legend]
Collaboration diagram for StatefulEffectBase::Instance:
[legend]

Public Member Functions

 Instance (StatefulEffectBase &effect)
 
 ~Instance () override
 
bool Init () override
 Call once to set up state for whole list of tracks to be processed. More...
 
size_t GetBlockSize () const override
 
size_t SetBlockSize (size_t maxBlockSize) 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...
 
bool NeedsDither () const override
 
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< MessageMakeMessage () 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 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...
 

Protected Member Functions

StatefulEffectBaseGetEffect () const
 

Protected Attributes

StatefulEffectBasemEffect
 

Additional Inherited Members

- Public Types inherited from EffectInstance
using Message = EffectSettingsAccess::Message
 
using SampleCount = uint64_t
 

Detailed Description

Calls through to members of StatefulEffectBase.

Definition at line 26 of file StatefulEffectBase.h.

Constructor & Destructor Documentation

◆ Instance()

StatefulEffectBase::Instance::Instance ( StatefulEffectBase effect)
explicit

Definition at line 46 of file StatefulEffectBase.cpp.

47 : mEffect{ effect }
48{
49}
StatefulEffectBase & mEffect

◆ ~Instance()

StatefulEffectBase::Instance::~Instance ( )
overridedefault

Member Function Documentation

◆ GetAudioInCount()

unsigned StatefulEffectBase::Instance::GetAudioInCount ( ) const
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 116 of file StatefulEffectBase.cpp.

117{
118 return GetEffect().GetAudioInCount();
119}
StatefulEffectBase & GetEffect() const
virtual unsigned GetAudioInCount() const
How many input buffers to allocate at once.

◆ GetAudioOutCount()

unsigned StatefulEffectBase::Instance::GetAudioOutCount ( ) const
overridevirtual

How many output buffers to allocate at once.

The result is not necessarily well defined before RealtimeInitialize

Implements EffectInstance.

Definition at line 121 of file StatefulEffectBase.cpp.

122{
123 return GetEffect().GetAudioOutCount();
124}
virtual unsigned GetAudioOutCount() const
How many output buffers to allocate at once.

◆ GetBlockSize()

size_t StatefulEffectBase::Instance::GetBlockSize ( ) const
overridevirtual

Implements EffectInstance.

Definition at line 106 of file StatefulEffectBase.cpp.

107{
108 return GetEffect().GetBlockSize();
109}
virtual size_t GetBlockSize() const

◆ GetEffect()

StatefulEffectBase & StatefulEffectBase::Instance::GetEffect ( ) const
inlineprotected

Definition at line 62 of file StatefulEffectBase.h.

62{ return mEffect; }

Referenced by StatefulEffect::Instance::Process().

Here is the caller graph for this function:

◆ Init()

bool StatefulEffectBase::Instance::Init ( )
overridevirtual

Call once to set up state for whole list of tracks to be processed.

Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstanceEx.

Definition at line 53 of file StatefulEffectBase.cpp.

54{
55 return GetEffect().Init();
56}

◆ NeedsDither()

bool StatefulEffectBase::Instance::NeedsDither ( ) const
overridevirtual

If true (default result), then results require dither if later rendered to a narrower sample format

Reimplemented from EffectInstance.

Definition at line 126 of file StatefulEffectBase.cpp.

127{
128 return GetEffect().NeedsDither();
129}
virtual bool NeedsDither() const

◆ ProcessFinalize()

bool StatefulEffectBase::Instance::ProcessFinalize ( )
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:

Implements EffectInstance.

Reimplemented in StatefulPerTrackEffect::Instance.

Definition at line 138 of file StatefulEffectBase.cpp.

139{
140 return GetEffect().ProcessFinalize();
141}
virtual bool ProcessFinalize() noexcept

◆ ProcessInitialize()

bool StatefulEffectBase::Instance::ProcessInitialize ( EffectSettings settings,
double  sampleRate,
ChannelNames  chanMap 
)
overridevirtual

Called at start of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true

Parameters
chanMapnull or array terminated with ChannelNameEOL. Do not retain the pointer
Postcondition
GetAudioInCount() and GetAudioOutCount() are well defined

Implements EffectInstance.

Reimplemented in StatefulPerTrackEffect::Instance.

Definition at line 131 of file StatefulEffectBase.cpp.

133{
134 return GetEffect()
135 .ProcessInitialize(settings, sampleRate, chanMap);
136}
static Settings & settings()
Definition: TrackInfo.cpp:87
virtual bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr)

References settings().

Here is the call graph for this function:

◆ RealtimeAddProcessor()

bool StatefulEffectBase::Instance::RealtimeAddProcessor ( EffectSettings settings,
EffectOutputs pOutputs,
unsigned  numChannels,
float  sampleRate 
)
overridevirtual
Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstance.

Definition at line 64 of file StatefulEffectBase.cpp.

67{
68 return GetEffect()
69 .RealtimeAddProcessor(settings, pOutputs, numChannels, sampleRate);
70}
virtual bool RealtimeAddProcessor(EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)

References settings().

Here is the call graph for this function:

◆ RealtimeFinalize()

bool StatefulEffectBase::Instance::RealtimeFinalize ( EffectSettings settings)
overridevirtualnoexcept
Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstance.

Definition at line 101 of file StatefulEffectBase.cpp.

102{
104}
virtual bool RealtimeFinalize(EffectSettings &settings) noexcept

References settings().

Here is the call graph for this function:

◆ RealtimeInitialize()

bool StatefulEffectBase::Instance::RealtimeInitialize ( EffectSettings settings,
double  sampleRate 
)
overridevirtual
Returns
success
Postcondition
GetAudioInCount() and GetAudioOutCount() are well defined

Default 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 58 of file StatefulEffectBase.cpp.

60{
61 return GetEffect().RealtimeInitialize(settings, sampleRate);
62}
virtual bool RealtimeInitialize(EffectSettings &settings, double sampleRate)

References settings().

Here is the call graph for this function:

◆ RealtimeProcess()

size_t StatefulEffectBase::Instance::RealtimeProcess ( size_t  group,
EffectSettings settings,
const float *const *  inBuf,
float *const *  outBuf,
size_t  numSamples 
)
overridevirtual
Returns
success Default implementation does nothing, returns 0

Reimplemented from EffectInstance.

Definition at line 88 of file StatefulEffectBase.cpp.

91{
92 return GetEffect()
93 .RealtimeProcess(group, settings, inBuf, outBuf, numSamples);
94}
virtual size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)

References settings().

Here is the call graph for this function:

◆ RealtimeProcessEnd()

bool StatefulEffectBase::Instance::RealtimeProcessEnd ( EffectSettings settings)
overridevirtualnoexcept

settings can be updated to let a dialog change appearance at idle

Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstance.

Definition at line 96 of file StatefulEffectBase.cpp.

97{
99}
virtual bool RealtimeProcessEnd(EffectSettings &settings) noexcept
settings can be updated to let a dialog change appearance at idle

References settings().

Here is the call graph for this function:

◆ RealtimeProcessStart()

bool StatefulEffectBase::Instance::RealtimeProcessStart ( MessagePackage package)
overridevirtual

settings are possibly changed, since last call, by an asynchronous dialog

Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstance.

Definition at line 82 of file StatefulEffectBase.cpp.

84{
85 return GetEffect().RealtimeProcessStart(package);
86}
virtual bool RealtimeProcessStart(MessagePackage &package)
settings are possibly changed, since last call, by an asynchronous dialog

◆ RealtimeResume()

bool StatefulEffectBase::Instance::RealtimeResume ( )
overridevirtual
Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstance.

Definition at line 77 of file StatefulEffectBase.cpp.

78{
79 return GetEffect().RealtimeResume();
80}
virtual bool RealtimeResume()

◆ RealtimeSuspend()

bool StatefulEffectBase::Instance::RealtimeSuspend ( )
overridevirtual
Returns
success Default implementation does nothing, returns true

Reimplemented from EffectInstance.

Definition at line 72 of file StatefulEffectBase.cpp.

73{
74 return GetEffect().RealtimeSuspend();
75}
virtual bool RealtimeSuspend()

◆ SetBlockSize()

size_t StatefulEffectBase::Instance::SetBlockSize ( size_t  maxBlockSize)
overridevirtual

Implements EffectInstance.

Definition at line 111 of file StatefulEffectBase.cpp.

112{
113 return GetEffect().SetBlockSize(maxBlockSize);
114}
virtual size_t SetBlockSize(size_t maxBlockSize)

Member Data Documentation

◆ mEffect

StatefulEffectBase& StatefulEffectBase::Instance::mEffect
protected

Definition at line 61 of file StatefulEffectBase.h.


The documentation for this class was generated from the following files: