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

A sound base class and its static properties. More...

#include <sound.h>

Inheritance diagram for NLSOUND::CSound:

NLSOUND::CBackgroundSound NLSOUND::CComplexSound NLSOUND::CContextSound NLSOUND::CSimpleSound List of all members.

Public Types

enum  TSOUND_TYPE { SOUND_SIMPLE, SOUND_COMPLEX, SOUND_BACKGROUND, SOUND_CONTEXT }

Public Methods

 CSound ()
 Constructor. More...

virtual ~CSound ()
 Destructor. More...

virtual TSOUND_TYPE getSoundType ()=0
 Get the type of the sound. More...

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

bool getLooping () const
 Return the looping state. More...

float getGain () const
 Return the gain. More...

float getPitch () const
 Return the pitch. More...

TSoundPriority getPriority () const
 Return the initial priority. More...

virtual bool isDetailed () const=0
 Return true if cone is meaningful. More...

float getConeInnerAngle () const
 Return the inner angle of the cone. More...

float getConeOuterAngle () const
 Return the outer angle of the cone. More...

float getConeOuterGain () const
 Return the outer gain of the cone. More...

const NLMISC::CVectorgetDirectionVector () const
 Return the direction vector. More...

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

const std::string & getName () const
 Return the name (must be unique). More...

virtual float getMaxDistance () const
 Return the max distance (if detailed()). More...

void setLooping (bool looping)
 Set looping. More...

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

virtual void serial (NLMISC::IStream &s)
bool operator< (const CSound &otherSound) const

Static Public Methods

CSound * createSound (const std::string &filename, NLGEORGES::UFormElm &formRoot)
 Factory for specialized sound. More...


Protected Attributes

float _Gain
float _Pitch
TSoundPriority _Priority
float _ConeInnerAngle
float _ConeOuterAngle
float _ConeOuterGain
NLMISC::CVector _Direction
bool _Looping
float _MaxDist
 Clipping distance for complex or backgound sound. More...

std::string _Name

Detailed Description

A sound base class and its static properties.

Author:
Olivier Cado , Nevrax France
Date:
2001

Definition at line 58 of file sound.h.


Member Enumeration Documentation

enum NLSOUND::CSound::TSOUND_TYPE
 

Enumeration values:
SOUND_SIMPLE 
SOUND_COMPLEX 
SOUND_BACKGROUND 
SOUND_CONTEXT 

Definition at line 64 of file sound.h.

Referenced by NLSOUND::CSimpleSound::getSoundType, NLSOUND::CContextSound::getSoundType, NLSOUND::CComplexSound::getSoundType, and NLSOUND::CBackgroundSound::getSoundType.


Constructor & Destructor Documentation

NLSOUND::CSound::CSound  
 

Constructor.

Definition at line 95 of file sound.cpp.

References NLSOUND::MidPri.

Referenced by createSound, NLSOUND::CComplexSound::getDuration, NLSOUND::CBackgroundSound::getDuration, NLSOUND::CComplexSound::getMaxDistance, NLSOUND::CBackgroundSound::getMaxDistance, NLSOUND::CComplexSound::getSubSoundList, NLSOUND::CBackgroundSound::getSubSoundList, and operator<.

NLSOUND::CSound::~CSound   [virtual]
 

Destructor.

Definition at line 107 of file sound.cpp.


Member Function Documentation

CSound * NLSOUND::CSound::createSound const std::string &    filename,
NLGEORGES::UFormElm   formRoot
[static]
 

Factory for specialized sound.

Definition at line 42 of file sound.cpp.

References CSound, NLGEORGES::UFormElm::getDfnName, NLGEORGES::UFormElm::getNodeByName, nlassertex, and nlwarning.

float NLSOUND::CSound::getConeInnerAngle   const [inline]
 

Return the inner angle of the cone.

Definition at line 95 of file sound.h.

References _ConeInnerAngle.

float NLSOUND::CSound::getConeOuterAngle   const [inline]
 

Return the outer angle of the cone.

Definition at line 97 of file sound.h.

References _ConeOuterAngle.

float NLSOUND::CSound::getConeOuterGain   const [inline]
 

Return the outer gain of the cone.

Definition at line 99 of file sound.h.

References _ConeOuterGain.

const NLMISC::CVector& NLSOUND::CSound::getDirectionVector   const [inline]
 

Return the direction vector.

Definition at line 101 of file sound.h.

References _Direction.

virtual uint32 NLSOUND::CSound::getDuration   [pure virtual]
 

Return the length of the sound in ms.

Implemented in NLSOUND::CBackgroundSound.

