
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) |
| void | hold () |
| void | release () |
| bool | update (void *buffer, unsigned int length) |
| virtual void | stop () |
| bool | shouldStop () const |
| void | cancelCleanup () |
| void | setSleepTime (int mseconds) |
Protected Member Functions | |
| void | processRemovedSources () |
| void | processAddedSources () |
| virtual | ~StreamUpdater () |
| void | waitForPlay () |
| void | sleep () |
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_ |
| int | sleepTime_ |
| Event | m_playEvent |
| 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::hold | ( | ) | [inline] |
Tell this StreamUpdater thread to wait until some thread call its release
| void openalpp::StreamUpdater::processAddedSources | ( | ) | [protected] |
Add any sources that the user has scheduled for adding.
| void openalpp::StreamUpdater::processRemovedSources | ( | ) | [protected] |
Remove any sources that the user has scheduled for removal.
| void openalpp::StreamUpdater::release | ( | ) | [inline] |
Release this thread.
| 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.
| void openalpp::StreamUpdater::setSleepTime | ( | int | mseconds | ) | [inline] |
| bool openalpp::StreamUpdater::shouldStop | ( | ) | const [inline] |
| void openalpp::StreamUpdater::sleep | ( | ) | [inline, protected] |
| virtual void openalpp::StreamUpdater::stop | ( | ) | [inline, virtual] |
Tell the thread to stop executing, also release it if its waiting to play.
Reimplemented in openalpp::DeviceUpdater.
| 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). |
| void openalpp::StreamUpdater::waitForPlay | ( | ) | [inline, protected] |
Wait for someone to call release. This indicates that we should start playing a stream
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.
Event openalpp::StreamUpdater::m_playEvent [protected] |
Event signalling that source is playing
std::vector<ALuint> openalpp::StreamUpdater::newsources_ [protected] |
std::vector<ALuint> openalpp::StreamUpdater::removesources_ [protected] |
OpenThreads::Mutex openalpp::StreamUpdater::runmutex_ [protected] |
Mutex for stoprunning_.
int openalpp::StreamUpdater::sleepTime_ [protected] |
Time to sleep in run method, i.e. sleeptime to reduce CPU usage
std::vector<ALuint> openalpp::StreamUpdater::sources_ [protected] |
Source to update.
bool openalpp::StreamUpdater::stoprunning_ [protected] |
Flag for when Run should stop running..
1.5.9