#include <SoundEffectManager.h>
Public Member Functions | |
| int | playSample (unsigned int sampleNum, bool override=true, unsigned int overrideChannel=0) |
| Plays a sample and forces it to override any other sample playing in the overrideChannel. | |
| int | addSample (char *filename) |
| Adds a sample from file to the internal storage. | |
| void | setVolume (int volume) |
| Sets the volume using SDL_Mixer. Max is 128. | |
| SoundEffectManager (char *dir) | |
| Instantiate the sound effect manager from disk. | |
| virtual | ~SoundEffectManager () |
| Destruct the sound effect manager, clearing all samples. | |
|
|
Instantiate the sound effect manager from disk. This method loads every WAV in a directory, sequentially, with no gaps. This means you need 0.wav, 1.wav, ... If you want to add OGG files, you will have to add those manually for now.
|
|
|
Adds a sample from file to the internal storage. Loads a sample from a provided filename. Returns -1 on failure (file not found/cannot read file/unknown file format). Returns the ID of this sample on a successful load.
|
|
||||||||||||||||
|
Plays a sample and forces it to override any other sample playing in the overrideChannel. Plays a sample from storage, with the option to "override" any samples that are already playing. This method allows you to specify which channel the sample will play on (only available when override is set to TRUE). If an error occurs, will return -1 and emit a text error on stderr.
|
|
|
Sets the volume using SDL_Mixer. Max is 128. Allows you to set the volume of sound effects, from 0 (mute) to 128 (loudest). SDL dependent.
|
1.4.6