Public Member Functions

MixerAudioSource Class Reference

An AudioSource that mixes together the output of a set of other AudioSources. More...

Inherits AudioSource.

List of all members.

Public Member Functions

 MixerAudioSource ()
 Creates a MixerAudioSource.
 ~MixerAudioSource ()
 Destructor.
void addInputSource (AudioSource *newInput, bool deleteWhenRemoved)
 Adds an input source to the mixer.
void removeInputSource (AudioSource *input, bool deleteSource)
 Removes an input source.
void removeAllInputs ()
 Removes all the input sources.
void prepareToPlay (int samplesPerBlockExpected, double sampleRate)
 Implementation of the AudioSource method.
void releaseResources ()
 Implementation of the AudioSource method.
void getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill)
 Implementation of the AudioSource method.

Detailed Description

An AudioSource that mixes together the output of a set of other AudioSources.

Input sources can be added and removed while the mixer is running as long as their prepareToPlay() and releaseResources() methods are called before and after adding them to the mixer.


Constructor & Destructor Documentation

MixerAudioSource::MixerAudioSource (  )

Creates a MixerAudioSource.

MixerAudioSource::~MixerAudioSource (  )

Destructor.


Member Function Documentation

void MixerAudioSource::addInputSource ( AudioSource newInput,
bool  deleteWhenRemoved 
)

Adds an input source to the mixer.

If the mixer is running you'll need to make sure that the input source is ready to play by calling its prepareToPlay() method before adding it. If the mixer is stopped, then its input sources will be automatically prepared when the mixer's prepareToPlay() method is called.

Parameters:
newInputthe source to add to the mixer
deleteWhenRemovedif true, then this source will be deleted when the mixer is deleted or when removeAllInputs() is called (unless the source is previously removed with the removeInputSource method)
void MixerAudioSource::removeInputSource ( AudioSource input,
bool  deleteSource 
)

Removes an input source.

If the mixer is running, this will remove the source but not call its releaseResources() method, so the caller might want to do this manually.

Parameters:
inputthe source to remove
deleteSourcewhether to delete this source after it's been removed
void MixerAudioSource::removeAllInputs (  )

Removes all the input sources.

If the mixer is running, this will remove the sources but not call their releaseResources() method, so the caller might want to do this manually.

Any sources which were added with the deleteWhenRemoved flag set will be deleted by this method.

void MixerAudioSource::prepareToPlay ( int  samplesPerBlockExpected,
double  sampleRate 
) [virtual]

Implementation of the AudioSource method.

This will call prepareToPlay() on all its input sources.

Implements AudioSource.

void MixerAudioSource::releaseResources (  ) [virtual]

Implementation of the AudioSource method.

This will call releaseResources() on all its input sources.

Implements AudioSource.

void MixerAudioSource::getNextAudioBlock ( const AudioSourceChannelInfo bufferToFill ) [virtual]

Implementation of the AudioSource method.

Implements AudioSource.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines