Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ark::AudioUnitChain Class Reference

#include <AudioUnitChain.h>

List of all members.

Public Member Functions

 AudioUnitChain ()
 ~AudioUnitChain ()
void pullData (SoundChunk &)
void play ()
void stop ()
bool setChainFormat (unsigned sampleRate, unsigned channels)
unsigned sampleRate () const
unsigned channelCount () const
bool isChainEmpty () const
unsigned length () const
AudioUnit unitAtIndex (unsigned index)
unsigned indexOfUnit (AudioUnit) const
bool insertUnit (AudioUnit, unsigned index)
bool appendUnit (AudioUnit)
bool removeUnit (unsigned index)
bool moveUnit (unsigned src, unsigned tgt)
bool dismantleChain ()
void setBypasses (bool)
bool isBypassing () const
void setExpectingSilence (bool)
bool isExpectingSilence () const
void resetAllUnits ()

Static Public Attributes

static const unsigned NoUnit = numeric_limits<unsigned>::max()

Private Types

typedef std::list< AudioUnit > UnitChain

Private Member Functions

void pullDataFromUnitChain ()
void getDataForRenderCallback (AudioBufferList &buffs, AudioUnitRenderActionFlags &flags, UInt32 bus, UInt32 frames)
void setTailForAudioUnit (AudioUnit ci, unsigned int newTailFrames)
unsigned int maxTail ()

Static Private Member Functions

static OSStatus coreAudioRenderCallback (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
static void audioUnitPropertyChanged (void *inRefCon, AudioUnit ci, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement)

Private Attributes

SoundChunk _inBuffer
SoundChunk _outBuffer
AudioTimeStamp _coreAudioTimeStamp
UnitChain _unitChain
bool _doesBypass
bool _expectSilence
unsigned _tailSinceSilence
unsigned _outSampleRate
unsigned _outChannelCount
AudioBufferList * _audioBuffList

Member Typedef Documentation

typedef std::list<AudioUnit> ark::AudioUnitChain::UnitChain [private]

Constructor & Destructor Documentation

AudioUnitChain::AudioUnitChain  ) 


AudioUnitChain::~AudioUnitChain  ) 


Member Function Documentation

bool AudioUnitChain::appendUnit AudioUnit  au  ) 


au The unit to append
True if the operation succeeded

void AudioUnitChain::audioUnitPropertyChanged void *  inRefCon,
AudioUnit  ci,
AudioUnitPropertyID  inID,
AudioUnitScope  inScope,
AudioUnitElement  inElement
[static, private]

audioUnitPropertyChanged This is the audio unit property listener for this chain.

inRefCon A pointer to the chain involved (this)
ci The audio unit who's property changed
inID The ID of the property affected
inScope The scope of the property affected
inElement The element of the property affected

unsigned AudioUnitChain::channelCount  )  const


The current channel count the chain works at

OSStatus AudioUnitChain::coreAudioRenderCallback void *  inRefCon,
AudioUnitRenderActionFlags *  ioActionFlags,
const AudioTimeStamp *  inTimeStamp,
UInt32  inBusNumber,
UInt32  inNumberFrames,
AudioBufferList *  ioData
[static, private]

coreAudioRenderCallback The callback that is inserted at the front of the audio unit chain to provide stream data. Delegates to getDataForRenderCallback()

inRefCon A pointer to the AudioUnitChainStream
ioActionFlags Flags which can be used to communicate with the unit chain
inTimeStamp A timestamp indicating what part of the stream is being rendered
inBusNumber Which bus we are supplying data to
inNumberFrames The number of frames we are to supply
ioData An AudioBufferList object with buffers we must fill
See also:

CoreAudio and AudioUnit Documentation

bool AudioUnitChain::dismantleChain  ) 

dismantleChain Detaches all audio units in the chain from each other.

True if all units are detached

void AudioUnitChain::getDataForRenderCallback AudioBufferList &  buffs,
AudioUnitRenderActionFlags &  flags,
UInt32  bus,
UInt32  frames

