![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
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, int angle=0, int distance=0) const |
| Plays the sound. More... | |
| void | loop () |
| Plays the sound repeatedly. More... | |
| void | stopLoop () |
| Stops the looping sound effect. More... | |
Static Public Member Functions | |
| static void | stop () |
| Stops all sounds. More... | |
Container for sound effects.
Handles loading and playing various formats through SDL_mixer.
| 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.
| void OpenXcom::Sound::load | ( | const std::string & | filename | ) |
Loads sound from the specified file.
Loads a sound file from a specified filename.
| filename | Filename 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.
| data | Pointer to the sound file in memory |
| size | Size of the sound file in bytes. |
| void OpenXcom::Sound::loop | ( | ) |
Plays the sound repeatedly.
Plays the contained sound effect repeatedly on the reserved ambience channel.
| void OpenXcom::Sound::play | ( | int | channel = -1, |
| int | angle = 0, |
||
| int | distance = 0 |
||
| ) | const |
Plays the sound.
Plays the contained sound effect.
| channel | Use specified channel, -1 to use any channel |
|
static |
Stops all sounds.
Stops all sounds playing.
| void OpenXcom::Sound::stopLoop | ( | ) |
Stops the looping sound effect.
Stops the contained sound from looping.
1.8.14