float NLSOUND::CSound::getGain void    const [inline]
 

Return the gain.

Definition at line 87 of file sound.h.

References _Gain.

bool NLSOUND::CSound::getLooping   const [inline]
 

Return the looping state.

Definition at line 85 of file sound.h.

References _Looping.

virtual float NLSOUND::CSound::getMaxDistance   const [inline, virtual]
 

Return the max distance (if detailed()).

Reimplemented in NLSOUND::CBackgroundSound.

Definition at line 107 of file sound.h.

References _MaxDist.

const std::string& NLSOUND::CSound::getName void    const [inline]
 

Return the name (must be unique).

Definition at line 105 of file sound.h.

References _Name.

float NLSOUND::CSound::getPitch void    const [inline]
 

Return the pitch.

Definition at line 89 of file sound.h.

References _Pitch.

TSoundPriority NLSOUND::CSound::getPriority void    const [inline]
 

Return the initial priority.

Definition at line 91 of file sound.h.

References _Priority, and NLSOUND::TSoundPriority.

virtual TSOUND_TYPE NLSOUND::CSound::getSoundType   [pure virtual]
 

Get the type of the sound.

Implemented in NLSOUND::CBackgroundSound.

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

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

Implemented in NLSOUND::CBackgroundSound.

void NLSOUND::CSound::importForm const std::string &    filename,
NLGEORGES::UFormElm   root
[virtual]
 

Load the sound parameters from georges' form.

Reimplemented in NLSOUND::CBackgroundSound.

Definition at line 127 of file sound.cpp.

References _ConeInnerAngle, _ConeOuterAngle, _ConeOuterGain, _Direction, _Gain, _Looping, _Name, _Pitch, _Priority, NLGEORGES::UFormElm::getValueByName, NLSOUND::HighestPri, NLSOUND::HighPri, NLSOUND::LowPri, NLSOUND::MidPri, NLMISC::Pi, NLSOUND::Sqrt12_2, x, y, and z.

virtual bool NLSOUND::CSound::isDetailed   const [pure virtual]
 

Return true if cone is meaningful.

Implemented in NLSOUND::CBackgroundSound.

bool NLSOUND::CSound::operator< const CSound &    otherSound const [inline]
 

Definition at line 118 of file sound.h.

References _Name, and CSound.

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

Reimplemented in NLSOUND::CBackgroundSound.

Definition at line 111 of file sound.cpp.

References _ConeInnerAngle, _ConeOuterAngle, _ConeOuterGain, _Direction, _Gain, _Looping, _MaxDist, _Name, _Pitch, _Priority, s, NLMISC::IStream::serial, and NLMISC::IStream::serialEnum.

void NLSOUND::CSound::setLooping bool    looping [inline]
 

Set looping.

Definition at line 110 of file sound.h.

References _Looping.


Member Data Documentation

float NLSOUND::CSound::_ConeInnerAngle [protected]
 

Definition at line 129 of file sound.h.

Referenced by getConeInnerAngle, importForm, and serial.

float NLSOUND::CSound::_ConeOuterAngle [protected]
 

Definition at line 129 of file sound.h.

Referenced by getConeOuterAngle, importForm, and serial.

float NLSOUND::CSound::_ConeOuterGain [protected]
 

Definition at line 129 of file sound.h.

Referenced by getConeOuterGain, importForm, and serial.

NLMISC::CVector NLSOUND::CSound::_Direction [protected]
 

Definition at line 130 of file sound.h.

Referenced by getDirectionVector, importForm, and serial.

float NLSOUND::CSound::_Gain [protected]
 

Definition at line 126 of file sound.h.

Referenced by getGain, importForm, and serial.

bool NLSOUND::CSound::_Looping [protected]
 

Definition at line 132 of file sound.h.

Referenced by getLooping, importForm, serial, and setLooping.

float NLSOUND::CSound::_MaxDist [protected]
 

Clipping distance for complex or backgound sound.

Definition at line 135 of file sound.h.

Referenced by getMaxDistance, NLSOUND::CComplexSound::getMaxDistance, NLSOUND::CSimpleSound::importForm, and serial.

std::string NLSOUND::CSound::_Name [protected]
 

Definition at line 138 of file sound.h.

Referenced by getName, importForm, operator<, and serial.

float NLSOUND::CSound::_Pitch [protected]
 

Definition at line 127 of file sound.h.

Referenced by getPitch, importForm, and serial.

TSoundPriority NLSOUND::CSound::_Priority [protected]
 

Definition at line 128 of file sound.h.

Referenced by getPriority, importForm, and serial.


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