MusicManager Class Reference

A class containing knowledge of how to manage a large soundtrack. More...

#include <MusicManager.h>

List of all members.

Public Member Functions

int playTrack (int num, bool bLoops)
 Plays a given pre-loaded track, with the option to loop eternally.
string getTrackName (bool nl=false)
 Returns the string containing the track name. Provide TRUE to make it split up the artist/album/track information with newlines. Does NOT support XM or MOD. Use Propane::getModFileTitle() for that.
void changeTrack (int dt)
 Switch 'dt' number of tracks from the current one. Wraps around.
void setVolume (int vol)
 Set the current volume of music playback. Maximum volume is SDL_mixer-dependent, but intended to be 128.
void pause ()
 Pauses music playback.
void resume ()
 Resumes music playback after being paused.
void restart ()
 Restarts the current music track from the beginning.
int loadTrack (char *filename)
 Loads a track from disk. Returns < 0 if failed.
 MusicManager (char *dir)
 Basic constructor that loads an entire sequentially-numbered directory of oggs (0.ogg, 1.ogg...).
 ~MusicManager ()
 Destructor.


Detailed Description

A class containing knowledge of how to manage a large soundtrack.


Constructor & Destructor Documentation

MusicManager::MusicManager char *  dir  ) 
 

Basic constructor that loads an entire sequentially-numbered directory of oggs (0.ogg, 1.ogg...).

Load a sequentially numbered directory of Ogg Vorbis files.

Errors will be emitted to stderr.

Parameters:
dir The directory containing [0..n].ogg (e.g. "data/music")

MusicManager::~MusicManager  ) 
 

Destructor.

Destructor. Halts music, frees all tracks and their tags, and closes the mixer, disabling SDL_mixer.


Member Function Documentation

int MusicManager::loadTrack char *  fname  ) 
 

Loads a track from disk. Returns < 0 if failed.

Load a track from disk and add it to our collection. Also reads the ID3 tags from the file.

Parameters:
fname The file name of the music track (e.g. "data/music/myMusic.mp3")
Returns:
The success of the load. -1 on failure, 0 otherwise.


The documentation for this class was generated from the following files:
Generated on Sun Jan 14 16:49:11 2007 for Propane Injector by  doxygen 1.4.6