Advanced Strategic Command
Public Member Functions | Static Public Member Functions | Friends | List of all members
SoundSystem Class Reference

#include <sound.h>

Public Member Functions

 SoundSystem (bool muteEffects, bool muteMusic, bool off)
 Sets up ASC's sound system. More...
 
void setEffectsMute (bool mute)
 Turns the sound on and off. More...
 
bool areEffectsMuted ()
 can sounds be played right now ? More...
 
bool isOff ()
 is the soundsystem completely disabled ? More...
 
void playMusic (MusicPlayList *playlist)
 plays the pieces of music which are referenced in the playlist More...
 
void pauseMusic ()
 Pauses the music that is currently being played. More...
 
void resumeMusic ()
 resumes the music More...
 
void resumePauseMusic ()
 resumes or resumes the music, depending whether is music is paused or playing More...
 
void setMusicVolume (int Volume)
 Sets the music volume. Range is 0 .. 100. More...
 
void setEffectVolume (int Volume)
 Sets the sound effect volume. Range is 0 .. 100. More...
 
int getEffectVolume ()
 Returns the sound effect volume. This is already normalized to the 0 .. 128 range of SDL_Mixer ! More...
 
ASCString getDiagnosticText ()
 
 ~SoundSystem ()
 

Static Public Member Functions

static SoundSystemgetInstance ()
 

Friends

class Sound
 loads a sound from the wave file called name to an Mix_buffer. More...
 

Detailed Description

Definition at line 63 of file sound.h.

Constructor & Destructor Documentation

SoundSystem::SoundSystem ( bool  muteEffects,
bool  muteMusic,
bool  off 
)

Sets up ASC's sound system.

Parameters
muteEffectsThe sound is going to be initialized, but no sounds played. Sounds can be enabled at runtime
muteMusicThe sound is going to be initialized, but no music played. Music can be enabled at runtime
offThe sound system is not even going to be initiliazed. Can only be restartet by restarting ASC

Definition at line 59 of file sound.cpp.

References displayLogMessage(), fatalError(), and warningMessage().

SoundSystem::~SoundSystem ( )

Definition at line 285 of file sound.cpp.

References SoundSystem_InternalData::musicBuf.

Member Function Documentation

bool SoundSystem::areEffectsMuted ( )
inline

can sounds be played right now ?

Definition at line 101 of file sound.h.

Referenced by executeUserAction().

ASCString SoundSystem::getDiagnosticText ( )
int SoundSystem::getEffectVolume ( )
inline

Returns the sound effect volume. This is already normalized to the 0 .. 128 range of SDL_Mixer !

Definition at line 125 of file sound.h.

static SoundSystem* SoundSystem::getInstance ( )
inlinestatic
bool SoundSystem::isOff ( )
inline

is the soundsystem completely disabled ?

Definition at line 104 of file sound.h.

void SoundSystem::pauseMusic ( )

Pauses the music that is currently being played.

Definition at line 227 of file sound.cpp.

Referenced by executeUserAction(), and resumePauseMusic().

void SoundSystem::playMusic ( MusicPlayList playlist)

plays the pieces of music which are referenced in the playlist

Definition at line 220 of file sound.cpp.

References SoundSystem_InternalData::currentPlaylist.

Referenced by PlayListSelector::buttonpressed(), and startMusic().

void SoundSystem::resumeMusic ( )

resumes the music

Definition at line 238 of file sound.cpp.

Referenced by executeUserAction(), and resumePauseMusic().

void SoundSystem::resumePauseMusic ( )

resumes or resumes the music, depending whether is music is paused or playing

Definition at line 256 of file sound.cpp.

References pauseMusic(), and resumeMusic().

void SoundSystem::setEffectsMute ( bool  mute)

Turns the sound on and off.

Definition at line 128 of file sound.cpp.

Referenced by executeUserAction().

void SoundSystem::setEffectVolume ( int  Volume)

Sets the sound effect volume. Range is 0 .. 100.

Definition at line 274 of file sound.cpp.

void SoundSystem::setMusicVolume ( int  Volume)

Sets the music volume. Range is 0 .. 100.

Definition at line 264 of file sound.cpp.

Referenced by main().

Friends And Related Function Documentation

friend class Sound
friend

loads a sound from the wave file called name to an Mix_buffer.

Definition at line 87 of file sound.h.


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