#include <streamupdater.h>
Inheritance diagram for openalpp::StreamUpdater:
Public Member Functions | |
StreamUpdater (ALuint buffer1, ALuint buffer2, ALenum format, unsigned int frequency) | |
void | addSource (ALuint sourcename) |
void | removeSource (ALuint sourcename) |
virtual void | seek (float time_s) |
bool | update (void *buffer, unsigned int length) |
void | cancelCleanup () |
Protected Member Functions | |
virtual | ~StreamUpdater () |
Protected Attributes | |
ALuint | buffers_ [2] |
ALenum | format_ |
unsigned int | frequency_ |
std::vector< ALuint > | sources_ |
std::vector< ALuint > | newsources_ |
std::vector< ALuint > | removesources_ |
bool | stoprunning_ |
OpenThreads::Mutex | runmutex_ |
openalpp::StreamUpdater::StreamUpdater | ( | ALuint | buffer1, | |
ALuint | buffer2, | |||
ALenum | format, | |||
unsigned int | frequency | |||
) |
Constructor.
buffer1 | and... | |
buffer2 | are the buffers used for double-buffered streaming. | |
format | is the (OpenAL) format of the sound. | |
frequency | is the frequency of the sound. |
virtual openalpp::StreamUpdater::~StreamUpdater | ( | ) | [protected, virtual] |
Destructor.
void openalpp::StreamUpdater::addSource | ( | ALuint | sourcename | ) |
Add a source to the stream.
sourcename | is the OpenAL name of the source. |
void openalpp::StreamUpdater::cancelCleanup | ( | ) |
Inherited from Thread. Is called after run() finishes, and deletes this.
void openalpp::StreamUpdater::removeSource | ( | ALuint | sourcename | ) |
Remove a source from the stream.
sourcename | is the OpenAL name of the source. |
virtual void openalpp::StreamUpdater::seek | ( | float | time_s | ) | [inline, virtual] |
Seeks to specified time
Reimplemented in openalpp::FileStreamUpdater.
bool openalpp::StreamUpdater::update | ( | void * | buffer, | |
unsigned int | length | |||
) |
Update the stream. I.e. add new data to play.
buffer | is a pointer to sound data. | |
length | is the length of the sound data (in bytes). |
ALuint openalpp::StreamUpdater::buffers_[2] [protected] |
Names of the buffers to update.
ALenum openalpp::StreamUpdater::format_ [protected] |
OpenAL format of the sound data.
unsigned int openalpp::StreamUpdater::frequency_ [protected] |
Frequency of the sound data.
std::vector<ALuint> openalpp::StreamUpdater::newsources_ [protected] |
std::vector<ALuint> openalpp::StreamUpdater::removesources_ [protected] |
OpenThreads::Mutex openalpp::StreamUpdater::runmutex_ [protected] |
Mutex for stoprunning_.
std::vector<ALuint> openalpp::StreamUpdater::sources_ [protected] |
Source to update.
bool openalpp::StreamUpdater::stoprunning_ [protected] |
Flag for when Run should stop running..