getDataForRenderCallback Supplies the actual audio data to the front of the audio unit chain.

buffs The buffs to fill with data
flags Action flags which we can use to communicate render options and render results
bus The bus to provide data for
frames The number of frames to provide
See also:
CoreAudio and AudioUnit Documentation

unsigned AudioUnitChain::indexOfUnit AudioUnit  au  )  const

indexOfAudioUnit Returns the index of the audio unit passed, or if the unit is not part of the chain returns AudioUnitChain::NoUnit.

au The unit to get the index of
The index of the passed unit or AudioUnitNotInChain

bool AudioUnitChain::insertUnit AudioUnit  au,
unsigned  index

insertUnit Attempts to insert unit into the chain at the requested index.

au The unit to insert
index The Index to insert the unit at
True if the insert was successful

bool AudioUnitChain::isBypassing  )  const


Whether the chain is being bypassed or not

bool AudioUnitChain::isChainEmpty  )  const


True if no audio units are in this chain

bool AudioUnitChain::isExpectingSilence  )  const

unsigned AudioUnitChain::length  )  const


The number of audio units in the chain

unsigned AudioUnitChain::maxTail  )  [private]

bool AudioUnitChain::moveUnit unsigned  src,
unsigned  tgt

moveUnit Moves the audio unit at the index src, to the index tgt.

src The index of the unit to move
tgt The index to move the unit to
True if the operation succeeds

void AudioUnitChain::play  ) 


void AudioUnitChain::pullData SoundChunk ioBuff  ) 

pullData This method delegates all the work to private the private method pullDataFromUnitChain()

ioBuff The buffer providing the input, and returning the output of the audio unit chain
See also:

void AudioUnitChain::pullDataFromUnitChain  )  [private]

pullDataFromUnit This method prepares the core audio types, and calls AudioUnitRender. It updates private state variables and handles any action flags that the audio units return.

See also:

bool AudioUnitChain::removeUnit unsigned  index  ) 

removeUnit Removes the audio unit from the chain, and restores chain integrity.

index The index of the unit to remove
True if the operation was successful

void AudioUnitChain::resetAllUnits  ) 

resetUnits Resets all the audio units in the chain.

unsigned AudioUnitChain::sampleRate  )  const


The current sample rate the chain works at

void AudioUnitChain::setBypasses bool  doBypass  ) 

setBypasses Sets whether the audio unit chain should be bypassed or not.

doBypass bypass flag

bool ark::AudioUnitChain::setChainFormat unsigned  sampleRate,
unsigned  channels

void AudioUnitChain::setExpectingSilence bool   ) 

void ark::AudioUnitChain::setTailForAudioUnit AudioUnit  ci,
unsigned int  newTailFrames

void AudioUnitChain::stop  ) 


AudioUnit AudioUnitChain::unitAtIndex unsigned  index  ) 


The index of the audio unit to retrieve
The audio unit at the specified index

Member Data Documentation

AudioBufferList* ark::AudioUnitChain::_audioBuffList [private]

AudioTimeStamp ark::AudioUnitChain::_coreAudioTimeStamp [private]

bool ark::AudioUnitChain::_doesBypass [private]

bool ark::AudioUnitChain::_expectSilence [private]

SoundChunk ark::AudioUnitChain::_inBuffer [private]

SoundChunk ark::AudioUnitChain::_outBuffer [private]

unsigned ark::AudioUnitChain::_outChannelCount [private]

unsigned ark::AudioUnitChain::_outSampleRate [private]

unsigned ark::AudioUnitChain::_tailSinceSilence [private]

UnitChain ark::AudioUnitChain::_unitChain [private]

const unsigned AudioUnitChain::NoUnit = numeric_limits<unsigned>::max() [static]

The documentation for this class was generated from the following files:
Generated on Tue Sep 6 14:54:40 2005 for Arkonnekt Sound by  doxygen 1.4.4