zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Sound_Source_Pool Class Reference

This class manages Sound_Sources. More...

#include <Sound_Source_Pool.h>

Inherits Zeni::Singleton< Sound_Source_Pool >.

Classes

class  Positional_Replacement_Policy
 
class  Replacement_Policy
 

Public Member Functions

const Replacement_Policyget_Replacement_Policy () const
 Get the Replacement_Policy. More...
 
void give_Replacement_Policy (Replacement_Policy *const &replacement_policy)
 Give the Sound_Source_Pool a new Replacement_Policy (which it will delete later) More...
 
void lend_Replacement_Policy (Replacement_Policy *const &replacement_policy)
 Give the Sound_Source_Pool a new Replacement_Policy (which it will NEVER delete) More...
 
void pause_all ()
 Pause all Sound_Sources. More...
 
void purge ()
 Purge all Sound_Source_HW and all playing_and_destroying (created by play_sound(...)) More...
 
void unpause_all ()
 Unpause all paused Sound_Sources. More...
 
void update ()
 Redistribute hardware Sound_Sources according to the Replacement_Policy. Newer Sound_Sources are implicitly prioritized over older Sound_Sources. (Called automatically) More...
 
- Public Member Functions inherited from Zeni::Singleton< Sound_Source_Pool >
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

void play_sound (const String &sound_name, const float &pitch, const float &gain, const Point3f &position, const Vector3f &velocity)
 
class Singleton< Sound_Source_Pool >
 
class Sound_Source
 

Additional Inherited Members

- Static Public Member Functions inherited from Zeni::Singleton< Sound_Source_Pool >
static void completely_destroy ()
 
static void destroy ()
 
static Sound_Source_Poolget ()
 
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_Source_Pool >
 Singleton ()
 
virtual ~Singleton ()
 

Detailed Description

This class manages Sound_Sources.

This class assigns Sound_Source_HW to 'Sound_Source's on update.

This avoids the problem of users generating more 'Sound_Source's than the hardware on a given computer actually supports.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 53 of file Sound_Source_Pool.h.

Member Function Documentation

const Sound_Source_Pool::Replacement_Policy & Zeni::Sound_Source_Pool::get_Replacement_Policy ( ) const

Get the Replacement_Policy.

Definition at line 134 of file Sound_Source_Pool.cpp.

void Zeni::Sound_Source_Pool::give_Replacement_Policy ( Sound_Source_Pool::Replacement_Policy *const replacement_policy)

Give the Sound_Source_Pool a new Replacement_Policy (which it will delete later)

Definition at line 138 of file Sound_Source_Pool.cpp.

void Zeni::Sound_Source_Pool::lend_Replacement_Policy ( Sound_Source_Pool::Replacement_Policy *const replacement_policy)

Give the Sound_Source_Pool a new Replacement_Policy (which it will NEVER delete)

Definition at line 143 of file Sound_Source_Pool.cpp.

void Zeni::Sound_Source_Pool::pause_all ( )

Pause all Sound_Sources.

Definition at line 148 of file Sound_Source_Pool.cpp.

Referenced by Zeni::Popup_State::on_push().

void Zeni::Sound_Source_Pool::purge ( )

Purge all Sound_Source_HW and all playing_and_destroying (created by play_sound(...))

Definition at line 168 of file Sound_Source_Pool.cpp.

void Zeni::Sound_Source_Pool::unpause_all ( )

Unpause all paused Sound_Sources.

Definition at line 158 of file Sound_Source_Pool.cpp.

Referenced by Zeni::Popup_State::on_pop().

void Zeni::Sound_Source_Pool::update ( )

Redistribute hardware Sound_Sources according to the Replacement_Policy. Newer Sound_Sources are implicitly prioritized over older Sound_Sources. (Called automatically)

Definition at line 215 of file Sound_Source_Pool.cpp.

References i, Zeni::Sound_Source::is_assigned(), NASTY_SOUND_SOURCE_CAP, Zeni::sound_quicksort(), and ZENI_LOGD().

Referenced by engine_handle_input(), and Zeni::Game::run().

Friends And Related Function Documentation

void play_sound ( const String sound_name,
const float &  pitch,
const float &  gain,
const Point3f position,
const Vector3f velocity 
)
friend

Play a sound effect.

Definition at line 351 of file Sound_Source_Pool.cpp.

friend class Singleton< Sound_Source_Pool >
friend

Definition at line 54 of file Sound_Source_Pool.h.

friend class Sound_Source
friend

Definition at line 55 of file Sound_Source_Pool.h.

Referenced by Zeni::play_sound().


The documentation for this class was generated from the following files: