Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
orxonox::BaseSound Class Referenceabstract

The BaseSound class is the base class for all sound file loader classes. More...

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

Inheritance diagram for orxonox::BaseSound:
orxonox::Listable orxonox::Identifiable orxonox::AmbientSound orxonox::WorldSound

Public Member Functions

 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
 
virtual void pause ()
 
virtual void play ()
 
void setLooping (bool val)
 
void setPitch (float pitch)
 
virtual void setSource (const std::string &source)
 
void setVolume (float vol)
 
virtual bool stop ()
 
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...
 

Protected Types

enum  State { State::Stopped, State::Playing, State::Paused }
 

Protected Member Functions

virtual ~BaseSound ()
 
void doPause ()
 
void doPlay ()
 
bool doStop ()
 
virtual float getRealVolume ()=0
 
ALint getSourceState () const
 
virtual void initialiseSource ()
 
void loopingChanged ()
 
void pitchChanged ()
 
void sourceChanged ()
 
void stateChanged ()
 
void volumeChanged ()
 

Protected Attributes

ALuint audioSource_
 
bool bLooping_
 
bool bPooling_
 
float pitch_
 
std::shared_ptr< SoundBuffersoundBuffer_
 
std::string source_
 
State state_
 
float volume_
 

Private Attributes

DataStreamPtr dataStream_
 

Detailed Description

The BaseSound class is the base class for all sound file loader classes.

It serves as main interface to the OpenAL library.

Member Enumeration Documentation

enum orxonox::BaseSound::State
strongprotected
Enumerator
Stopped 
Playing 
Paused 

Constructor & Destructor Documentation

orxonox::BaseSound::BaseSound ( )
orxonox::BaseSound::~BaseSound ( )
protectedvirtual

Member Function Documentation

void orxonox::BaseSound::doPause ( )
protected
void orxonox::BaseSound::doPlay ( )
protected
bool orxonox::BaseSound::doStop ( )
protected
bool orxonox::BaseSound::getLooping ( ) const
inline
float orxonox::BaseSound::getPitch ( ) const
inline
virtual float orxonox::BaseSound::getRealVolume ( )
protectedpure virtual
virtual const std::string& orxonox::BaseSound::getSource ( ) const
inlinevirtual
ALint orxonox::BaseSound::getSourceState ( ) const
protected
float orxonox::BaseSound::getVolume ( ) const
inline
void orxonox::BaseSound::initialiseSource ( )
protectedvirtual

Reimplemented in orxonox::WorldSound.

bool orxonox::BaseSound::isPaused ( ) const
inline
bool orxonox::BaseSound::isPlaying ( ) const
inline
bool orxonox::BaseSound::isStopped ( ) const
inline
void orxonox::BaseSound::loopingChanged ( )
inlineprotected
virtual void orxonox::BaseSound::pause ( )
inlinevirtual

Reimplemented in orxonox::AmbientSound.

void orxonox::BaseSound::pitchChanged ( )
inlineprotected
virtual void orxonox::BaseSound::play ( )
inlinevirtual

Reimplemented in orxonox::AmbientSound.

void orxonox::BaseSound::setLooping ( bool  val)
void orxonox::BaseSound::setPitch ( float  pitch)
void orxonox::BaseSound::setSource ( const std::string &  source)
virtual
void orxonox::BaseSound::setVolume ( float  vol)
void orxonox::BaseSound::sourceChanged ( )
inlineprotected
void orxonox::BaseSound::stateChanged ( )
protected
virtual bool orxonox::BaseSound::stop ( )
inlinevirtual

Reimplemented in orxonox::AmbientSound.

void orxonox::BaseSound::updateVolume ( )
void orxonox::BaseSound::volumeChanged ( )
inlineprotected
void orxonox::BaseSound::XMLPortExtern ( Element &  xmlelement,
XMLPort::Mode  mode 
)

Member Data Documentation

ALuint orxonox::BaseSound::audioSource_
protected
bool orxonox::BaseSound::bLooping_
protected
bool orxonox::BaseSound::bPooling_
protected
DataStreamPtr orxonox::BaseSound::dataStream_
private
float orxonox::BaseSound::pitch_
protected
std::shared_ptr<SoundBuffer> orxonox::BaseSound::soundBuffer_
protected
std::string orxonox::BaseSound::source_
protected
State orxonox::BaseSound::state_
protected
float orxonox::BaseSound::volume_
protected

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