#include <soundbuffer_session.h>
Implementation | |
| class | CL_SoundBuffer |
| class | CL_SoundOutput_Impl |
Public Member Functions | |
Construction | |
| CL_SoundBuffer_Session () | |
| Creates a soundbuffer session. | |
| CL_SoundBuffer_Session (const CL_SoundBuffer_Session ©) | |
| Constructs a SoundBuffer Session. | |
| virtual | ~CL_SoundBuffer_Session () |
Attributes | |
| int | get_position () const |
| Returns the current sample position of the playback. | |
| float | get_position_relative () const |
| Returns the sample position relative to the full length. | |
| int | get_length () const |
| Returns the total length (in samples) of the sound buffer played. | |
| int | get_frequency () const |
| Returns the frequency of the session. | |
| float | get_volume () const |
| Returns the linear relative volume of the soundeffect. | |
| float | get_pan () const |
| Returns the current pan (in a measure from -1 -> 1). | |
| bool | get_looping () const |
| Returns whether this session loops. | |
| bool | is_playing () |
| Returns true if the session is playing. | |
Operations | |
| bool | set_position (int new_pos) |
| Sets the session position to 'new_pos'. | |
| bool | set_position_relative (float new_pos) |
| Sets the relative position of the session. | |
| void | set_frequency (int new_freq) |
| Sets the frequency of the session. | |
| void | set_volume (float new_volume) |
| Sets the volume of the session in a relative measure (0->1). | |
| void | set_pan (float new_pan) |
| Sets the panning of the session played in measures from -1 -> 1. | |
| void | play () |
| Starts playback of the session. | |
| void | stop () |
| Stops playback of the session. | |
| void | set_looping (bool loop) |
| Determines whether this session should loop. | |
| void | add_filter (CL_SoundFilter &filter) |
| Adds the sound filter to the session. See CL_SoundFilter for details. | |
| void | remove_filter (CL_SoundFilter &filter) |
| Remove the sound filter from the session. See CL_SoundFilter for details. | |
Whenever a soundbuffer is played, it returns a CL_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.
|
|
Creates a soundbuffer session.
|
|
|
Constructs a SoundBuffer Session.
|
|
|
|
|
|
Adds the sound filter to the session. See CL_SoundFilter for details.
|
|
|
Returns the frequency of the session.
|
|
|
Returns the total length (in samples) of the sound buffer played. Value returned will be -1 if the length is unknown (in case of non-static soundeffects like streamed sound) |
|
|
Returns whether this session loops.
|
|
|
Returns the current pan (in a measure from -1 -> 1). -1 means the soundeffect is only playing in the left speaker, and 1 means the soundeffect is only playing in the right speaker. |
|
|
Returns the current sample position of the playback.
|
|
|
Returns the sample position relative to the full length. The value returned will be between 0 and 1, where 0 means the session is at the beginning, and 1 means that the soundeffect has reached the end. |
|
|
Returns the linear relative volume of the soundeffect. 0 means the soundeffect is muted, 1 means the soundeffect is playing at "max" volume. |
|
|
Returns true if the session is playing.
|
|
|
Starts playback of the session.
|
|
|
Remove the sound filter from the session. See CL_SoundFilter for details.
|
|
|
Sets the frequency of the session.
|
|
|
Determines whether this session should loop.
|
|
|
Sets the panning of the session played in measures from -1 -> 1. Setting the pan with a value of -1 will pan the session to the extreme left (left speaker only), 1 will pan the session to the extreme right (right speaker only).
|
|
|
Sets the session position to 'new_pos'. The new position of the session.
|
|
|
Sets the relative position of the session. Value must be between 0 and 1, where 0 sets the session to the beginning, and 1 sets it to the end of the sound buffer.
|
|
|
Sets the volume of the session in a relative measure (0->1). A value of 0 will effectively mute the sound (although it will still be sampled), and a value of 1 will set the volume to "max".
|
|
|
Stops playback of the session.
|
|
|
|
|
|
|
1.4.6