SOUNDMANAGER Class Reference

#include <sound.h>

List of all members.

Public Member Functions

 SOUNDMANAGER ()
 ~SOUNDMANAGER ()
void Init ()
void Deinit ()
void Reload ()
void Unload ()
void DisableAllSound ()
void SetMasterVolume (float newvol)
float GetMasterVolume ()
void UpdateSettings ()
void MuteAll ()
void UnMuteAll ()
void SetListenerPos (VERTEX pos)
void SetListenerVel (VERTEX vel)
void SetListenerOrientation (VERTEX at, VERTEX up)
void SetPosVel (int sid, VERTEX coord, VERTEX tvel)
void SetListener (VERTEX campos, VERTEX camvel, VERTEX at, VERTEX up)
void SetPitch (int sid, float pitch)
void SetGain (int sid, float gain)
void SetPos (int sid, VERTEX pos)
void SetVel (int sid, VERTEX vel)
ALuint NewSource (string buffername)
ALuint NewSource (string buffername, bool &error)
void StopSource (int sid)
void PlaySource (int idx)
void Update ()

Private Member Functions

void Load ()
void LoadSoundFile (string filename)
void UnloadWave (ALvoid *data)
bool LoadWave (string fname, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq, ALboolean *loop)
bool IDMatchesString (const char *id, const char *str)

Private Attributes

ALCdevice * mSoundDevice
ALCcontext * mSoundContext
bool init
bool disabled
bool loaded
map< string, ALuint > buffers
vector< ALuint > sources
vector< bool > source_free
float master_volume


Detailed Description

Definition at line 75 of file sound.h.


Constructor & Destructor Documentation

SOUNDMANAGER::SOUNDMANAGER  )  [inline]
 

Definition at line 115 of file sound.h.

References disabled, init, loaded, and master_volume.

SOUNDMANAGER::~SOUNDMANAGER  )  [inline]
 

Definition at line 116 of file sound.h.

References Deinit().


Member Function Documentation

void SOUNDMANAGER::Deinit  ) 
 

Definition at line 444 of file sound.cpp.

References disabled, init, mSoundContext, mSoundDevice, and Unload().

Referenced by ~SOUNDMANAGER().

void SOUNDMANAGER::DisableAllSound  )  [inline]
 

Definition at line 122 of file sound.h.

References disabled.

float SOUNDMANAGER::GetMasterVolume  )  [inline]
 

Definition at line 124 of file sound.h.

References master_volume.

bool SOUNDMANAGER::IDMatchesString const char *  id,
const char *  str
[private]
 

Definition at line 912 of file sound.cpp.

Referenced by LoadWave().

void SOUNDMANAGER::Init  ) 
 

Definition at line 419 of file sound.cpp.

References disabled, init, NULL, SetListenerOrientation(), SetListenerPos(), SetListenerVel(), VERTEX::y, and VERTEX::z.

void SOUNDMANAGER::Load  )  [private]
 

Definition at line 466 of file sound.cpp.

References buffers, disabled, SETTINGS::Get(), SETTINGS::GetFullDataPath(), loaded, LoadSoundFile(), settings, and sources.

Referenced by Reload().

void SOUNDMANAGER::LoadSoundFile string  filename  )  [private]
 

Definition at line 522 of file sound.cpp.

References buffers, and disabled.

Referenced by Load().

bool SOUNDMANAGER::LoadWave string  fname,
ALenum *  format,
ALvoid **  data,
ALsizei *  size,
ALsizei *  freq,
ALboolean *  loop
[private]
 

Definition at line 774 of file sound.cpp.

References IDMatchesString(), and NULL.

void SOUNDMANAGER::MuteAll  ) 
 

Definition at line 757 of file sound.cpp.

References disabled, SetGain(), and sources.

Referenced by VAMOSWORLD::Update().

ALuint SOUNDMANAGER::NewSource string  buffername,
bool &  error
 

Definition at line 670 of file sound.cpp.

References disabled, loaded, MAX_SOURCES, and sources.

ALuint SOUNDMANAGER::NewSource string  buffername  ) 
 

Definition at line 664 of file sound.cpp.

Referenced by Vamos_Body::Gl_Car::engine_sound().

void SOUNDMANAGER::PlaySource int  idx  ) 
 

Definition at line 656 of file sound.cpp.

References disabled, loaded, and sources.

void SOUNDMANAGER::Reload  ) 
 

Definition at line 513 of file sound.cpp.

References disabled, Load(), and Unload().

Referenced by LoadWorld().

void SOUNDMANAGER::SetGain int  sid,
float  gain
 

Definition at line 603 of file sound.cpp.

References disabled, loaded, master_volume, and sources.

Referenced by Vamos_Body::Gl_Car::engine_sound(), and MuteAll().

void SOUNDMANAGER::SetListener VERTEX  campos,
VERTEX  camvel,
VERTEX  at,
VERTEX  up
 

Definition at line 583 of file sound.cpp.

