OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
OpenXcom::Music Class Reference

Container for music tracks. More...

#include <Music.h>

Inheritance diagram for OpenXcom::Music:
OpenXcom::AdlibMusic

Public Member Functions

 Music ()
 Creates a blank music track. More...
 
virtual ~Music ()
 Cleans up the music track. More...
 
virtual void load (const std::string &filename)
 Loads music from the specified file. More...
 
virtual void load (const void *data, int size)
 Loads music from a chunk of memory. More...
 
virtual void play (int loop=-1) const
 Plays the music. More...
 

Static Public Member Functions

static void stop ()
 Stops all music. More...
 
static void pause ()
 Pauses all music. More...
 
static void resume ()
 Resumes all music. More...
 

Detailed Description

Container for music tracks.

Handles loading and playing various formats through SDL_mixer.

Constructor & Destructor Documentation

OpenXcom::Music::Music ( )

Creates a blank music track.

Initializes a new music track.

OpenXcom::Music::~Music ( )
virtual

Cleans up the music track.

Deletes the loaded music content.

Member Function Documentation

void OpenXcom::Music::load ( const std::string &  filename)
virtual

Loads music from the specified file.

Loads a music file from a specified filename.

Parameters
filenameFilename of the music file.

Reimplemented in OpenXcom::AdlibMusic.

void OpenXcom::Music::load ( const void *  data,
int  size 
)
virtual

Loads music from a chunk of memory.

Loads a music file from a specified memory chunk.

Parameters
dataPointer to the music file in memory
sizeSize of the music file in bytes.

Reimplemented in OpenXcom::AdlibMusic.

void OpenXcom::Music::pause ( )
static

Pauses all music.

Pauses music playback when game loses focus.

void OpenXcom::Music::play ( int  loop = -1) const
virtual

Plays the music.

Plays the contained music track.

Parameters
loopAmount of times to loop the track. -1 = infinite

Reimplemented in OpenXcom::AdlibMusic.

void OpenXcom::Music::resume ( )
static

Resumes all music.

Resumes music playback when game gains focus.

void OpenXcom::Music::stop ( )
static

Stops all music.

Stops all music playing.


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