Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
orxonox::AmbientSound Class Reference

The AmbientSound class is used to play background music. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/sound/AmbientSound.h>

Inheritance diagram for orxonox::AmbientSound:
orxonox::BaseSound orxonox::MoodListener orxonox::Listable orxonox::OrxonoxInterface orxonox::Identifiable orxonox::Configurable orxonox::Destroyable orxonox::Listable orxonox::Identifiable

Public Member Functions

 AmbientSound ()
 
const std::string & getAmbientSource () const
 
bool getPlayOnLoad () const
 
virtual void pause () override
 
virtual void play () override
 
bool setAmbientSource (const std::string &source)
 
void setPlayOnLoad (bool val)
 
virtual bool stop () override
 
- Public Member Functions inherited from orxonox::BaseSound
 BaseSound ()
 
bool getLooping () const
 
float getPitch () const
 
virtual const std::string & getSource () const
 
float getVolume () const
 
bool isPaused () const
 
bool isPlaying () const
 
bool isStopped () const
 
void setLooping (bool val)
 
void setPitch (float pitch)
 
virtual void setSource (const std::string &source)
 
void setVolume (float vol)
 
void updateVolume ()
 
void XMLPortExtern (Element &xmlelement, XMLPort::Mode mode)
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 
- Public Member Functions inherited from orxonox::OrxonoxInterface
 OrxonoxInterface ()
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Destroyable
 Destroyable ()
 Constructor: Sets the default values. More...
 
virtual ~Destroyable ()
 Destructor: Notifies all DestructionListener (for example weak pointers) that this object is being deleted. More...
 
void destroy ()
 Deletes the object if no strong pointers point to this object. More...
 
void destroyLater ()
 Works like destroy() but doesn't destroy the object until the current tick has ended. More...
 
unsigned int getReferenceCount () const
 Returns the number of strong pointers that point to this object. More...
 

Protected Member Functions

 ~AmbientSound ()
 
- Protected Member Functions inherited from orxonox::BaseSound
virtual ~BaseSound ()
 
void doPause ()
 
void doPlay ()
 
bool doStop ()
 
ALint getSourceState () const
 
virtual void initialiseSource ()
 
void loopingChanged ()
 
void pitchChanged ()
 
void sourceChanged ()
 
void stateChanged ()
 
void volumeChanged ()
 
- Protected Member Functions inherited from orxonox::MoodListener
 MoodListener ()
 
virtual ~MoodListener ()
 

Private Member Functions

void ambientSourceChanged ()
 
virtual float getRealVolume () override
 
virtual bool moodChanged (const std::string &mood) override
 
void playOnLoadChanged ()
 
virtual void preDestroy () override
 This virtual function is called if destroy() is called and no StrongPtr points to this object. More...
 

Private Attributes

std::string ambientSource_
 Analogous to source_, but mood independent. More...
 
bool bPlayOnLoad_
 Play the sound immediately when loaded. More...
 

Friends

class SoundManager
 
class WorldAmbientSound
 

Additional Inherited Members

- Protected Types inherited from orxonox::BaseSound
enum  State { State::Stopped, State::Playing, State::Paused }
 
- Protected Attributes inherited from orxonox::BaseSound
ALuint audioSource_
 
bool bLooping_
 
bool bPooling_
 
float pitch_
 
std::shared_ptr< SoundBuffersoundBuffer_
 
std::string source_
 
State state_
 
float volume_
 

Detailed Description

The AmbientSound class is used to play background music.

It can not be placed directly in a level file, use WorldAmbientSound instead.

Constructor & Destructor Documentation

orxonox::AmbientSound::AmbientSound ( )
orxonox::AmbientSound::~AmbientSound ( )
inlineprotected

Member Function Documentation

void orxonox::AmbientSound::ambientSourceChanged ( )
inlineprivate
const std::string& orxonox::AmbientSound::getAmbientSource ( ) const
inline
bool orxonox::AmbientSound::getPlayOnLoad ( ) const
inline
float orxonox::AmbientSound::getRealVolume ( )
overrideprivatevirtual

Implements orxonox::BaseSound.

bool orxonox::AmbientSound::moodChanged ( const std::string &  mood)
overrideprivatevirtual

Implements orxonox::MoodListener.

void orxonox::AmbientSound::pause ( )
overridevirtual

Reimplemented from orxonox::BaseSound.

void orxonox::AmbientSound::play ( )
overridevirtual

Reimplemented from orxonox::BaseSound.

void orxonox::AmbientSound::playOnLoadChanged ( )
inlineprivate
void orxonox::AmbientSound::preDestroy ( void  )
overrideprivatevirtual

This virtual function is called if destroy() is called and no StrongPtr points to this object.

Used in some cases to create a new StrongPtr to prevent destruction. Don't call this function directly - use destroy() instead.

Reimplemented from orxonox::Destroyable.

bool orxonox::AmbientSound::setAmbientSource ( const std::string &  source)
void orxonox::AmbientSound::setPlayOnLoad ( bool  val)
bool orxonox::AmbientSound::stop ( )
overridevirtual

Reimplemented from orxonox::BaseSound.

Friends And Related Function Documentation

friend class SoundManager
friend
friend class WorldAmbientSound
friend

Member Data Documentation

std::string orxonox::AmbientSound::ambientSource_
private

Analogous to source_, but mood independent.

bool orxonox::AmbientSound::bPlayOnLoad_
private

Play the sound immediately when loaded.


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