syBR::AudioCore::Bufferer Class Reference

Audio bufferer class. More...

#include <Bufferer.hpp>

List of all members.

Public Types

enum  SoundFormat { SNDFMT_MONO_8 = 0, SNDFMT_MONO_16, SNDFMT_STEREO_8, SNDFMT_STEREO_16 }
 Sound format enumeration. More...

Public Member Functions

 Bufferer (unsigned int BlockSize)
 Constructor.
virtual ~Bufferer ()
 Destructor.
void SetSoundFormat (SoundFormat Format, unsigned int Frequency)
 Set sound format informations.
virtual bool IsPlaying () const =0
 Tell if the buffer is playing or if it is done with its content.
virtual void Play ()=0
 Play the content of the buffer.
virtual void Stop ()=0
 Stop playing the content of the buffer.
virtual unsigned char GetFreeBlocks ()=0
 Get number of free blocks.
virtual void BufferBlock (char *Data, unsigned int Size)=0
 Buffer some data.

Protected Attributes

const unsigned char BLOCKCOUNT
unsigned char ucFreeBlocks
 Number of free data blocks.
SoundFormat myFormat
 Sound format of the buffer.
unsigned int uiFrequency
 Sound frequency of the buffer (in Hz).
unsigned int uiBlockSize
 Data block size to be used to fill the buffer.


Detailed Description

Audio bufferer class.

This is object which allows to do bufferisation. It can be used to do streaming (see OggVorbisPlayer()). This is a pure abstract class which needs a concrete implementation (using OpenAL, DirectSound or any other sound library).


Member Enumeration Documentation

enum syBR::AudioCore::Bufferer::SoundFormat

Sound format enumeration.

Enumerator:
SNDFMT_MONO_8  Mono 8 bits format.
SNDFMT_MONO_16  Mono 16 bits format.
SNDFMT_STEREO_8  Stereo 8 bits format.
SNDFMT_STEREO_16  Stereo 16 bits format.


Constructor & Destructor Documentation

Bufferer::Bufferer ( unsigned int  BlockSize  ) 

Constructor.

Parameters:
BlockSize Data block size to be used for the buffers (in bytes)

Bufferer::~Bufferer (  )  [virtual]

Destructor.


Member Function Documentation

void Bufferer::SetSoundFormat ( SoundFormat  Format,
unsigned int  Frequency 
)

Set sound format informations.

Parameters:
Format Sound format (8/16 bits, mono/stereo)
Frequency Sound frequency (in Hz)

virtual bool syBR::AudioCore::Bufferer::IsPlaying (  )  const [pure virtual]

Tell if the buffer is playing or if it is done with its content.

Returns:
Boolean indicating if the buffer is playing

virtual void syBR::AudioCore::Bufferer::Play (  )  [pure virtual]

Play the content of the buffer.

virtual void syBR::AudioCore::Bufferer::Stop (  )  [pure virtual]

Stop playing the content of the buffer.

virtual unsigned char syBR::AudioCore::Bufferer::GetFreeBlocks (  )  [pure virtual]

Get number of free blocks.

Returns:
Number of free blocks (which has already been played and which can be erased)

virtual void syBR::AudioCore::Bufferer::BufferBlock ( char *  Data,
unsigned int  Size 
) [pure virtual]

Buffer some data.

Parameters:
Data Data block to fill the buffer with
Size of the block


Member Data Documentation

const unsigned char syBR::AudioCore::Bufferer::BLOCKCOUNT [protected]

unsigned char syBR::AudioCore::Bufferer::ucFreeBlocks [protected]

Number of free data blocks.

SoundFormat syBR::AudioCore::Bufferer::myFormat [protected]

Sound format of the buffer.

unsigned int syBR::AudioCore::Bufferer::uiFrequency [protected]

Sound frequency of the buffer (in Hz).

unsigned int syBR::AudioCore::Bufferer::uiBlockSize [protected]

Data block size to be used to fill the buffer.


The documentation for this class was generated from the following files:

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:33 2008