zenilib
0.5.3.0
|
#include <Sound_Stream_AL.h>
Public Member Functions | |
Sound_Stream_AL (const String &path, const bool &looping_=false, const float &time_=0.0f) | |
~Sound_Stream_AL () | |
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 |
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 is paused. More... | |
bool | is_playing () const |
Check to see if the Sound_Source is playing. More... | |
bool | is_stopped () const |
Check to see if the Sound_Source is stopped. More... | |
void | pause () |
Pause the Sound_Source. More... | |
void | play () |
Begin playing or unpause the Sound_Source. 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. (Essentially the same as pause but resets the current time.) More... | |
void | update () |
Definition at line 12 of file Sound_Stream_AL.h.
Zeni::Sound_Stream_AL::Sound_Stream_AL | ( | const String & | path, |
const bool & | looping_ = false , |
||
const float & | time_ = 0.0f |
||
) |
Definition at line 11 of file Sound_Stream_AL.cpp.
References AL_DIRECTION, AL_FORMAT_MONO16, AL_FORMAT_STEREO16, AL_NO_ERROR, AL_POSITION, AL_ROLLOFF_FACTOR, AL_SOURCE_RELATIVE, AL_TRUE, AL_VELOCITY, Zeni::Sound_Renderer_AL::alGenBuffers(), Zeni::Sound_Renderer_AL::alGenSources(), Zeni::Sound_Renderer_AL::alGetError(), Zeni::Sound_Renderer_AL::alSourcef(), Zeni::Sound_Renderer_AL::alSourcefv(), Zeni::Sound_Renderer_AL::alSourcei(), vorbis_info::channels, error, Zeni::Sound_Renderer_AL::errorString(), Zeni::get_Sound(), ov_comment(), ov_fopen(), ov_info(), and ov_time_seek().
Zeni::Sound_Stream_AL::~Sound_Stream_AL | ( | ) |
Definition at line 50 of file Sound_Stream_AL.cpp.
float Zeni::Sound_Stream_AL::get_duration | ( | ) | const |
Get the duration of the Sound_Buffer in seconds.
Definition at line 92 of file Sound_Stream_AL.cpp.
References ov_time_total().
float Zeni::Sound_Stream_AL::get_gain | ( | ) | const |
Get the gain.
Definition at line 102 of file Sound_Stream_AL.cpp.
References AL_GAIN, Zeni::Sound_Renderer_AL::alGetSourcef(), Zeni::get_Sound(), and ZENI_DEFAULT_GAIN.
Referenced by Zeni::Sound::get_BGM_gain(), and Zeni::Sound::set_BGM().
float Zeni::Sound_Stream_AL::get_max_distance | ( | ) | const |
Definition at line 136 of file Sound_Stream_AL.cpp.
References AL_MAX_DISTANCE, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_MAX_SOUND_DISTANCE.
Referenced by Zeni::Sound::set_BGM().
float Zeni::Sound_Stream_AL::get_pitch | ( | ) | const |
Get the pitch.
Definition at line 96 of file Sound_Stream_AL.cpp.
References AL_PITCH, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_PITCH.
Referenced by Zeni::Sound::get_BGM_pitch(), and Zeni::Sound::set_BGM().
Point3f Zeni::Sound_Stream_AL::get_position | ( | ) | const |
Get the position of the Sound_Buffer.
Definition at line 110 of file Sound_Stream_AL.cpp.
References AL_POSITION, and Zeni::Sound_Renderer_AL::alGetSourcefv().
Referenced by Zeni::Sound::get_listener_position(), and Zeni::Sound::set_BGM().
float Zeni::Sound_Stream_AL::get_reference_distance | ( | ) | const |
Definition at line 130 of file Sound_Stream_AL.cpp.
References AL_REFERENCE_DISTANCE, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_REFERENCE_DISTANCE.
Referenced by Zeni::Sound::set_BGM().
float Zeni::Sound_Stream_AL::get_rolloff | ( | ) | const |
Definition at line 142 of file Sound_Stream_AL.cpp.
References AL_ROLLOFF_FACTOR, Zeni::Sound_Renderer_AL::alGetSourcef(), and ZENI_DEFAULT_ROLLOFF.
Referenced by Zeni::Sound::set_BGM().
float Zeni::Sound_Stream_AL::get_time | ( | ) | const |
Get the current position in the Sound_Buffer, offset in seconds.
Definition at line 126 of file Sound_Stream_AL.cpp.
References ov_time_tell().
Referenced by Zeni::Sound::get_BGM_time().
Vector3f Zeni::Sound_Stream_AL::get_velocity | ( | ) | const |
Get the velocity of the Sound_Buffer.
Definition at line 116 of file Sound_Stream_AL.cpp.
References AL_VELOCITY, and Zeni::Sound_Renderer_AL::alGetSourcefv().
Referenced by Zeni::Sound::get_listener_velocity(), and Zeni::Sound::set_BGM().
bool Zeni::Sound_Stream_AL::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 122 of file Sound_Stream_AL.cpp.
Referenced by Zeni::Sound::is_BGM_looping(), and Zeni::Sound::set_BGM().
bool Zeni::Sound_Stream_AL::is_paused | ( | ) | const |
Check to see if the Sound_Source is paused.
Definition at line 171 of file Sound_Stream_AL.cpp.
References AL_PAUSED, AL_SOURCE_STATE, and Zeni::Sound_Renderer_AL::alGetSourcei().
Referenced by Zeni::Sound::paused_BGM().
bool Zeni::Sound_Stream_AL::is_playing | ( | ) | const |
Check to see if the Sound_Source is playing.
Definition at line 165 of file Sound_Stream_AL.cpp.
References AL_PLAYING, AL_SOURCE_STATE, and Zeni::Sound_Renderer_AL::alGetSourcei().
Referenced by Zeni::Sound::playing_BGM(), and Zeni::Sound::set_BGM().
bool Zeni::Sound_Stream_AL::is_stopped | ( | ) | const |
Check to see if the Sound_Source is stopped.
Definition at line 177 of file Sound_Stream_AL.cpp.
References AL_SOURCE_STATE, AL_STOPPED, and Zeni::Sound_Renderer_AL::alGetSourcei().
Referenced by Zeni::Sound::stopped_BGM().
void Zeni::Sound_Stream_AL::pause | ( | ) |
Pause the Sound_Source.
Definition at line 157 of file Sound_Stream_AL.cpp.
References Zeni::Sound_Renderer_AL::alSourcePause().
Referenced by Zeni::Sound::pause_BGM().
void Zeni::Sound_Stream_AL::play | ( | ) |
Begin playing or unpause the Sound_Source.
Definition at line 148 of file Sound_Stream_AL.cpp.
References Zeni::Sound_Renderer_AL::alSourcePlay(), OggVorbis_File::end, OggVorbis_File::offset, ov_raw_seek(), and update().
Referenced by Zeni::Sound::play_BGM(), and Zeni::Sound::set_BGM().
void Zeni::Sound_Stream_AL::set_gain | ( | const float & | gain = ZENI_DEFAULT_GAIN | ) |
Set the gain.
Definition at line 58 of file Sound_Stream_AL.cpp.
References AL_GAIN, Zeni::Sound_Renderer_AL::alSourcef(), and Zeni::get_Sound().
Referenced by Zeni::Sound::set_BGM(), and Zeni::Sound::set_BGM_gain().
Set whether the Sound_Buffer should loop back to the start once it is done playing.
Definition at line 71 of file Sound_Stream_AL.cpp.
Referenced by Zeni::Sound::set_BGM_looping().
void Zeni::Sound_Stream_AL::set_max_distance | ( | const float & | max_distance = ZENI_DEFAULT_MAX_SOUND_DISTANCE | ) |
Definition at line 84 of file Sound_Stream_AL.cpp.
References AL_MAX_DISTANCE, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound::set_BGM().
void Zeni::Sound_Stream_AL::set_pitch | ( | const float & | pitch = ZENI_DEFAULT_PITCH | ) |
Set the pitch.
Definition at line 54 of file Sound_Stream_AL.cpp.
References AL_PITCH, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound::set_BGM(), and Zeni::Sound::set_BGM_pitch().
Set the position of the Sound_Source_HW.
Definition at line 63 of file Sound_Stream_AL.cpp.
References AL_POSITION, and Zeni::Sound_Renderer_AL::alSourcefv().
Referenced by Zeni::Sound::set_BGM(), and Zeni::Sound::set_listener_position().
void Zeni::Sound_Stream_AL::set_reference_distance | ( | const float & | reference_distance = ZENI_DEFAULT_REFERENCE_DISTANCE | ) |
Definition at line 80 of file Sound_Stream_AL.cpp.
References AL_REFERENCE_DISTANCE, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound::set_BGM().
void Zeni::Sound_Stream_AL::set_rolloff | ( | const float & | rolloff = ZENI_DEFAULT_ROLLOFF | ) |
Definition at line 88 of file Sound_Stream_AL.cpp.
References AL_ROLLOFF_FACTOR, and Zeni::Sound_Renderer_AL::alSourcef().
Referenced by Zeni::Sound::set_BGM().
Set the current position in the Sound_Buffer, offset in seconds.
Definition at line 75 of file Sound_Stream_AL.cpp.
References Zeni::get_Sound(), and ov_time_seek().
Referenced by Zeni::Sound::set_BGM_time().
Set the velocity of the Sound_Source_HW for the doppler effect.
Definition at line 67 of file Sound_Stream_AL.cpp.
References AL_VELOCITY, and Zeni::Sound_Renderer_AL::alSourcefv().
Referenced by Zeni::Sound::set_BGM(), and Zeni::Sound::set_listener_velocity().
void Zeni::Sound_Stream_AL::stop | ( | ) |
Stop the Sound_Source. (Essentially the same as pause but resets the current time.)
Definition at line 161 of file Sound_Stream_AL.cpp.
References Zeni::Sound_Renderer_AL::alSourceStop().
Referenced by Zeni::Sound::stop_BGM().
void Zeni::Sound_Stream_AL::update | ( | ) |
Definition at line 183 of file Sound_Stream_AL.cpp.
References AL_BUFFERS_PROCESSED, Zeni::Sound_Renderer_AL::alGetSourcei(), Zeni::Sound_Renderer_AL::alSourceQueueBuffers(), Zeni::Sound_Renderer_AL::alSourceUnqueueBuffers(), OggVorbis_File::end, and OggVorbis_File::offset.
Referenced by play(), and Zeni::Sound::update().