An AudioSource which takes another source as input, and buffers it using a thread. More...
Inherits PositionableAudioSource.
Public Member Functions | |
| BufferingAudioSource (PositionableAudioSource *source, bool deleteSourceWhenDeleted, int numberOfSamplesToBuffer, int numberOfChannels=2) | |
| Creates a BufferingAudioSource. | |
| ~BufferingAudioSource () | |
| Destructor. | |
| 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. | |
| void | setNextReadPosition (int64 newPosition) |
| Implements the PositionableAudioSource method. | |
| int64 | getNextReadPosition () const |
| Implements the PositionableAudioSource method. | |
| int64 | getTotalLength () const |
| Implements the PositionableAudioSource method. | |
| bool | isLooping () const |
| Implements the PositionableAudioSource method. | |
An AudioSource which takes another source as input, and buffers it using a thread.
Create this as a wrapper around another thread, and it will read-ahead with a background thread to smooth out playback. You can either create one of these directly, or use it indirectly using an AudioTransportSource.
| BufferingAudioSource::BufferingAudioSource | ( | PositionableAudioSource * | source, |
| bool | deleteSourceWhenDeleted, | ||
| int | numberOfSamplesToBuffer, | ||
| int | numberOfChannels = 2 |
||
| ) |
Creates a BufferingAudioSource.
| source | the input source to read from |
| deleteSourceWhenDeleted | if true, then the input source object will be deleted when this object is deleted |
| numberOfSamplesToBuffer | the size of buffer to use for reading ahead |
| numberOfChannels | the number of channels that will be played |
| BufferingAudioSource::~BufferingAudioSource | ( | ) |
Destructor.
The input source may be deleted depending on whether the deleteSourceWhenDeleted flag was set in the constructor.
| void BufferingAudioSource::prepareToPlay | ( | int | samplesPerBlockExpected, |
| double | sampleRate | ||
| ) | [virtual] |
Implementation of the AudioSource method.
Implements AudioSource.
| void BufferingAudioSource::releaseResources | ( | ) | [virtual] |
Implementation of the AudioSource method.
Implements AudioSource.
| void BufferingAudioSource::getNextAudioBlock | ( | const AudioSourceChannelInfo & | bufferToFill ) | [virtual] |
Implementation of the AudioSource method.
Implements AudioSource.
| void BufferingAudioSource::setNextReadPosition | ( | int64 | newPosition ) | [virtual] |
Implements the PositionableAudioSource method.
Implements PositionableAudioSource.
| int64 BufferingAudioSource::getNextReadPosition | ( | ) | const [virtual] |
Implements the PositionableAudioSource method.
Implements PositionableAudioSource.
| int64 BufferingAudioSource::getTotalLength | ( | ) | const [virtual] |
Implements the PositionableAudioSource method.
Implements PositionableAudioSource.
References PositionableAudioSource::getTotalLength().
| bool BufferingAudioSource::isLooping | ( | ) | const [virtual] |
Implements the PositionableAudioSource method.
Implements PositionableAudioSource.
References PositionableAudioSource::isLooping().