AUEffectBase

Superclasses : AUBase
Subclasses : AUMIDIEffectBase, AUInlineEffectBase
Header : AUEffectBase

class AUEffectBase : public AUBase 

This class supports effects processes with one input and output stream where the number of input channels is equal to the number of output channels. A subclass of AUKernelBase is used to encapsulate the signal processing.


Methods

Constructor


AUEffectBase

public constructor


 AUEffectBase(
          AudioUnit                       audioUnit,
          bool                            inProcessesInPlace = true
    );



Destructor


~AUEffectBase

public nonvirtual destructor


 ~AUEffectBase();

Deletes the AUKernelBase objects.



Format


ChangeStreamFormat

public virtual method


 virtual ComponentResult ChangeStreamFormat (
          AudioUnitScope                  inScope,
          AudioUnitElement                inElement,
          const CAStreamBasicDescription& inPrevFormat,
          const CAStreamBasicDescription& inNewFormat
    );

Internal. Overridden to update kernels and sample rate dependant properties when a stream format is changed.



GetSampleRate

public nonvirtual method


 Float64 GetSampleRate();

Returns the sample rate.



StreamFormatWritable

public virtual method


 virtual bool StreamFormatWritable (
          AudioUnitScope                  scope,
          AudioUnitElement                element
    );

Overridden to return true.



Other


Cleanup

public virtual method


 virtual void Cleanup();



GetNumberOfChannels

public nonvirtual method


 UInt32 GetNumberOfChannels();

Returns the number of channels through the unit.



Initialize

public virtual method


 virtual ComponentResult Initialize();

Overridden to initialize dsp kernels.



IsBypassEffect

public nonvirtual method


 bool IsBypassEffect ();

Return whether the effect bypass is on.



IsInputSilent

private nonvirtual method


 bool IsInputSilent (
          AudioUnitRenderActionFlags      inActionFlags,
          UInt32                          inFramesToProcess
    );



MaintainKernels

public nonvirtual method


 void MaintainKernels();

Internal. Allocates or frees enough kernels to track changes in the effect's channel count.



NewKernel

public virtual method


 virtual AUKernelBase* NewKernel();

Override this method to return an instance of a subclass of AUKernelBase that implements your effect process.



ProcessBufferLists

public virtual method


 virtual OSStatus ProcessBufferLists(
          AudioUnitRenderActionFlags&     ioActionFlags,
          const AudioBufferList&          inBuffer,
          AudioBufferList&                outBuffer,
          UInt32                          inFramesToProcess
    );

Internal. Calls the Render method of the AUKernelBase object.



SetBypassEffect

public virtual method


 virtual void SetBypassEffect (bool inFlag);



ShouldBypassEffect

protected virtual method


 virtual bool ShouldBypassEffect ();



Parameters


GetParamHasSampleRateDependency

public nonvirtual method


 bool GetParamHasSampleRateDependency () const;



GetParameter

public nonvirtual method


 Float32 GetParameter(UInt32 paramID);

This is an overloaded function name which has no scope argument. Used for convenient access to global scope parameter values.



SetParamHasSampleRateDependency

public nonvirtual method


 void SetParamHasSampleRateDependency (bool inFlag);



SetParameter

public nonvirtual method


 void SetParameter(
          UInt32                          paramID,
          Float32                         value
    );

This is an overloaded function name which has no scope argument. Used for convenient access to global scope parameter values.



Properties


GetProperty

public virtual method


 virtual ComponentResult GetProperty (
          AudioUnitPropertyID             inID,
          AudioUnitScope                  inScope,
          AudioUnitElement                inElement,
          void*                           outData
    );

Overridden to support kAudioUnitProperty_BypassEffect.



GetPropertyInfo

public virtual method


 virtual ComponentResult GetPropertyInfo (
          AudioUnitPropertyID             inID,
          AudioUnitScope                  inScope,
          AudioUnitElement                inElement,
          UInt32&                         outDataSize,
          Boolean&                        outWritable
    );

Overridden to support kAudioUnitProperty_BypassEffect.



SetProperty

public virtual method


 virtual ComponentResult SetProperty(
          AudioUnitPropertyID             inID,
          AudioUnitScope                  inScope,
          AudioUnitElement                inElement,
          const void*                     inData,
          UInt32                          inDataSize
    );

Overridden to support kAudioUnitProperty_BypassEffect.



Rendering


Render

public virtual method


 virtual ComponentResult Render(
          AudioUnitRenderActionFlags&     ioActionFlags,
          const AudioTimeStamp&           inTimeStamp,
          UInt32                          inNumberFrames
    );

Overridden to use AUKernelBase object to perform rendering.



Reset

public virtual method


 virtual ComponentResult Reset(
          AudioUnitScope                  inScope,
          AudioUnitElement                inElement
    );

Overridden to reset all kernels.



Data


Other


mBypassEffect

private instance variable


 bool mBypassEffect;

If true, then buffers are passed through without calling the unit's rendering code. This flag is set by the property kAudioUnitProperty_BypassEffect. See also IsBypassEffect.



mKernelList

protected instance variable


 KernelList mKernelList;

A list of all of the dsp kernel objects. See AUKernelBase.



mParamSRDep

private instance variable


 bool mParamSRDep;



mProcessesInplace

private instance variable


 bool mProcessesInPlace;



mSilentTimeout

private instance variable


 AUSilentTimeout mSilentTimeout;