Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

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]
 

Source to update.

std::vector<ALuint> openalpp::StreamUpdater::removesources_ [protected]
 

Source to update.

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 Thu Dec 9 14:08:13 2004 for openalpp by  doxygen 1.3.9.1