Sound Class Reference

#include <sound.h>

List of all members.


Detailed Description

Sound engine.

Definition at line 37 of file sound.h.


Public Member Functions

 Sound ()
 ~Sound ()
void init ()
 Installs the sound engine.
void close ()
 Removes all sound functionalities.
void playMusic (const std::string &path)
 Starts background music.
void stopMusic ()
 Stops currently running background music track.
void fadeInMusic (const std::string &path, int ms=2000)
 Fades in background music.
void fadeOutMusic (int ms)
 Fades out currently running background music track.
int getMaxVolume () const
void setMusicVolume (int volume)
void setSfxVolume (int volume)
void playSfx (const std::string &path)
 Plays an item.

Private Member Functions

void info ()
 Logs various info about sound device.
void haltMusic ()
 Halts and frees currently playing music.

Private Attributes

bool mInstalled
int mSfxVolume
int mMusicVolume
std::string mCurrentMusicFile
Mix_Music * mMusic

Constructor & Destructor Documentation

Sound::Sound (  ) 

Definition at line 30 of file sound.cpp.

Sound::~Sound (  ) 

Definition at line 38 of file sound.cpp.


Member Function Documentation

void Sound::init (  ) 

Installs the sound engine.

Definition at line 42 of file sound.cpp.

void Sound::close (  ) 

Removes all sound functionalities.

Definition at line 242 of file sound.cpp.

void Sound::playMusic ( const std::string &  path  ) 

Starts background music.

Parameters:
path The full path to the music file.

Definition at line 173 of file sound.cpp.

void Sound::stopMusic (  ) 

Stops currently running background music track.

Definition at line 186 of file sound.cpp.

void Sound::fadeInMusic ( const std::string &  path,
int  ms = 2000 
)

Fades in background music.

Parameters:
path The full path to the music file.
ms Duration of fade-in effect (ms)

Definition at line 200 of file sound.cpp.

void Sound::fadeOutMusic ( int  ms  ) 

Fades out currently running background music track.

Parameters:
ms Duration of fade-out effect (ms)

Definition at line 213 of file sound.cpp.

int Sound::getMaxVolume (  )  const

Definition at line 118 of file sound.cpp.

void Sound::setMusicVolume ( int  volume  ) 

Definition at line 123 of file sound.cpp.

void Sound::setSfxVolume ( int  volume  ) 

Definition at line 131 of file sound.cpp.

void Sound::playSfx ( const std::string &  path  ) 

Plays an item.

Parameters:
path The resource path to the sound file.

Definition at line 229 of file sound.cpp.

void Sound::info (  )  [private]

Logs various info about sound device.

Definition at line 79 of file sound.cpp.

void Sound::haltMusic (  )  [private]

Halts and frees currently playing music.

Definition at line 254 of file sound.cpp.


Member Data Documentation

bool Sound::mInstalled [private]

Definition at line 99 of file sound.h.

int Sound::mSfxVolume [private]

Definition at line 101 of file sound.h.

int Sound::mMusicVolume [private]

Definition at line 102 of file sound.h.

std::string Sound::mCurrentMusicFile [private]

Definition at line 104 of file sound.h.

Mix_Music* Sound::mMusic [private]

Definition at line 105 of file sound.h.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5