zenilib
0.5.3.0
|
#include <Sound_Source.h>
Public Types | |
enum | STATE { STOPPED, PAUSED, PLAYING } |
Public Member Functions | |
const Sound_Buffer & | get_buffer () const |
Get the Sound_Buffer. More... | |
float | get_duration () const |
Get the duration of the Sound_Buffer in seconds. More... | |
float | get_gain () const |
Get the gain. More... | |
float | get_max_distance () const |
float | get_pitch () const |
Get the pitch. More... | |
Point3f | get_position () const |
Get the position of the Sound_Buffer. More... | |
float | get_reference_distance () const |
float | get_rolloff () const |
STATE | get_state () const |
Get PLAYING/PAUSED/STOPPED. More... | |
float | get_time () const |
Get the current position in the Sound_Buffer, offset in seconds. More... | |
Vector3f | get_velocity () const |
Get the velocity of the Sound_Buffer. More... | |
bool | is_looping () const |
Check to see if the Sound_Buffer is set to loop back to the start once it is done playing. More... | |
bool | is_paused () const |
Check to see if the Sound_Source_HW is paused. More... | |
bool | is_playing () const |
Check to see if the Sound_Source_HW is playing. More... | |
bool | is_stopped () const |
Check to see if the Sound_Source_HW is stopped. More... | |
void | pause () |
Pause the Sound_Source_HW. More... | |
void | play () |
Begin playing or unpause the Sound_Source_HW. More... | |
void | set_buffer (const Sound_Buffer &buffer) |
Set the Sound_Buffer to be played. More... | |
void | set_gain (const float &gain=ZENI_DEFAULT_GAIN) |
Set the gain. More... | |
void | set_looping (const bool &looping) |
Set whether the Sound_Buffer should loop back to the start once it is done playing. More... | |
void | set_max_distance (const float &max_distance=ZENI_DEFAULT_MAX_SOUND_DISTANCE) |
void | set_pitch (const float &pitch=ZENI_DEFAULT_PITCH) |
Set the pitch. More... | |
void | set_position (const Point3f &position) |
Set the position of the Sound_Source_HW. More... | |
void | set_reference_distance (const float &reference_distance=ZENI_DEFAULT_REFERENCE_DISTANCE) |
void | set_rolloff (const float &rolloff=ZENI_DEFAULT_ROLLOFF) |
void | set_time (const float &time) |
Set the current position in the Sound_Buffer, offset in seconds. More... | |
void | set_velocity (const Vector3f &velocity) |
Set the velocity of the Sound_Source_HW for the doppler effect. More... | |
void | stop () |
Stop the Sound_Source_HW. (Essentially the same as pause but resets the current time.) More... | |
Friends | |
class | Sound_Source_Pool |
Plays Sound Data.
This Sound_Source is directly tied to the OpenAL driver "hardware". This is the original Zeni::Sound_Source, which has been replaced by a much saner frontend to Sound_Source_Pool (which in turn manages the Sound_Source_HW objects).
Contact: bazal d@ze nipex .com
Definition at line 69 of file Sound_Source.h.
Enumerator | |
---|---|
STOPPED | |
PAUSED | |
PLAYING |
Definition at line 87 of file Sound_Source.h.
const Sound_Buffer & Zeni::Sound_Source_HW::get_buffer | ( | ) | const |
float Zeni::Sound_Source_HW::get_duration | ( | ) | const |
Get the duration of the Sound_Buffer in seconds.
Definition at line 250 of file Sound_Source.cpp.
References Zeni::Sound_Buffer::get_duration(), and Zeni::get_Sound().
Referenced by Zeni::Sound_Source::get_duration().
float Zeni::Sound_Source_HW::get_gain | ( | ) | const |
Get the gain.
Definition at line 270 of file Sound_Source.cpp.
References AL_GAIN, Zeni::Sound_Renderer_AL::alGetSourcef(), Zeni::get_Sound(), and ZENI_DEFAULT_GAIN.
Referenced by set_buffer().
float Zeni::Sound_Source_HW::get_max_distance | ( | ) | const |
Definition at line 346 of file Sound_Source.cpp.
References AL_MAX_DISTANCE, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_MAX_SOUND_DISTANCE.
float Zeni::Sound_Source_HW::get_pitch | ( | ) | const |
Get the pitch.
Definition at line 262 of file Sound_Source.cpp.
References AL_PITCH, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_PITCH.
Point3f Zeni::Sound_Source_HW::get_position | ( | ) | const |
Get the position of the Sound_Buffer.
Definition at line 287 of file Sound_Source.cpp.
References AL_POSITION, and Zeni::Sound_Renderer_AL::alGetSourcefv().
float Zeni::Sound_Source_HW::get_reference_distance | ( | ) | const |
Definition at line 338 of file Sound_Source.cpp.
References AL_REFERENCE_DISTANCE, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_REFERENCE_DISTANCE.
float Zeni::Sound_Source_HW::get_rolloff | ( | ) | const |
Definition at line 354 of file Sound_Source.cpp.
References AL_ROLLOFF_FACTOR, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_ROLLOFF.
Sound_Source_HW::STATE Zeni::Sound_Source_HW::get_state | ( | ) | const |
Get PLAYING/PAUSED/STOPPED.
Definition at line 402 of file Sound_Source.cpp.
References AL_PAUSED, AL_PLAYING, AL_SOURCE_STATE, AL_STOPPED, Zeni::Sound_Renderer_AL::alGetSourcei(), Zeni::get_Sound(), PAUSED, PLAYING, and STOPPED.
Referenced by is_paused(), is_playing(), and is_stopped().
float Zeni::Sound_Source_HW::get_time | ( | ) | const |
Get the current position in the Sound_Buffer, offset in seconds.
Definition at line 321 of file Sound_Source.cpp.
References AL_SEC_OFFSET, Zeni::Sound_Renderer_AL::alGetSourcef(), and Zeni::get_Sound().
Referenced by Zeni::Sound_Source::get_time().
Vector3f Zeni::Sound_Source_HW::get_velocity | ( | ) | const |
Get the velocity of the Sound_Buffer.
Definition at line 295 of file Sound_Source.cpp.
References AL_VELOCITY, and Zeni::Sound_Renderer_AL::alGetSourcefv().
bool Zeni::Sound_Source_HW::is_looping | ( | ) | const |
Check to see if the Sound_Buffer is set to loop back to the start once it is done playing.
Definition at line 303 of file Sound_Source.cpp.
References AL_FALSE, AL_LOOPING, Zeni::Sound_Renderer_AL::alGetSourcei(), and Zeni::get_Sound().
Referenced by set_buffer().
bool Zeni::Sound_Source_HW::is_paused | ( | ) | const |
Check to see if the Sound_Source_HW is paused.
Definition at line 429 of file Sound_Source.cpp.
References get_state(), and PAUSED.
bool Zeni::Sound_Source_HW::is_playing | ( | ) | const |
Check to see if the Sound_Source_HW is playing.
Definition at line 425 of file Sound_Source.cpp.
References get_state(), and PLAYING.
bool Zeni::Sound_Source_HW::is_stopped | ( | ) | const |
Check to see if the Sound_Source_HW is stopped.
Definition at line 433 of file Sound_Source.cpp.
References get_state(), and STOPPED.
void Zeni::Sound_Source_HW::pause | ( | ) |
Pause the Sound_Source_HW.
Definition at line 376 of file Sound_Source.cpp.
References Zeni::Sound_Renderer_AL::alSourcePause(), and Zeni::get_Sound().
Referenced by Zeni::Sound_Source::pause().
void Zeni::Sound_Source_HW::play | ( | ) |
Begin playing or unpause the Sound_Source_HW.
Definition at line 362 of file Sound_Source.cpp.
References Zeni::Sound_Renderer_AL::alSourcePlay(), Zeni::get_Sound(), and ZENI_LOGD().
Referenced by Zeni::Sound_Source::play().
void Zeni::Sound_Source_HW::set_buffer | ( | const Sound_Buffer & | buffer | ) |
Set the Sound_Buffer to be played.
Definition at line 113 of file Sound_Source.cpp.
References AL_BUFFER, Zeni::Sound_Renderer_AL::alSourcei(), get_gain(), Zeni::Sound::get_Renderer(), Zeni::get_Sound(), and is_looping().
Referenced by Zeni::Sound_Source::set_buffer().
void Zeni::Sound_Source_HW::set_gain | ( | const float & | gain = ZENI_DEFAULT_GAIN | ) |
Set the gain.
Definition at line 144 of file Sound_Source.cpp.
References AL_GAIN, Zeni::Sound_Renderer_AL::alSourcef(), Zeni::get_Sound(), and max.
Referenced by Zeni::Sound_Source::set_gain().
Set whether the Sound_Buffer should loop back to the start once it is done playing.
Definition at line 181 of file Sound_Source.cpp.
References AL_LOOPING, Zeni::Sound_Renderer_AL::alSourcei(), and Zeni::get_Sound().
Referenced by Zeni::Sound_Source::set_looping().
void Zeni::Sound_Source_HW::set_max_distance | ( | const float & | max_distance = ZENI_DEFAULT_MAX_SOUND_DISTANCE | ) |
Definition at line 225 of file Sound_Source.cpp.
References AL_MAX_DISTANCE, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound_Source::set_max_distance().
void Zeni::Sound_Source_HW::set_pitch | ( | const float & | pitch = ZENI_DEFAULT_PITCH | ) |
Set the pitch.
Definition at line 134 of file Sound_Source.cpp.
References AL_PITCH, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound_Source::set_pitch().
Set the position of the Sound_Source_HW.
Definition at line 161 of file Sound_Source.cpp.
References AL_POSITION, and Zeni::Sound_Renderer_AL::alSourcefv().
Referenced by Zeni::Sound_Source::set_position().
void Zeni::Sound_Source_HW::set_reference_distance | ( | const float & | reference_distance = ZENI_DEFAULT_REFERENCE_DISTANCE | ) |
Definition at line 215 of file Sound_Source.cpp.
References AL_REFERENCE_DISTANCE, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound_Source::set_reference_distance().
void Zeni::Sound_Source_HW::set_rolloff | ( | const float & | rolloff = ZENI_DEFAULT_ROLLOFF | ) |
Definition at line 235 of file Sound_Source.cpp.
References AL_ROLLOFF_FACTOR, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound_Source::set_rolloff().
Set the current position in the Sound_Buffer, offset in seconds.
Definition at line 198 of file Sound_Source.cpp.
References AL_SEC_OFFSET, Zeni::Sound_Renderer_AL::alSourcef(), and Zeni::get_Sound().
Referenced by Zeni::Sound_Source::set_time().
Set the velocity of the Sound_Source_HW for the doppler effect.
Definition at line 171 of file Sound_Source.cpp.
References AL_VELOCITY, and Zeni::Sound_Renderer_AL::alSourcefv().
Referenced by Zeni::Sound_Source::set_velocity().
void Zeni::Sound_Source_HW::stop | ( | ) |
Stop the Sound_Source_HW. (Essentially the same as pause but resets the current time.)
Definition at line 389 of file Sound_Source.cpp.
References Zeni::Sound_Renderer_AL::alSourceStop(), and Zeni::get_Sound().
Referenced by Zeni::Sound_Source::stop().
|
friend |
Definition at line 70 of file Sound_Source.h.