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  ) 
 

AudioUnitChainStream

AudioUnitChain::~AudioUnitChain  ) 
 

~AudioUnitChain


Member Function Documentation

bool AudioUnitChain::appendUnit AudioUnit  au  ) 
 

appendUnit

Parameters:
au The unit to append
Returns:
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.

Parameters:
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
 

channelCount

Returns:
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()

Parameters:
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:
getDataForRenderCallback()

CoreAudio and AudioUnit Documentation

bool AudioUnitChain::dismantleChain  ) 
 

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

Returns:
True if all units are detached

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

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

Parameters:
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.

Parameters:
au The unit to get the index of
Returns:
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.

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

bool AudioUnitChain::isBypassing  )  const
 

isBypassing

Returns:
Whether the chain is being bypassed or not

bool AudioUnitChain::isChainEmpty  )  const
 

isChainEmpty

Returns:
True if no audio units are in this chain

bool AudioUnitChain::isExpectingSilence  )  const
 

unsigned AudioUnitChain::length  )  const
 

length

Returns:
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.

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

void AudioUnitChain::play  ) 
 

play

void AudioUnitChain::pullData SoundChunk ioBuff  ) 
 

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

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

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:
pullData()

bool AudioUnitChain::removeUnit unsigned  index  ) 
 

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

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

void AudioUnitChain::resetAllUnits  ) 
 

resetUnits Resets all the audio units in the chain.

unsigned AudioUnitChain::sampleRate  )  const
 

sampleRate

Returns:
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.

Parameters:
doBypass bypass flag

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

void AudioUnitChain::setExpectingSilence bool   ) 
 

void ark::AudioUnitChain::setTailForAudioUnit AudioUnit  ci,
unsigned int  newTailFrames
[private]
 

void AudioUnitChain::stop  ) 
 

stop

AudioUnit AudioUnitChain::unitAtIndex unsigned  index  ) 
 

unitAtIndex

Parameters:
The index of the audio unit to retrieve
Returns:
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