BufferingAudioSource Class Reference

Inheritance diagram for BufferingAudioSource:

PositionableAudioSource AudioSource List of all members.

Detailed Description

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.

See also:
PositionableAudioSource, AudioTransportSource


Public Member Functions

 BufferingAudioSource (PositionableAudioSource *source, const bool deleteSourceWhenDeleted, int numberOfSamplesToBuffer)
 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 (int newPosition)
 Implements the PositionableAudioSource method.
int getNextReadPosition () const
 Implements the PositionableAudioSource method.
int getTotalLength () const
 Implements the PositionableAudioSource method.
bool isLooping () const
 Implements the PositionableAudioSource method.


Constructor & Destructor Documentation

BufferingAudioSource::BufferingAudioSource PositionableAudioSource source,
const bool  deleteSourceWhenDeleted,
int  numberOfSamplesToBuffer
 

Creates a BufferingAudioSource.

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

BufferingAudioSource::~BufferingAudioSource  ) 
 

Destructor.

The input source may be deleted depending on whether the deleteSourceWhenDeleted flag was set in the constructor.


Member Function Documentation

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 int  newPosition  )  [virtual]
 

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.

int BufferingAudioSource::getNextReadPosition  )  const [virtual]
 

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.

int BufferingAudioSource::getTotalLength  )  const [virtual]
 

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.

bool BufferingAudioSource::isLooping  )  const [virtual]
 

Implements the PositionableAudioSource method.

Implements PositionableAudioSource.


The documentation for this class was generated from the following file: