Home | All Classes | Grouped Classes | Index | Search

Class CL_SoundBuffer_Session

CL_SoundBuffer_Session provides control over a playing soundeffect. More...

Derived from: none
Derived by: none
Group: Sound (Audio Mixing)

#include <ClanLib/sound.h>

Construction:

CL_SoundBuffer_Session

Creates a soundbuffer session not attached to any object.

Operators:

operator =

Copy operator

Attributes:

get_handle

Get Handle

get_card

Returns a pointer to the card on which the soundbuffer controlled is played/playing.

get_position

Returns the current position of the soundeffect

get_position_relative

Returns the soundeffects relative position, compared to the total length of the soundeffect.

set_position

Sets the soundeffects position to 'new_pos'.

set_position_relative

Sets the relative position of the soundeffect.

get_length

Returns the total length of the soundeffect played.

get_frequency

Returns the frequency of the soundeffect played.

set_frequency

Sets the frequency of the soundeffect played.

get_volume

Returns the linear relative volume of the soundeffect.

get_pan

Returns the current pan (in a measure from -1 -> 1).

Operations:

set_volume

Sets the volume of the soundeffect in a relative measure (0->1)

set_pan

Sets the panning of the soundeffect played in measures from -1 -> 1

play

Starts playback of the session.

stop

Stops playback of the session.

is_playing

Returns true if the session is playing

set_looping

Determines whether this session should loop

add_filter

Adds the sound filter to the session. See CL_SoundFilter for details.

remove_filter

Remove the sound filter from the session. See CL_SoundFilter for details.

Detailed description:

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 of course also be used to retrigger the sound or to stop it. The soundeffect is stored in the layer1 soundmanager until all references to the sound played are removed, meaning that the soundeffect (session) will be ready to play and remember its state and settings (volume, frequency...) until no CL_SoundBuffer_Session refers to it, via a soundbuffer session reference system.



Questions or comments, write to the
ClanLib mailing list.