Public Member Functions

BufferingAudioSource Class Reference

An AudioSource which takes another source as input, and buffers it using a thread. More...

Inherits PositionableAudioSource.

List of all members.

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.

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

Constructor & Destructor Documentation

BufferingAudioSource::BufferingAudioSource ( PositionableAudioSource source,
bool  deleteSourceWhenDeleted,
int  numberOfSamplesToBuffer,
int  numberOfChannels = 2 
)

Creates a BufferingAudioSource.

Parameters:
sourcethe input source to read from
deleteSourceWhenDeletedif true, then the input source object will be deleted when this object is deleted
numberOfSamplesToBufferthe size of buffer to use for reading ahead
numberOfChannelsthe 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.


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 ( 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]
bool BufferingAudioSource::isLooping (  ) const [virtual]

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