Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SoundHandler Class Reference

#include </home/clem/local/src/opie/noncore/games/sfcave-sdl/sound.h>

List of all members.

Static Public Member Functions

static bool init ()
static void cleanUp ()
static int playSound (int soundNr, int channel=-1, int nrLoops=0, int playBeforeFinished=false)
static void stopSound (int channel, bool fadeOut, int nrMilliSecs=1000)
static void setSoundsOn (bool val)
static void setMusicOn (bool val)
static void playMusic (string musicFile)
static void playMusic (bool fadeIn=false)
static void stopMusic (bool fadeOut=false)
static void setMusicVolume (int vol)

Private Member Functions

 SoundHandler ()

Static Private Attributes

static Mix_Music * music
static Mix_Chunk * sounds [NR_SOUNDS]
static int soundChannels [NR_SOUNDS]
static bool soundOn
static bool musicOn


Constructor & Destructor Documentation

SoundHandler::SoundHandler  )  [inline, private]
 

Definition at line 32 of file sound.h.


Member Function Documentation

void SoundHandler::cleanUp  )  [static]
 

Definition at line 39 of file sound.cpp.

References music, SND_EXPLOSION, SND_THRUST, and sounds.

bool SoundHandler::init  )  [static]
 

Definition at line 10 of file sound.cpp.

References music, musicOn, printf, SND_EXPLOSION, SND_THRUST, SOUND_PATH, soundOn, and sounds.

void SoundHandler::playMusic bool  fadeIn = false  )  [static]
 

Definition at line 105 of file sound.cpp.

References music, and musicOn.

void SoundHandler::playMusic string  musicFile  )  [static]
 

Definition at line 82 of file sound.cpp.

References music, printf, soundOn, and stopMusic().

Referenced by SFCave::changeState(), and setMusicOn().

int SoundHandler::playSound int  soundNr,
int  channel = -1,
int  nrLoops = 0,
int  playBeforeFinished = false
[static]
 

Definition at line 53 of file sound.cpp.

References NR_SOUNDS, soundOn, and sounds.

Referenced by SFCave::handleEvents(), Game::stateChanged(), and Game::update().

void SoundHandler::setMusicOn bool  val  )  [static]
 

Definition at line 149 of file sound.cpp.

References musicOn, playMusic(), and stopMusic().

Referenced by SFCave::handleMenuSelect(), and SFCave::SFCave().

void SoundHandler::setMusicVolume int  vol  )  [static]
 

Definition at line 139 of file sound.cpp.

Referenced by SFCave::changeState().

void SoundHandler::setSoundsOn bool  val  )  [static]
 

Definition at line 144 of file sound.cpp.

References soundOn.

Referenced by SFCave::handleMenuSelect(), and SFCave::SFCave().

void SoundHandler::stopMusic bool  fadeOut = false  )  [static]
 

Definition at line 123 of file sound.cpp.

References music.

Referenced by SFCave::changeState(), playMusic(), and setMusicOn().

void SoundHandler::stopSound int  channel,
bool  fadeOut,
int  nrMilliSecs = 1000
[static]
 

Definition at line 69 of file sound.cpp.

References soundOn.

Referenced by Game::stateChanged(), and Game::update().


Member Data Documentation

Mix_Music * SoundHandler::music [static, private]
 

Definition at line 5 of file sound.cpp.

Referenced by cleanUp(), init(), playMusic(), and stopMusic().

bool SoundHandler::musicOn [static, private]
 

Definition at line 8 of file sound.cpp.

Referenced by init(), playMusic(), and setMusicOn().

int SoundHandler::soundChannels [static, private]
 

Definition at line 6 of file sound.cpp.

bool SoundHandler::soundOn [static, private]
 

Definition at line 7 of file sound.cpp.

Referenced by init(), playMusic(), playSound(), setSoundsOn(), and stopSound().

Mix_Chunk * SoundHandler::sounds [static, private]
 

Definition at line 4 of file sound.cpp.

Referenced by cleanUp(), init(), and playSound().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:52:16 2005 for OPIE by  doxygen 1.4.2