zenilib
0.5.3.0
|
#include <Sound.h>
Inherits Zeni::Singleton< Sound >.
Public Member Functions | |
float | get_BGM_gain () |
Get the gain. More... | |
float | get_BGM_pitch () |
Get the pitch. More... | |
float | get_BGM_time () |
Get the current position in the BGM, offset in seconds. More... | |
Sound_Buffer & | get_Hello_World_Buffer () const |
Initialize m_bgm if needed and return a corresponding Sound_Source. More... | |
std::pair< Vector3f, Vector3f > | get_listener_forward_and_up () const |
Set the orientation of the listener. More... | |
float | get_listener_gain () const |
Get the listener gain. More... | |
Point3f | get_listener_position () const |
Get the position of the listener and BGM. More... | |
Vector3f | get_listener_velocity () const |
Get the velocity of the listener and BGM. More... | |
Sound_Renderer & | get_Renderer () |
Get the current Sound_Renderer. More... | |
bool | is_BGM_looping () |
Check to see if the BGM is set to loop back to the start once it is done playing. More... | |
bool | is_listener_muted () const |
Is the listener muted. More... | |
void | pause_BGM () |
Pause BackGround Music. More... | |
bool | paused_BGM () |
Check to see if BackGround Music is paused. More... | |
void | play_BGM () |
Begin Playing BackGround Music. More... | |
bool | playing_BGM () |
Check to see if BackGround Music is playing. More... | |
void | set_BGM (const String &filename) |
Set BackGround Music. More... | |
void | set_BGM_gain (const float &gain) |
Set the gain. More... | |
void | set_BGM_looping (const bool &looping) |
Set whether the BGM should loop back to the start once it is done playing. More... | |
void | set_BGM_pitch (const float &pitch) |
Set the pitch. More... | |
void | set_BGM_time (const float &time) |
Set the current position in the BGM, offset in seconds. More... | |
void | set_listener_forward_and_up (const Vector3f &forward, const Vector3f &up) |
Set the orientation of the listener. More... | |
void | set_listener_gain (const float &gain) |
Set the listener gain. More... | |
void | set_listener_muted (const bool &muted) |
Set whether the listener is muted. More... | |
void | set_listener_position (const Point3f &position) |
Set the position of the listener and BGM. More... | |
void | set_listener_velocity (const Vector3f &velocity) |
Set the velocity of the listener and BGM for the doppler effect. More... | |
void | stop_BGM () |
Stop BackGround Music. More... | |
bool | stopped_BGM () |
Check to see if BackGround Music is stopped. More... | |
void | update () |
Update background music, as needed. More... | |
Public Member Functions inherited from Zeni::Singleton< Sound > | |
void | fax_post_reinit (Event::Handler *const &handler) |
void | fax_pre_uninit (Event::Handler *const &handler) |
void | give_post_reinit (Event::Handler *const &handler) |
void | give_pre_uninit (Event::Handler *const &handler) |
void | lend_post_reinit (Event::Handler *const &handler) |
void | lend_pre_uninit (Event::Handler *const &handler) |
Friends | |
class | Singleton< Sound > |
Additional Inherited Members | |
Static Public Member Functions inherited from Zeni::Singleton< Sound > | |
static void | completely_destroy () |
static void | destroy () |
static Sound & | get () |
static bool | is_initialized () |
static void | remove_post_reinit (Event::Handler *const &handler) |
static void | remove_pre_uninit (Event::Handler *const &handler) |
Protected Member Functions inherited from Zeni::Singleton< Sound > | |
Singleton () | |
virtual | ~Singleton () |
The Sound Singleton is responsible for initializing and uninitializing OpenAL. It also controls a single Sound_Source that is positioned at the listener's current location so as to allow the playing of background music.
Contact: bazal d@ze nipex .com
|
inline |
Get the gain.
Definition at line 99 of file Sound.hxx.
References Zeni::Sound_Stream_AL::get_gain(), and ZENI_DEFAULT_GAIN.
|
inline |
Get the pitch.
Definition at line 90 of file Sound.hxx.
References Zeni::Sound_Stream_AL::get_pitch(), and ZENI_DEFAULT_PITCH.
|
inline |
Get the current position in the BGM, offset in seconds.
Definition at line 117 of file Sound.hxx.
References Zeni::Sound_Stream_AL::get_time().
Sound_Buffer & Zeni::Sound::get_Hello_World_Buffer | ( | ) | const |
Initialize m_bgm if needed and return a corresponding Sound_Source.
Definition at line 193 of file Sound.cpp.
Referenced by set_BGM().
Set the orientation of the listener.
Definition at line 138 of file Sound.cpp.
References Zeni::Sound_Renderer::get_listener_forward_and_up().
|
inline |
Point3f Zeni::Sound::get_listener_position | ( | ) | const |
Get the position of the listener and BGM.
Definition at line 120 of file Sound.cpp.
References Zeni::Sound_Stream_AL::get_position().
Vector3f Zeni::Sound::get_listener_velocity | ( | ) | const |
Get the velocity of the listener and BGM.
Definition at line 129 of file Sound.cpp.
References Zeni::Sound_Stream_AL::get_velocity().
|
inline |
Get the current Sound_Renderer.
Definition at line 30 of file Sound.hxx.
Referenced by Zeni::Popup_Menu_State::Sound_Check_Box::render_impl(), and Zeni::Sound_Source_HW::set_buffer().
|
inline |
Check to see if the BGM is set to loop back to the start once it is done playing.
Definition at line 108 of file Sound.hxx.
References Zeni::Sound_Stream_AL::is_looping().
|
inline |
|
inline |
Pause BackGround Music.
Definition at line 163 of file Sound.hxx.
References Zeni::Sound_Stream_AL::pause().
|
inline |
Check to see if BackGround Music is paused.
Definition at line 135 of file Sound.hxx.
References Zeni::Sound_Stream_AL::is_paused().
|
inline |
Begin Playing BackGround Music.
Definition at line 153 of file Sound.hxx.
References Zeni::Sound_Stream_AL::play().
|
inline |
Check to see if BackGround Music is playing.
Definition at line 126 of file Sound.hxx.
References Zeni::Sound_Stream_AL::is_playing().
Set BackGround Music.
Definition at line 142 of file Sound.cpp.
References sort_controllers::filename, Zeni::Sound_Stream_AL::get_gain(), get_Hello_World_Buffer(), Zeni::Sound_Stream_AL::get_max_distance(), Zeni::Sound_Stream_AL::get_pitch(), Zeni::Sound_Stream_AL::get_position(), Zeni::Sound_Stream_AL::get_reference_distance(), Zeni::Sound_Stream_AL::get_rolloff(), Zeni::Sound_Stream_AL::get_velocity(), Zeni::Sound_Stream_AL::is_looping(), Zeni::Sound_Stream_AL::is_playing(), Zeni::Sound_Source::is_playing(), Zeni::Sound_Stream_AL::play(), Zeni::Sound_Source::play(), Zeni::Sound_Source::set_buffer(), Zeni::Sound_Stream_AL::set_gain(), Zeni::Sound_Stream_AL::set_max_distance(), Zeni::Sound_Stream_AL::set_pitch(), Zeni::Sound_Stream_AL::set_position(), Zeni::Sound_Stream_AL::set_reference_distance(), Zeni::Sound_Stream_AL::set_rolloff(), Zeni::Sound_Source::set_time(), Zeni::Sound_Stream_AL::set_velocity(), and Zeni::Sound_Source::stop().
Set the gain.
Definition at line 52 of file Sound.hxx.
References Zeni::Sound_Stream_AL::set_gain().
Set whether the BGM should loop back to the start once it is done playing.
Definition at line 62 of file Sound.hxx.
References Zeni::Sound_Stream_AL::set_looping().
Set the pitch.
Definition at line 42 of file Sound.hxx.
References Zeni::Sound_Stream_AL::set_pitch().
Set the current position in the BGM, offset in seconds.
Definition at line 72 of file Sound.hxx.
References Zeni::Sound_Stream_AL::set_time().
Set the orientation of the listener.
Definition at line 104 of file Sound.cpp.
References Zeni::Sound_Renderer::set_listener_forward_and_up().
Set the listener gain.
Definition at line 108 of file Sound.cpp.
References Zeni::Sound_Renderer::set_listener_gain().
Set whether the listener is muted.
Definition at line 114 of file Sound.cpp.
References Zeni::Sound_Renderer::set_listener_gain().
Referenced by Zeni::Popup_Menu_State::Sound_Check_Box::on_accept().
Set the position of the listener and BGM.
Definition at line 80 of file Sound.cpp.
References Zeni::Sound_Renderer::set_listener_position(), and Zeni::Sound_Stream_AL::set_position().
Set the velocity of the listener and BGM for the doppler effect.
Definition at line 92 of file Sound.cpp.
References Zeni::Sound_Renderer::set_listener_velocity(), and Zeni::Sound_Stream_AL::set_velocity().
|
inline |
Stop BackGround Music.
Definition at line 173 of file Sound.hxx.
References Zeni::Sound_Stream_AL::stop().
|
inline |
Check to see if BackGround Music is stopped.
Definition at line 144 of file Sound.hxx.
References Zeni::Sound_Stream_AL::is_stopped().
|
inline |
Update background music, as needed.
Definition at line 82 of file Sound.hxx.
References Zeni::Sound_Stream_AL::update().
Referenced by Zeni::Game::run().