Used to control a Sound_effect after it is started playing on a Mixer.
This is returned by Mixer::play_effect.
Definition at line 391 of file ge211_audio.hxx.
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. | |
| void | set_volume (double unit_value) |
| Sets the playing sound effect's volume as a number from 0.0 to 1.0. | |
|
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.
Definition at line 400 of file ge211_audio.hxx.
| const Sound_effect & get_effect | ( | ) | const |
Gets the Sound_effect being played by this handle.
!empty(), undefined behavior if violated. Definition at line 239 of file ge211_audio.cxx.
| 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 244 of file ge211_audio.cxx.
|
explicit |
Recognizes a non-empty sound effect handle.
Equivalent to !empty().
Definition at line 437 of file ge211_audio.cxx.
| 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 339 of file ge211_audio.cxx.
| 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 319 of file ge211_audio.cxx.
| 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 359 of file ge211_audio.cxx.