openalpp::StreamUpdater Class Reference

#include <streamupdater.h>

Inheritance diagram for openalpp::StreamUpdater:

openalpp::Referenced openalpp::FileStreamUpdater openalpp::NetUpdater List of all members.

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_

Detailed Description

Base class for (threaded) updating of stream buffers.


Constructor & Destructor Documentation

openalpp::StreamUpdater::StreamUpdater ( ALuint  buffer1,
ALuint  buffer2,
ALenum  format,
unsigned int  frequency 
)

Constructor.

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


Member Function Documentation

void openalpp::StreamUpdater::addSource ( ALuint  sourcename  ) 

Add a source to the stream.

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

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

Parameters:
buffer is a pointer to sound data.
length is the length of the sound data (in bytes).
Returns:
done flag. I.e. stoprunning_.


Member Data Documentation

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..


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 08:41:42 2006 for openalpp by  doxygen 1.4.7