Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <SceneManager.h>
Public Types | |
typedef VirtualIterator < SharedPtr< Scene > > | SceneIterator |
Public Member Functions | |
SceneManager () throw () | |
virtual | ~SceneManager () |
virtual SharedPtr< Source > | createSource (SharedPtr< Sound > sound, bool looping=false) throw (Exception) |
SharedPtr< Source > | createSource (SharedPtr< SourceTemplate > tpl) throw (Exception) |
SharedPtr< Source > | createSource (SharedPtr< SourceTemplate > tpl, const std::string &name) throw (Exception) |
virtual void | destroySource (SharedPtr< Source > source) throw () |
void | playSource (SharedPtr< SourceTemplate > tpl, const std::string &sceneName, LVector3 position, Vector3 direction, Vector3 velocity, Scalar radius) throw (Exception) |
void | playSource (SharedPtr< SourceTemplate > tpl, const std::string &soundName, const std::string &sceneName, LVector3 position, Vector3 direction, Vector3 velocity, Scalar radius) throw (Exception) |
virtual SharedPtr< Scene > | createScene (const std::string &name) throw (DuplicateObjectException) |
virtual SharedPtr< Scene > | getScene (const std::string &name) const throw (NotFoundException) |
virtual void | destroyScene (const std::string &name) throw (NotFoundException) |
virtual void | setSceneActive (const std::string &name, bool active) throw (NotFoundException) |
virtual bool | getSceneActive (const std::string &name) throw (NotFoundException) |
virtual SharedPtr< Listener > | getRootListener () const throw () |
virtual SharedPtr< SceneIterator > | getSceneIterator () const throw () |
virtual SharedPtr< SceneIterator > | getActiveSceneIterator () const throw () |
virtual void | setRenderer (SharedPtr< Renderer > renderer) throw (Exception) |
SharedPtr< Renderer > | getRenderer () const throw () |
virtual void | commit () throw (Exception) |
Duration | getPositionUpdateFrequency () const throw () |
Duration | getListenerUpdateFrequency () const throw () |
Duration | getAttributeUpdateFrequency () const throw () |
Duration | getActivationFrequency () const throw () |
virtual void | setPositionUpdateFrequency (Duration interval) const throw () |
virtual void | setListenerUpdateFrequency (Duration interval) const throw () |
virtual void | setAttributeUpdateFrequency (Duration interval) const throw () |
virtual void | setActivationFrequency (Duration interval) const throw () |
virtual unsigned int | getMaxSources () const throw () |
virtual void | setMaxSources (unsigned int n) throw (Exception) |
virtual float | getMinGain () const throw () |
virtual void | setMinGain (float gain) throw (Exception) |
virtual double | getMaxDistance () const throw () |
virtual void | setMaxDistance (double distance) throw (Exception) |
virtual void | notifySourcePlaying (SharedPtr< Source > source, SharedPtr< Scene > scene, bool playing) throw (Exception) |
Protected Member Functions | |
const SharedPtr< Renderer > & | internalRenderer () const |
void | addScene (SharedPtr< Scene > scene) throw (DuplicateObjectException) |
virtual void | activationPhaseImpl () throw (Exception) |
virtual void | updateSourcesImpl (bool withAttributes) throw (Exception) |
virtual void | updateListenerImpl (bool withAttributes) throw (Exception) |
![]() | |
~Singleton () | |
Additional Inherited Members | |
![]() | |
static SceneManager * | getSingleton () |
![]() | |
static void | initializeSingleton () |
static void | deinitializeSingleton () |
![]() | |
static SceneManager * | _singletonInstance |
Definition at line 59 of file SceneManager.h.
Definition at line 65 of file SceneManager.h.
Audio::SceneManager::SceneManager | ( | ) | ||
throw | ( | |||
) |
Construct a new instance of the manager
Definition at line 116 of file SceneManager.cpp.
|
virtual |
Definition at line 121 of file SceneManager.cpp.
|
protectedvirtual |
Synchronize activation state with the scenes
Definition at line 454 of file SceneManager.cpp.
References Audio::TVector3< T >::distanceSquared(), Audio::SourcePriorityRef::gain, Audio::SimpleScene::getActiveSources(), Audio::SimpleScene::getActiveSourcesEnd(), Audio::SimpleScene::getListener(), Audio::Listener::getPosition(), and Audio::RenderableSource::UPDATE_LOCATION.
|
protected |
|
virtual |
Commit changes done between frames
Definition at line 392 of file SceneManager.cpp.
References Audio::getRealTime(), and realTime().
|
virtual |
Create a new named scene
Definition at line 196 of file SceneManager.cpp.
Referenced by initScenes(), Audio::Test::testComplexScene(), Audio::Test::testMultiStreaming(), Audio::Test::testMultiStreaming2(), Audio::Test::testRendererless(), Audio::Test::testSimpleScene(), Audio::Test::testSimpleSceneWTemplates(), and Audio::Test::testStreaming().
|
virtual |
Create a new source based on the speicified sound
Definition at line 132 of file SceneManager.cpp.
Referenced by Audio::Test::testComplexScene(), Audio::Test::testMultiStreaming(), Audio::Test::testMultiStreaming2(), Audio::Test::testSimpleScene(), Audio::Test::testSimpleSceneWTemplates(), and Audio::Test::testStreaming().
SharedPtr< Source > Audio::SceneManager::createSource | ( | SharedPtr< SourceTemplate > | tpl) | ||
throw | ( | Exception | |||
) |
Create a new source based on the specified template
Definition at line 141 of file SceneManager.cpp.
SharedPtr< Source > Audio::SceneManager::createSource | ( | SharedPtr< SourceTemplate > | tpl, |
const std::string & | name | ||
) | |||
throw | ( | Exception | |
) |
Create a new source based on the specified template, but overriding its sound resource.
Definition at line 147 of file SceneManager.cpp.
|
virtual |
Destroy an existing scene by its name
Definition at line 220 of file SceneManager.cpp.
Referenced by Audio::Test::clearScene().
Duration Audio::SceneManager::getActivationFrequency | ( | ) | const | |
throw | ( | |||
) |
Return source activation frequency
Definition at line 621 of file SceneManager.cpp.
|
virtual |
Get an iterator over all active scenes
Definition at line 383 of file SceneManager.cpp.
Duration Audio::SceneManager::getAttributeUpdateFrequency | ( | ) | const | |
throw | ( | |||
) |
Return attribute update frequency
Definition at line 615 of file SceneManager.cpp.
Duration Audio::SceneManager::getListenerUpdateFrequency | ( | ) | const | |
throw | ( | |||
) |
Return listener update frequency
Definition at line 609 of file SceneManager.cpp.
|
virtual |
Get the maximum distance of active sources
Definition at line 355 of file SceneManager.cpp.
|
virtual |
Get the maximum number of simultaneous sources that can be playing at a time
Definition at line 283 of file SceneManager.cpp.
|
virtual |
Get the minimum gain that would be culled off
Definition at line 342 of file SceneManager.cpp.
Duration Audio::SceneManager::getPositionUpdateFrequency | ( | ) | const | |
throw | ( | |||
) |
Return position update frequency
Definition at line 603 of file SceneManager.cpp.
Get the current renderer
Definition at line 277 of file SceneManager.cpp.
Referenced by Audio::Test::testComplexScene(), Audio::Test::testMultiStreaming(), Audio::Test::testMultiStreaming2(), Audio::Test::testSimpleScene(), and Audio::Test::testStreaming().
Get the root listener
Definition at line 651 of file SceneManager.cpp.
|
virtual |
Get an existing scene by its name
Definition at line 204 of file SceneManager.cpp.
Referenced by Audio::Test::testComplexScene(), Audio::Test::testMultiStreaming(), Audio::Test::testMultiStreaming2(), Audio::Test::testRendererless(), Audio::Test::testSimpleScene(), Audio::Test::testSimpleSceneWTemplates(), and Audio::Test::testStreaming().
|
virtual |
Get the active state of a scene
Definition at line 246 of file SceneManager.cpp.
|
virtual |
Get an iterator over all scenes
Definition at line 368 of file SceneManager.cpp.
Referenced by Audio::Test::clearScene().
Returns the renderer
Definition at line 125 of file SceneManager.cpp.
|
virtual |
Notify the scene manager of a source that starts or stops playing.
Definition at line 657 of file SceneManager.cpp.
Referenced by Audio::SimpleScene::notifySourcePlaying().
void Audio::SceneManager::playSource | ( | SharedPtr< SourceTemplate > | tpl, |
const std::string & | sceneName, | ||
LVector3 | position, | ||
Vector3 | direction, | ||
Vector3 | velocity, | ||
Scalar | radius | ||
) | |||
throw | ( | Exception | |
) |
Convenience API to play a source once and forget.
tpl | The source template from which a source should be instanced |
sceneName | The name of the scene to which the source should be attached |
position | The initial position of the source |
direction | The direction of the (if directional) source |
velocity | The movement velocity of the source |
radius | The base radius of the source |
Definition at line 295 of file SceneManager.cpp.
Referenced by Audio::Test::testSimpleSceneWTemplates().
void Audio::SceneManager::playSource | ( | SharedPtr< SourceTemplate > | tpl, |
const std::string & | soundName, | ||
const std::string & | sceneName, | ||
LVector3 | position, | ||
Vector3 | direction, | ||
Vector3 | velocity, | ||
Scalar | radius | ||
) | |||
throw | ( | Exception | |
) |
Convenience API to play a source once and forget.
tpl | The source template from which a source should be instanced |
soundName | The name of the sound stream from which the source will be created, overriding the template's |
sceneName | The name of the scene to which the source should be attached |
position | The initial position of the source |
direction | The direction of the (if directional) source |
velocity | The movement velocity of the source |
radius | The base radius of the source |
Definition at line 318 of file SceneManager.cpp.
|
virtual |
Definition at line 645 of file SceneManager.cpp.
|
virtual |
Definition at line 639 of file SceneManager.cpp.
|
virtual |
Definition at line 633 of file SceneManager.cpp.
|
virtual |
Set the maximum distance of active sources
distance | The new limit. |
Definition at line 361 of file SceneManager.cpp.
References f.
Referenced by Audio::Test::testComplexScene().
Set the maximum number of simultaneous sources that can be playing at a time
n | The maximum number of simultaneous playing sources desired. |
Definition at line 289 of file SceneManager.cpp.
Referenced by initSceneManager(), and Audio::Test::testComplexScene().
Set the minimum gain that would be culled off
gain | The new minimum gain. |
Definition at line 348 of file SceneManager.cpp.
References f.
|
virtual |
Definition at line 627 of file SceneManager.cpp.
Set a new renderer
renderer | A new renderer to be used. |
Definition at line 252 of file SceneManager.cpp.
Referenced by initALRenderer(), and Audio::Test::initALRenderer().
|
virtual |
Sets the active state of a scene
Definition at line 231 of file SceneManager.cpp.
Referenced by initScenes(), Audio::Test::testComplexScene(), Audio::Test::testMultiStreaming(), Audio::Test::testMultiStreaming2(), Audio::Test::testRendererless(), Audio::Test::testSimpleScene(), Audio::Test::testSimpleSceneWTemplates(), and Audio::Test::testStreaming().
|
protectedvirtual |
Synchronize listeners
Definition at line 587 of file SceneManager.cpp.
References i, Audio::RenderableListener::UPDATE_ALL, and Audio::RenderableListener::UPDATE_LOCATION.
|
protectedvirtual |
Synchronize source positions/attributes with the renderer
Definition at line 562 of file SceneManager.cpp.
References Audio::RenderableSource::UPDATE_ALL, and Audio::RenderableSource::UPDATE_LOCATION.