SoundBuffer_Session provides control over a playing soundeffect. More...
#include <soundbuffer_session.h>
Public Member Functions | |
Construction | |
| SoundBuffer_Session () | |
| Creates a null instance. More... | |
| virtual | ~SoundBuffer_Session () |
Attributes | |
| bool | is_null () const |
| Returns true if this object is invalid. More... | |
| void | throw_if_null () const |
| Throw an exception if this object is invalid. More... | |
| int | get_position () const |
| Returns the current sample position of the playback. More... | |
| float | get_position_relative () const |
| Returns the sample position relative to the full length. More... | |
| int | get_length () const |
| Returns the total length (in samples) of the sound buffer played. More... | |
| int | get_frequency () const |
| Returns the frequency of the session. More... | |
| float | get_volume () const |
| Returns the linear relative volume of the soundeffect. More... | |
| float | get_pan () const |
| Returns the current pan (in a measure from -1 -> 1). More... | |
| bool | get_looping () const |
| Returns whether this session loops. More... | |
| bool | is_playing () |
| Returns true if the session is playing. More... | |
Operations | |
| bool | set_position (int new_pos) |
| Sets the session position to 'new_pos'. More... | |
| bool | set_position_relative (float new_pos) |
| Sets the relative position of the session. More... | |
| bool | set_end_position (int pos) |
| Sets the end position within the current stream. More... | |
| void | set_frequency (int new_freq) |
| Sets the frequency of the session. More... | |
| void | set_volume (float new_volume) |
| Sets the volume of the session in a relative measure (0->1) More... | |
| void | set_pan (float new_pan) |
| Sets the panning of the session played in measures from -1 -> 1. More... | |
| void | play () |
| Starts playback of the session. More... | |
| void | stop () |
| Stops playback of the session. More... | |
| void | set_looping (bool loop) |
| Determines whether this session should loop. More... | |
| void | add_filter (SoundFilter &filter) |
| Adds the sound filter to the session. See SoundFilter for details. More... | |
| void | remove_filter (SoundFilter &filter) |
| Remove the sound filter from the session. See SoundFilter for details. More... | |
Implementation | |
| class | SoundBuffer |
| class | SoundOutput_Impl |
SoundBuffer_Session provides control over a playing soundeffect.
Whenever a soundbuffer is played, it returns a SoundBuffer_Session class, which can be used to control the sound (its volume, pitch, pan, position). It can also be used to retrigger the sound or to stop it.