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::AdlibMusic Class Reference

Container for Adlib music tracks. More...

#include <AdlibMusic.h>

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

Public Member Functions

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

Static Public Member Functions

static void player (void *udata, Uint8 *stream, int len)
 Adlib music player. More...
 
- Static Public Member Functions inherited from OpenXcom::Music
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 Adlib music tracks.

Uses a custom YM3812 music player passed to SDL_mixer.

Constructor & Destructor Documentation

OpenXcom::AdlibMusic::AdlibMusic ( float  volume = 1.0f)

Creates a blank music track.

Initializes a new music track.

Parameters
volumeMusic volume modifier (1.0 = 100%).
OpenXcom::AdlibMusic::~AdlibMusic ( )

Cleans up the music track.

Deletes the loaded music content.

Member Function Documentation

void OpenXcom::AdlibMusic::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 from OpenXcom::Music.

void OpenXcom::AdlibMusic::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 from OpenXcom::Music.

void OpenXcom::AdlibMusic::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 from OpenXcom::Music.

void OpenXcom::AdlibMusic::player ( void *  udata,
Uint8 *  stream,
int  len 
)
static

Adlib music player.

Custom audio player.

Parameters
udataUser data to send to the player.
streamRaw audio to output.
lenLength of audio to output.

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