References disabled, SetListenerOrientation(), SetListenerPos(), and SetListenerVel().

void SOUNDMANAGER::SetListenerOrientation VERTEX  at,
VERTEX  up
 

Definition at line 741 of file sound.cpp.

References disabled, VERTEX::x, VERTEX::y, and VERTEX::z.

Referenced by Init(), and SetListener().

void SOUNDMANAGER::SetListenerPos VERTEX  pos  ) 
 

Definition at line 732 of file sound.cpp.

References disabled, DISTANCE_FACTOR, VERTEX::Scale(), and VERTEX::v3().

Referenced by Init(), and SetListener().

void SOUNDMANAGER::SetListenerVel VERTEX  vel  ) 
 

Definition at line 723 of file sound.cpp.

References disabled, VERTEX::Scale(), VERTEX::v3(), and VELOCITY_FACTOR.

Referenced by Init(), and SetListener().

void SOUNDMANAGER::SetMasterVolume float  newvol  )  [inline]
 

Definition at line 123 of file sound.h.

References master_volume.

Referenced by UpdateSettings().

void SOUNDMANAGER::SetPitch int  sid,
float  pitch
 

Definition at line 593 of file sound.cpp.

References disabled, and sources.

void SOUNDMANAGER::SetPos int  sid,
VERTEX  pos
 

Definition at line 620 of file sound.cpp.

References disabled, DISTANCE_FACTOR, VERTEX::Scale(), sources, and VERTEX::v3().

Referenced by SetPosVel().

void SOUNDMANAGER::SetPosVel int  sid,
VERTEX  coord,
VERTEX  tvel
 

Definition at line 574 of file sound.cpp.

References disabled, SetPos(), and SetVel().

void SOUNDMANAGER::SetVel int  sid,
VERTEX  vel
 

Definition at line 636 of file sound.cpp.

References disabled, VERTEX::Scale(), sources, VERTEX::v3(), and VELOCITY_FACTOR.

Referenced by SetPosVel().

void SOUNDMANAGER::StopSource int  sid  ) 
 

Definition at line 646 of file sound.cpp.

References disabled, loaded, source_free, and sources.

void SOUNDMANAGER::Unload  ) 
 

Definition at line 486 of file sound.cpp.

References buffers, disabled, loaded, and sources.

Referenced by Deinit(), Reload(), and UnloadWorld().

void SOUNDMANAGER::UnloadWave ALvoid *  data  )  [private]
 

Definition at line 907 of file sound.cpp.

void SOUNDMANAGER::UnMuteAll  ) 
 

Definition at line 769 of file sound.cpp.

void SOUNDMANAGER::Update  )  [inline]
 

Definition at line 143 of file sound.h.

void SOUNDMANAGER::UpdateSettings  )  [inline]
 

Definition at line 125 of file sound.h.

References SETTINGS::Get(), SetMasterVolume(), and settings.

Referenced by VGUI::Gui::ProcessAction().


Member Data Documentation

map<string, ALuint> SOUNDMANAGER::buffers [private]
 

Definition at line 100 of file sound.h.

Referenced by Load(), LoadSoundFile(), and Unload().

bool SOUNDMANAGER::disabled [private]
 

Definition at line 97 of file sound.h.

Referenced by Deinit(), DisableAllSound(), Init(), Load(), LoadSoundFile(), MuteAll(), NewSource(), PlaySource(), Reload(), SetGain(), SetListener(), SetListenerOrientation(), SetListenerPos(), SetListenerVel(), SetPitch(), SetPos(), SetPosVel(), SetVel(), SOUNDMANAGER(), StopSource(), and Unload().

bool SOUNDMANAGER::init [private]
 

Definition at line 96 of file sound.h.

Referenced by Deinit(), Init(), and SOUNDMANAGER().

bool SOUNDMANAGER::loaded [private]
 

Definition at line 98 of file sound.h.

Referenced by Load(), NewSource(), PlaySource(), SetGain(), SOUNDMANAGER(), StopSource(), and Unload().

float SOUNDMANAGER::master_volume [private]
 

Definition at line 104 of file sound.h.

Referenced by GetMasterVolume(), SetGain(), SetMasterVolume(), and SOUNDMANAGER().

ALCcontext* SOUNDMANAGER::mSoundContext [private]
 

Definition at line 94 of file sound.h.

Referenced by Deinit().

ALCdevice* SOUNDMANAGER::mSoundDevice [private]
 

Definition at line 93 of file sound.h.

Referenced by Deinit().

vector<bool> SOUNDMANAGER::source_free [private]
 

Definition at line 102 of file sound.h.

Referenced by StopSource().

vector<ALuint> SOUNDMANAGER::sources [private]
 

Definition at line 101 of file sound.h.

Referenced by Load(), MuteAll(), NewSource(), PlaySource(), SetGain(), SetPitch(), SetPos(), SetVel(), StopSource(), and Unload().


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 04:12:29 2006 by  doxygen 1.4.6