# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLSOUND::CBufferDSound Class Reference

Buffer for the DSound implementation of the audio driver. More...

#include <buffer_dsound.h>

Inheritance diagram for NLSOUND::CBufferDSound:

NLSOUND::IBuffer List of all members.

Public Methods

 CBufferDSound ()
 Constructor. More...

virtual ~CBufferDSound ()
 Destructor. More...

virtual void presetName (const std::string &bufferName)
 Preset the name of the buffer. More...

virtual void setFormat (TSampleFormat format, uint freq)
 Set the sample format. Example: freq=44100. More...

virtual bool fillBuffer (void *src, uint32 bufsize)
 Set the buffer size and fill the buffer. Return true if ok. Call setFormat() first. More...

virtual uint32 getSize () const
 Return the size of the buffer, in bytes. More...

virtual float getDuration () const
 Return the duration (in ms) of the sample in the buffer. More...

virtual bool isStereo () const
 Return true if the buffer is stereo, false if mono. More...

virtual void getFormat (TSampleFormat &format, uint &freq) const
 Return the format and frequency. More...

virtual bool isFillMoreSupported () const
 Return true if the buffer is able to be fill part by part, false if it must be filled in one call (OpenAL 1.0 -> false). More...

virtual bool loadWavFile (const char *filename)
 Load a sound file in the buffer. Throws an exception is an error occurs. More...

virtual uint8getData () const
 Return a pointer to the sample data. More...

virtual const std::string & getName ()
 Return the name of the buffer. More...

virtual bool isBufferLoaded ()
 Return true if the buffer is loaded. Used for async load/unload. More...


Private Attributes

std::string _Name
uint8_Data
uint32 _Size
TSampleFormat _Format
uint _Freq

Detailed Description

Buffer for the DSound implementation of the audio driver.

A buffer represents a sound file loaded in RAM.

Author:
Peter Hanappe, Olivier Cado , Nevrax France
Date:
2002

Definition at line 45 of file buffer_dsound.h.


Constructor & Destructor Documentation

NLSOUND::CBufferDSound::CBufferDSound  
 

Constructor.

Definition at line 41 of file buffer_dsound.cpp.

References _Data, _Format, _Freq, _Size, and NLSOUND::Mono16.

NLSOUND::CBufferDSound::~CBufferDSound   [virtual]
 

Destructor.

Definition at line 49 of file buffer_dsound.cpp.

References _Data, _Name, and nldebug.


Member Function Documentation

bool NLSOUND::CBufferDSound::fillBuffer void *    src,
uint32    bufsize
[virtual]
 

Set the buffer size and fill the buffer. Return true if ok. Call setFormat() first.

Implements NLSOUND::IBuffer.

Definition at line 72 of file buffer_dsound.cpp.

References src.

virtual uint8* NLSOUND::CBufferDSound::getData   const [inline, virtual]
 

Return a pointer to the sample data.

Definition at line 95 of file buffer_dsound.h.

References _Data.

float NLSOUND::CBufferDSound::getDuration   const [virtual]
 

Return the duration (in ms) of the sample in the buffer.

Implements NLSOUND::IBuffer.

Definition at line 78 of file buffer_dsound.cpp.

References _Freq, _Size, NLSOUND::Mono16, NLSOUND::Mono8, NLSOUND::Stereo16, and NLSOUND::Stereo8.

virtual void NLSOUND::CBufferDSound::getFormat TSampleFormat   format,
uint   freq
const [inline, virtual]
 

Return the format and frequency.

Implements NLSOUND::IBuffer.

Definition at line 72 of file buffer_dsound.h.

References _Format, _Freq, format, and NLSOUND::TSampleFormat.

virtual const std::string& NLSOUND::CBufferDSound::getName void    [inline, virtual]
 

Return the name of the buffer.

Implements NLSOUND::IBuffer.

Definition at line 98 of file buffer_dsound.h.

References _Name.

virtual uint32 NLSOUND::CBufferDSound::getSize void    const [inline, virtual]
 

Return the size of the buffer, in bytes.

Implements NLSOUND::IBuffer.

Definition at line 63 of file buffer_dsound.h.

References _Size.

virtual bool NLSOUND::CBufferDSound::isBufferLoaded   [inline, virtual]
 

Return true if the buffer is loaded. Used for async load/unload.

Implements NLSOUND::IBuffer.

Definition at line 100 of file buffer_dsound.h.

References _Data.

virtual bool NLSOUND::CBufferDSound::isFillMoreSupported   const [inline, virtual]
 

Return true if the buffer is able to be fill part by part, false if it must be filled in one call (OpenAL 1.0 -> false).

Implements NLSOUND::IBuffer.

Definition at line 78 of file buffer_dsound.h.

virtual bool NLSOUND::CBufferDSound::isStereo   const [inline, virtual]
 

Return true if the buffer is stereo, false if mono.

Implements NLSOUND::IBuffer.

Definition at line 69 of file buffer_dsound.h.

References _Format, NLSOUND::Stereo16, and NLSOUND::Stereo8.

bool NLSOUND::CBufferDSound::loadWavFile const char *    filename [virtual]
 

Load a sound file in the buffer. Throws an exception is an error occurs.

If the pos+srcsize exceeds the buffer size, the exceeding data is put at the beginning of the buffer. srcsize must be smaller than the buffer size.

Definition at line 100 of file buffer_dsound.cpp.

References _Data, _Format, _Freq, _Name, _Size, file, format, NLSOUND::Mono16, NLSOUND::Mono8, nlassertex, num, NLSOUND::Stereo16, and NLSOUND::Stereo8.

void NLSOUND::CBufferDSound::presetName const std::string &    bufferName [virtual]
 

Preset the name of the buffer.

Used for async loading to give a name before the buffer is effectivly loaded. If the name after loading of the buffer doesn't match the preset name, the load will assert.

Implements NLSOUND::IBuffer.

Definition at line 59 of file buffer_dsound.cpp.

References _Name.

void NLSOUND::CBufferDSound::setFormat TSampleFormat    format,
uint    freq
[virtual]
 

Set the sample format. Example: freq=44100.

Implements NLSOUND::IBuffer.

Definition at line 65 of file buffer_dsound.cpp.

References _Format, _Freq, format, and NLSOUND::TSampleFormat.


Member Data Documentation

uint8* NLSOUND::CBufferDSound::_Data [private]
 

Definition at line 106 of file buffer_dsound.h.

Referenced by CBufferDSound, getData, isBufferLoaded, loadWavFile, and ~CBufferDSound.

TSampleFormat NLSOUND::CBufferDSound::_Format [private]
 

Definition at line 110 of file buffer_dsound.h.

Referenced by CBufferDSound, getFormat, isStereo, loadWavFile, and setFormat.

uint NLSOUND::CBufferDSound::_Freq [private]
 

Definition at line 112 of file buffer_dsound.h.

Referenced by CBufferDSound, getDuration, getFormat, loadWavFile, and setFormat.

std::string NLSOUND::CBufferDSound::_Name [private]
 

Definition at line 104 of file buffer_dsound.h.

Referenced by getName, loadWavFile, presetName, and ~CBufferDSound.

uint32 NLSOUND::CBufferDSound::_Size [private]
 

Definition at line 108 of file buffer_dsound.h.

Referenced by CBufferDSound, getDuration, getSize, and loadWavFile.


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