#include <soundbuffer.h>
Public Member Functions | |
Construction | |
| CL_SoundBuffer () | |
| Construct sound buffer. | |
| CL_SoundBuffer (const CL_String &res_id, CL_ResourceManager *manager) | |
| CL_SoundBuffer (CL_SoundProvider *provider) | |
| CL_SoundBuffer (const CL_String &fullname, bool streamed=false, const CL_String &format=cl_text("")) | |
| CL_SoundBuffer (const CL_String &filename, bool streamed, const CL_VirtualDirectory &directory, const CL_String &type=cl_text("")) | |
| CL_SoundBuffer (CL_IODevice &file, bool streamed, const CL_String &type) | |
| CL_SoundBuffer (const CL_SoundBuffer ©) | |
| Constructs a SoundBuffer. | |
| virtual | ~CL_SoundBuffer () |
Attributes | |
| CL_SoundProvider * | get_provider () const |
| Returns the sound provider to be used for playback. | |
| float | get_volume () const |
| Returns the start/default volume used when the buffer is played. | |
| float | get_pan () const |
| Returns the default panning position when the buffer is played. | |
| bool | is_null () |
| Is Null. | |
Operations | |
| void | set_volume (float new_volume) |
| Sets the volume of the sound buffer in a relative measure (0->1). | |
| void | set_pan (float new_pan) |
| Sets the panning of the sound buffer played in measures from -1 -> 1. | |
| void | add_filter (CL_SoundFilter &filter) |
| Adds the sound filter to the sound buffer. | |
| void | remove_filter (CL_SoundFilter &filter) |
| Remove the sound filter from the sound buffer. | |
| CL_SoundBuffer_Session | play (bool looping=false, CL_SoundOutput *output=0) |
| Plays the soundbuffer on the specified soundcard. | |
| CL_SoundBuffer_Session | prepare (bool looping=false, CL_SoundOutput *output=0) |
| Prepares the soundbuffer for playback on the specified soundcard. | |
The CL_SoundBuffer class represents a sample in ClanLib. It can either be static or streamed. The soundbuffer gets its sample data from a soundprovider, that is passed during construction.
|
|
Construct sound buffer. A sound buffer can be constructed either as static or streamed. If the sound buffer is loaded from resources, the buffer type is determined by the resource option 'stream' associated with the resource. CL_SoundBuffer's internals are reference counted, so the copy constructor will create a new soundbuffer object which shares the same buffer as the original one. This means that if the copy is modified, the original is affected as well. If delete_provider is true, the provider will be deleted when the soundbuffer is deleted. |
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
Constructs a SoundBuffer.
|
|
|
|
|
|
Adds the sound filter to the sound buffer.
|
|
|
Returns the default panning position when the buffer is played.
|
|
|
Returns the sound provider to be used for playback.
|
|
|
Returns the start/default volume used when the buffer is played.
|
|
|
Is Null.
|
|
||||||||||||
|
Plays the soundbuffer on the specified soundcard.
|
|
||||||||||||
|
Prepares the soundbuffer for playback on the specified soundcard.
|
|
|
Remove the sound filter from the sound buffer.
|
|
|
Sets the panning of the sound buffer played in measures from -1 -> 1. Setting the pan with a value of -1 will pan the sound buffer to the extreme left (left speaker only), 1 will pan the sound buffer to the extreme right (right speaker only).
|
|
|
Sets the volume of the sound buffer 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".
|
1.4.6