Gosu
|
An instance of a Sample playing. More...
Public Member Functions | |
SampleInstance (int handle, int extra) | |
Called internally by Sample, do not use. More... | |
bool | playing () const |
bool | paused () const |
void | pause () |
Pauses this instance to be resumed afterwards. More... | |
void | resume () |
void | stop () |
Stops this instance of a sound being played. More... | |
void | change_volume (double volume) |
void | change_pan (double pan) |
void | change_speed (double speed) |
An instance of a Sample playing.
Can be used to stop sounds dynamically, or to check if they are finished. It is recommended that you throw away sample instances if possible, as they could accidentally refer to other sounds being played after a very long time has passed.
Gosu::SampleInstance::SampleInstance | ( | int | handle, |
int | extra | ||
) |
Called internally by Sample, do not use.
void Gosu::SampleInstance::change_pan | ( | double | pan | ) |
pan | Can be anything from -1.0 (left) to 1.0 (right). |
void Gosu::SampleInstance::change_speed | ( | double | speed | ) |
speed | Playback speed is only limited by FMOD's capabilities and can accept very high or low values. Use 1.0 for normal playback speed. |
void Gosu::SampleInstance::change_volume | ( | double | volume | ) |
volume | Can be anything from 0.0 (silence) to 1.0 (full volume). |
void Gosu::SampleInstance::pause | ( | ) |
Pauses this instance to be resumed afterwards.
It will still keep a channel filled while paused.
bool Gosu::SampleInstance::paused | ( | ) | const |
bool Gosu::SampleInstance::playing | ( | ) | const |
void Gosu::SampleInstance::resume | ( | ) |
void Gosu::SampleInstance::stop | ( | ) |
Stops this instance of a sound being played.
Calling this twice, or too late, does not do any harm.