Used to control a Sound_effect after it is started playing on a Mixer.
This is returned by Mixer::play_effect(Sound_effect, double).
Definition at line 328 of file ge211_audio.h.
Public Member Functions | |
Sound_effect_handle () | |
Default-constructs the empty sound effect handle. More... | |
bool | empty () const |
Recognizes the empty sound effect handle. | |
operator bool () const | |
Recognizes a non-empty sound effect handle. More... | |
void | pause () |
Pauses the effect. More... | |
void | resume () |
Unpauses the effect. More... | |
void | stop () |
Stops the effect from playing and detaches it. More... | |
const Sound_effect & | get_effect () const |
Gets the Sound_effect being played by this handle. More... | |
Mixer::State | get_state () const |
Gets the state of this effect. More... | |
double | get_volume () const |
Returns the playing sound effect's volume as a number from 0.0 to 1.0. More... | |
void | set_volume (double unit_value) |
Sets the playing sound effect's volume as a number from 0.0 to 1.0. More... | |
|
inline |
Default-constructs the empty sound effect handle.
The empty handle is not associated with a channel, and it is an error to attempt to perform operations on it.
To get a non-empty Sound_effect_handle, play a Sound_effect with Mixer::play_effect(Sound_effect, double).
Definition at line 337 of file ge211_audio.h.
const Sound_effect & get_effect | ( | ) | const |
Gets the Sound_effect being played by this handle.
!empty()
, undefined behavior if violated. Definition at line 200 of file ge211_audio.cpp.
Mixer::State get_state | ( | ) | const |
Gets the state of this effect.
As with the mixer's music state, the state of a side effect channel only changes synchronously, either with client requests, or between frames, in the case where the sound effect finishes and is detached.
!empty()
, undefined behavior if violated. Definition at line 205 of file ge211_audio.cpp.
double get_volume | ( | ) | const |
Returns the playing sound effect's volume as a number from 0.0 to 1.0.
Definition at line 393 of file ge211_audio.cpp.
operator bool | ( | ) | const |
Recognizes a non-empty sound effect handle.
Equivalent to !empty()
.
Definition at line 382 of file ge211_audio.cpp.
void pause | ( | ) |
Pauses the effect.
!empty()
, undefined behavior if violated.get_state()
is either playing
or paused
, throws exceptions::Client_logic_error if violated. Definition at line 284 of file ge211_audio.cpp.
void resume | ( | ) |
Unpauses the effect.
!empty()
, undefined behavior if violated.get_state()
is either playing
or paused
, throws exceptions::Client_logic_error if violated. Definition at line 264 of file ge211_audio.cpp.
void set_volume | ( | double | unit_value | ) |
Sets the playing sound effect's volume as a number from 0.0 to 1.0.
Definition at line 401 of file ge211_audio.cpp.
void stop | ( | ) |
Stops the effect from playing and detaches it.
!empty()
, undefined behavior if violated.get_state()
is either playing
or paused
, throws exceptions::Client_logic_error if violated. Definition at line 304 of file ge211_audio.cpp.