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

Container for sound effects. More...

#include <Sound.h>

Public Member Functions

 Sound ()
 Creates a blank sound effect. More...
 
 ~Sound ()
 Cleans up the sound effect. More...
 
void load (const std::string &filename)
 Loads sound from the specified file. More...
 
void load (const void *data, unsigned int size)
 Loads sound from a chunk of memory. More...
 
void play (int channel=-1) const
 Plays the sound. More...
 

Static Public Member Functions

static void stop ()
 Stops all sounds. More...
 

Detailed Description

Container for sound effects.

Handles loading and playing various formats through SDL_mixer.

Constructor & Destructor Documentation

OpenXcom::Sound::Sound ( )

Creates a blank sound effect.

Initializes a new sound effect.

OpenXcom::Sound::~Sound ( )

Cleans up the sound effect.

Deletes the loaded sound content.

Member Function Documentation

void OpenXcom::Sound::load ( const std::string &  filename)

Loads sound from the specified file.

Loads a sound file from a specified filename.

Parameters
filenameFilename of the sound file.
void OpenXcom::Sound::load ( const void *  data,
unsigned int  size 
)

Loads sound from a chunk of memory.

Loads a sound file from a specified memory chunk.

Parameters
dataPointer to the sound file in memory
sizeSize of the sound file in bytes.
void OpenXcom::Sound::play ( int  channel = -1) const

Plays the sound.

Plays the contained sound effect.

Parameters
channelUse specified channel, -1 to use any channel
void OpenXcom::Sound::stop ( )
static

Stops all sounds.

Stops all sounds playing.


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