Audacity 3.2.0
Classes | Public Member Functions | Private Attributes | List of all members
StatefulEffectBase Class Referenceabstract

#include <StatefulEffectBase.h>

Inheritance diagram for StatefulEffectBase:
[legend]

Classes

class  Instance
 Calls through to members of StatefulEffectBase. More...
 

Public Member Functions

virtual bool Init ()
 Call once to set up state for whole list of tracks to be processed. More...
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 Actually do the effect here. More...
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (EffectSettings &settings)
 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 SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 

Private Attributes

size_t mEffectBlockSize { 0 }
 

Detailed Description

A mix-in class for effects that are not yet migrated to statelessness. To be eliminated when all effects are migrated

Definition at line 21 of file StatefulEffectBase.h.

Member Function Documentation

◆ GetBlockSize()

size_t StatefulEffectBase::GetBlockSize ( ) const
virtual

Default implementation returns mEffectBlockSize

Reimplemented in StatefulPerTrackEffect, VSTEffect, and VST3Effect.

Definition at line 119 of file StatefulEffectBase.cpp.

120{
121 return mEffectBlockSize;
122}

References mEffectBlockSize.

◆ Init()

bool StatefulEffectBase::Init ( )
virtual

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

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented in EffectAmplify, EffectAutoDuck, EffectChangeSpeed, EffectEqualization, EffectNoiseRemoval, NyquistEffect, EffectScienFilter, and VampEffect.

Definition at line 167 of file StatefulEffectBase.cpp.

168{
169 return true;
170}

Referenced by EffectNoiseReduction::EffectNoiseReduction().

Here is the caller graph for this function:

◆ Process()

virtual bool StatefulEffectBase::Process ( EffectInstance instance,
EffectSettings settings 
)
pure virtual

Actually do the effect here.

Returns
success

Implemented in StatefulPerTrackEffect, EffectAutoDuck, EffectChangeSpeed, EffectClickRemoval, EffectEqualization, EffectFindClipping, Generator, EffectLoudness, EffectNoiseReduction, EffectNoiseRemoval, EffectNormalize, NyquistEffect, EffectPaulstretch, EffectRepair, EffectRepeat, EffectReverse, EffectSBSMS, EffectSimpleMono, EffectStereoToMono, EffectTimeScale, EffectTruncSilence, EffectTwoPassSimpleMono, and VampEffect.

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

Here is the caller graph for this function:

◆ RealtimeAddProcessor()

bool StatefulEffectBase::RealtimeAddProcessor ( EffectSettings settings,
unsigned  numChannels,
float  sampleRate 
)
virtual

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented in EffectBassTreble, EffectDistortion, EffectPhaser, VSTEffect, and VST3Effect.

Definition at line 129 of file StatefulEffectBase.cpp.

131{
132 return true;
133}

◆ RealtimeFinalize()

bool StatefulEffectBase::RealtimeFinalize ( EffectSettings settings)
virtualnoexcept

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns false

Reimplemented in EffectBassTreble, EffectDistortion, EffectPhaser, VSTEffect, and VST3Effect.

Definition at line 162 of file StatefulEffectBase.cpp.

163{
164 return false;
165}

◆ RealtimeInitialize()

bool StatefulEffectBase::RealtimeInitialize ( EffectSettings settings,
double  sampleRate 
)
virtual

Returns
success 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. Default implementation does nothing, returns false

Reimplemented in EffectBassTreble, EffectDistortion, EffectPhaser, VSTEffect, and VST3Effect.

Definition at line 124 of file StatefulEffectBase.cpp.

125{
126 return false;
127}

◆ RealtimeProcess()

size_t StatefulEffectBase::RealtimeProcess ( size_t  group,
EffectSettings settings,
const float *const *  inBuf,
float *const *  outBuf,
size_t  numSamples 
)
virtual

Returns
success Default implementation does nothing, returns 0 Default implementation does nothing, returns 0

Reimplemented in EffectBassTreble, EffectDistortion, EffectPhaser, VSTEffect, and VST3Effect.

Definition at line 150 of file StatefulEffectBase.cpp.

153{
154 return 0;
155}

◆ RealtimeProcessEnd()

bool StatefulEffectBase::RealtimeProcessEnd ( EffectSettings settings)
virtualnoexcept

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

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented in VSTEffect, and VST3Effect.

Definition at line 157 of file StatefulEffectBase.cpp.

158{
159 return true;
160}

◆ RealtimeProcessStart()

bool StatefulEffectBase::RealtimeProcessStart ( EffectSettings settings)
virtual

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

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented in VSTEffect, and VST3Effect.

Definition at line 145 of file StatefulEffectBase.cpp.

146{
147 return true;
148}

◆ RealtimeResume()

bool StatefulEffectBase::RealtimeResume ( )
virtual

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented in VSTEffect, and VST3Effect.

Definition at line 140 of file StatefulEffectBase.cpp.

141{
142 return true;
143}

◆ RealtimeSuspend()

bool StatefulEffectBase::RealtimeSuspend ( )
virtual

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented in VSTEffect, and VST3Effect.

Definition at line 135 of file StatefulEffectBase.cpp.

136{
137 return true;
138}

◆ SetBlockSize()

size_t StatefulEffectBase::SetBlockSize ( size_t  maxBlockSize)
virtual

Default implementation assigns mEffectBlockSize, returns it

Reimplemented in StatefulPerTrackEffect, VSTEffect, and VST3Effect.

Definition at line 113 of file StatefulEffectBase.cpp.

114{
115 mEffectBlockSize = maxBlockSize;
116 return mEffectBlockSize;
117}

References mEffectBlockSize.

Member Data Documentation

◆ mEffectBlockSize

size_t StatefulEffectBase::mEffectBlockSize { 0 }
private

Definition at line 126 of file StatefulEffectBase.h.

Referenced by GetBlockSize(), and SetBlockSize().


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