Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

sound_manager_c Class Reference

Sound Manager Class. More...

#include <sound.h>


Public Methods

sshort load_wav (const char *fname)
 load a wave file

void unload (sshort num)
 removes a sound from memory

sshort duplicate (sshort)
 duplicate a sound

void play (sshort)
 play a sound

void play_copy (sshort)
 duplicate sound and play the copy

void stop (sshort num)
 stop sound

void update ()
 do whatever needs to be done


Static Public Methods

const char * sound_alerror (ALenum e)
 convert openal error code to string


Protected Types

typedef sound_manager_c::sound_s sound_t
 A sound.


Protected Attributes

array_c< sound_t > * sounds
 here all sound_ts are stored

ALCdevice * sounddevice
 current openal sound device

ALCcontext * soundcontext
 current openal sound context


Detailed Description

The Sound Manager keeps track of loaded sounds, plays them etc..

Definition at line 74 of file sound.h.


Member Typedef Documentation

typedef struct sound_manager_c::sound_s sound_t [protected]
 

Here the information for each sound is stored.


Member Function Documentation

sshort duplicate sshort   
 

Parameters:
num  duplicate this sound

Definition at line 358 of file o_sound.cpp.

References array_c< sound_t >::add(), sound_s::buffer, array_c< sound_t >::get(), INVALID_INDEX, sound_s::iscopy, sounds, and sound_s::source.

Referenced by play_copy().

sshort load_wav const char *    fname
 

Parameters:
fname  file name to load

Definition at line 210 of file o_sound.cpp.

References _log_printf(), array_c< sound_t >::add(), sound_s::buffer, INVALID_INDEX, SafeArrayDelete, sound_alerror(), sounds, and sound_s::source.

void play sshort   
 

Parameters:
num  sound to play

Definition at line 389 of file o_sound.cpp.

References array_c< sound_t >::get(), sounds, and sound_s::source.

Referenced by play_copy().

void play_copy sshort   
 

Parameters:
num  sound to play

Definition at line 414 of file o_sound.cpp.

References duplicate(), array_c< sound_t >::get(), play(), sounds, and sound_s::temporary.

const char * sound_alerror ALenum    e [static]
 

Parameters:
e  OpenAL error value

Definition at line 157 of file o_sound.cpp.

Referenced by load_wav().

void stop sshort    num
 

Parameters:
num  sound to stop

Definition at line 434 of file o_sound.cpp.

References array_c< sound_t >::get(), sounds, and sound_s::source.

void unload sshort    num
 

Parameters:
num  sound index to unload

Definition at line 181 of file o_sound.cpp.

References sound_s::buffer, array_c< sound_t >::get(), sound_s::iscopy, array_c< sound_t >::remove(), SafeDelete, sounds, and sound_s::source.

Referenced by update().


The documentation for this class was generated from the following files:
Generated on Wed Dec 18 15:48:49 2002 for omicron engine by doxygen1.2.18