# 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::CSimpleSound Class Reference

A sound buffer and its static properties. More...

#include <simple_sound.h>

Inheritance diagram for NLSOUND::CSimpleSound:

NLSOUND::CSound List of all members.

Public Methods

 CSimpleSound ()
 Constructor. More...

virtual ~CSimpleSound ()
 Destructor. More...

virtual void importForm (const std::string &filename, NLGEORGES::UFormElm &formRoot)
 Load the sound parameters from georges' form. More...

const std::string & getBuffername ()
 Return the name of the buffer, can be depend of a context. More...

IBuffergetBuffer ()
 Return the buffer and the buffername if not null. More...

bool isDetailed () const
 Return true if distance and cone are meaningful. More...

float getMinDistance () const
 Return the min distance (if detailed()). More...

float getAlpha () const
 Return the alpha attenuation value. More...

uint32 getDuration ()
 Return the length of the sound in ms. More...

const std::string & getFilename () const
 Return the filename. More...

const std::string & getBuffername () const
 Return the name of the buffer (must be unique). More...

void setBuffer (IBuffer *buffer)
 Change the buffer. More...

void getSubSoundList (std::vector< std::pair< std::string, CSound * > > &subsounds) const
 Used by the george sound plugin to check sound recursion (ie sound 'toto' use sound 'titi' witch also use sound 'toto' ...). More...

void serial (NLMISC::IStream &s)

Private Methods

TSOUND_TYPE getSoundType ()
 Get the type of the sound. More...


Private Attributes

bool _Registered
IBuffer_Buffer
bool _Detailed
float _MinDist
double _Alpha
bool _NeedContext
std::string _Filename
std::string _Buffername

Detailed Description

A sound buffer and its static properties.

Author:
Boris Boucher , Nevrax France
Date:
2002

Definition at line 45 of file simple_sound.h.


Constructor & Destructor Documentation

NLSOUND::CSimpleSound::CSimpleSound  
 

Constructor.

Definition at line 45 of file simple_sound.cpp.

NLSOUND::CSimpleSound::~CSimpleSound   [virtual]
 

Destructor.

Definition at line 58 of file simple_sound.cpp.

References _Buffer.


Member Function Documentation

float NLSOUND::CSimpleSound::getAlpha   const [inline]
 

Return the alpha attenuation value.

Definition at line 70 of file simple_sound.h.

References _Alpha.

IBuffer * NLSOUND::CSimpleSound::getBuffer  
 

Return the buffer and the buffername if not null.

Definition at line 94 of file simple_sound.cpp.

References _Buffer, _Buffername, and _Registered.

Referenced by getDuration.

const std::string& NLSOUND::CSimpleSound::getBuffername   const [inline]
 

Return the name of the buffer (must be unique).

Definition at line 76 of file simple_sound.h.

References _Buffername.

const std::string& NLSOUND::CSimpleSound::getBuffername   [inline]
 

Return the name of the buffer, can be depend of a context.

Definition at line 62 of file simple_sound.h.

References _Buffername.

uint32 NLSOUND::CSimpleSound::getDuration   [virtual]
 

Return the length of the sound in ms.

Implements NLSOUND::CSound.

Definition at line 110 of file simple_sound.cpp.

References getBuffer.

const std::string& NLSOUND::CSimpleSound::getFilename   const [inline]
 

Return the filename.

Definition at line 74 of file simple_sound.h.

References _Filename.

float NLSOUND::CSimpleSound::getMinDistance   const [inline]
 

Return the min distance (if detailed()).

Definition at line 68 of file simple_sound.h.

References _MinDist.

TSOUND_TYPE NLSOUND::CSimpleSound::getSoundType   [inline, private, virtual]
 

Get the type of the sound.

Implements NLSOUND::CSound.

Definition at line 89 of file simple_sound.h.

References NLSOUND::CSound::SOUND_SIMPLE, and NLSOUND::CSound::TSOUND_TYPE.

void NLSOUND::CSimpleSound::getSubSoundList std::vector< std::pair< std::string, CSound * > > &    subsounds const [virtual]
 

Used by the george sound plugin to check sound recursion (ie sound 'toto' use sound 'titi' witch also use sound 'toto' ...).

Implements NLSOUND::CSound.

Definition at line 82 of file simple_sound.cpp.

References _Buffername.

void NLSOUND::CSimpleSound::importForm const std::string &    filename,
NLGEORGES::UFormElm   formRoot
[virtual]
 

Load the sound parameters from georges' form.

an input serial or a load throws an exception ESoundFileNotFound)

Reimplemented from NLSOUND::CSound.

Definition at line 149 of file simple_sound.cpp.

References _Alpha, _Buffername, _Filename, NLSOUND::CSound::_MaxDist, _MinDist, _NeedContext, NLGEORGES::UFormElm::getDfnName, NLGEORGES::UFormElm::getNodeByName, NLGEORGES::UFormElm::getValueByName, nlassert, and setBuffer.

bool NLSOUND::CSimpleSound::isDetailed   const [inline, virtual]
 

Return true if distance and cone are meaningful.

Implements NLSOUND::CSound.

Definition at line 66 of file simple_sound.h.

References _Detailed.

void NLSOUND::CSimpleSound::serial NLMISC::IStream   s [virtual]
 

Reimplemented from NLSOUND::CSound.

Definition at line 125 of file simple_sound.cpp.

References _Alpha, _Buffername, _MinDist, _NeedContext, NLMISC::IStream::isReading, s, NLMISC::IStream::serial, and setBuffer.

void NLSOUND::CSimpleSound::setBuffer IBuffer   buffer
 

Change the buffer.

Definition at line 64 of file simple_sound.cpp.

References _Buffer, and _Registered.

Referenced by importForm, and serial.


Member Data Documentation

double NLSOUND::CSimpleSound::_Alpha [private]
 

Definition at line 102 of file simple_sound.h.

Referenced by getAlpha, importForm, and serial.

IBuffer* NLSOUND::CSimpleSound::_Buffer [private]
 

Definition at line 97 of file simple_sound.h.

Referenced by getBuffer, setBuffer, and ~CSimpleSound.

std::string NLSOUND::CSimpleSound::_Buffername [private]
 

Definition at line 109 of file simple_sound.h.

Referenced by getBuffer, getBuffername, getSubSoundList, importForm, and serial.

bool NLSOUND::CSimpleSound::_Detailed [private]
 

Definition at line 100 of file simple_sound.h.

Referenced by isDetailed.

std::string NLSOUND::CSimpleSound::_Filename [private]
 

Definition at line 108 of file simple_sound.h.

Referenced by getFilename, and importForm.

float NLSOUND::CSimpleSound::_MinDist [private]
 

Definition at line 101 of file simple_sound.h.

Referenced by getMinDistance, importForm, and serial.

bool NLSOUND::CSimpleSound::_NeedContext [private]
 

Definition at line 105 of file simple_sound.h.

Referenced by importForm, and serial.

bool NLSOUND::CSimpleSound::_Registered [private]
 

Definition at line 94 of file simple_sound.h.

Referenced by getBuffer, and setBuffer.


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