An AudioSource that mixes together the output of a set of other AudioSources. More...
Inherits AudioSource.
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. | |
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.
| MixerAudioSource::MixerAudioSource | ( | ) |
Creates a MixerAudioSource.
| MixerAudioSource::~MixerAudioSource | ( | ) |
Destructor.
| 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.
| newInput | the source to add to the mixer |
| deleteWhenRemoved | if 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.
| input | the source to remove |
| deleteSource | whether 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.