Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

snx::StubSoundImplementation Class Reference

#include <StubSoundImplementation.h>

Inheritance diagram for snx::StubSoundImplementation:

Inheritance graph
[legend]
Collaboration diagram for snx::StubSoundImplementation:

Collaboration graph
[legend]
List of all members.

Public Methods

 StubSoundImplementation ()
 constructor for the OpenAL implementation. More...

virtual ~StubSoundImplementation ()
 destructor for the OpenAL implementation. More...

virtual void clone (snx::ISoundImplementation *&newCopy)
 every implementation can return a new copy of itself. More...

virtual void trigger (const std::string &alias, const int &looping=0)
 @input alias of the sound to trigger, and number of times to play. More...

virtual void stop (const std::string &alias)
 @semantics stop the sound @input alias of the sound to be stopped. More...

virtual void setPosition (const std::string &alias, float x, float y, float z)
 set sound's 3D position. More...

virtual void getPosition (const std::string &alias, float &x, float &y, float &z)
 get sound's 3D position @input alias is a name that has been associate()d with some sound data @output x,y,z are returned in OpenGL coordinates. More...

virtual void setListenerPosition (const gmtl::Matrix44f &mat)
 set the position of the listener. More...

virtual void getListenerPosition (gmtl::Matrix44f &mat)
 get the position of the listener. More...

virtual int startAPI ()
 start the sound API, creating any contexts or other configurations at startup. More...

virtual void shutdownAPI ()
 kill the sound API, deallocating any sounds, etc... More...

virtual bool isStarted () const
 query whether the API has been started or not @semantics return true if api has been started, false otherwise. More...

virtual void configure (const snx::SoundAPIInfo &sai)
virtual void configure (const std::string &alias, const snx::SoundInfo &description)
 configure/reconfigure a sound configure: associate a name (alias) to the description if not already done reconfigure: change properties of the sound to the descriptino provided. More...

virtual void remove (const std::string &alias)
 remove a configured sound, any future reference to the alias will not cause an error, but will not result in a rendered sound. More...

virtual void clear ()
 clear all associate()tions. More...

virtual void bindAll ()
 bind: load (or reload) all associate()d sounds. More...

virtual void unbindAll ()
 unbind: unload/deallocate all associate()d sounds. More...

virtual void bind (const std::string &alias)
 load/allocate the sound data this alias refers to the sound API. More...

virtual void unbind (const std::string &alias)
 unload/deallocate the sound data this alias refers from the sound API. More...

virtual void step (const float &timeElapsed)
 take a time step of [timeElapsed] seconds. More...

void operator delete (void *p)
 Invokes the global scope delete operator. More...


Protected Methods

virtual void destroy ()
 Deletes this object. More...


Constructor & Destructor Documentation

snx::StubSoundImplementation::StubSoundImplementation   [inline]
 

constructor for the OpenAL implementation.

Definition at line 68 of file StubSoundImplementation.h.

References snx::SoundImplementation::setName, and snx::SoundImplementation::SoundImplementation.

Referenced by clone.

00068 : snx::SoundImplementation() { this->setName( "Stub" ); }

virtual snx::StubSoundImplementation::~StubSoundImplementation   [inline, virtual]
 

destructor for the OpenAL implementation.

Definition at line 73 of file StubSoundImplementation.h.

00074    {
00075    }


Member Function Documentation

virtual void snx::StubSoundImplementation::clone snx::ISoundImplementation *&    newCopy [inline, virtual]
 

every implementation can return a new copy of itself.

Implements snx::SoundImplementation.

Definition at line 80 of file StubSoundImplementation.h.

References StubSoundImplementation.

00081    {
00082       StubSoundImplementation* temp = new StubSoundImplementation;
00083 
00084       // copy state, so that we return a true "clone"
00085       temp->copy( *this );
00086       
00087       newCopy = temp;
00088    }

virtual void snx::StubSoundImplementation::trigger const std::string &    alias,
const int &    looping = 0
[inline, virtual]
 

@input alias of the sound to trigger, and number of times to play.

@preconditions alias does not have to be associated with a loaded sound. @postconditions if it is, then the loaded sound is triggered. if it isn't then nothing happens. @semantics Triggers a sound

Reimplemented from snx::SoundImplementation.

Definition at line 96 of file StubSoundImplementation.h.

References snx::SoundImplementation::lookup, snx::SoundImplementation::trigger, and snx::SoundInfo::triggerOnNextBind.

00097    {
00098       snx::SoundImplementation::trigger( alias, looping );
00099       this->lookup( alias ).triggerOnNextBind = true;
00100       // do nothing
00101       //std::cout << "[snx]Stub::trigger (does nothing)\n"<<std::flush;
00102    }

virtual void snx::StubSoundImplementation::stop const std::string &    alias [inline, virtual]
 

@semantics stop the sound @input alias of the sound to be stopped.

Reimplemented from snx::SoundImplementation.

Definition at line 108 of file StubSoundImplementation.h.

References snx::SoundImplementation::lookup, snx::SoundImplementation::stop, stop, and snx::SoundInfo::triggerOnNextBind.

Referenced by stop.

00109    {
00110       snx::SoundImplementation::stop( alias );
00111       this->lookup( alias ).triggerOnNextBind = false;
00112       // do nothing
00113       //std::cout << "[snx]Stub::stop (does nothing)\n"<<std::flush;
00114    }

virtual void snx::StubSoundImplementation::setPosition const std::string &    alias,
float    x,
float    y,
float    z
[inline, virtual]
 

set sound's 3D position.

Reimplemented from snx::SoundImplementation.

Definition at line 119 of file StubSoundImplementation.h.

References snx::SoundImplementation::setPosition, and setPosition.

Referenced by setPosition.

00120    {
00121       snx::SoundImplementation::setPosition( alias, x, y, z );
00122    }

virtual void snx::StubSoundImplementation::getPosition const std::string &    alias,
float &    x,
float &    y,
float &    z
[inline, virtual]
 

get sound's 3D position @input alias is a name that has been associate()d with some sound data @output x,y,z are returned in OpenGL coordinates.

Reimplemented from snx::SoundImplementation.

Definition at line 129 of file StubSoundImplementation.h.

References snx::SoundImplementation::getPosition.

00130    {
00131       snx::SoundImplementation::getPosition( alias, x, y, z );
00132    }

virtual void snx::StubSoundImplementation::setListenerPosition const gmtl::Matrix44f &    mat [inline, virtual]
 

set the position of the listener.

Reimplemented from snx::SoundImplementation.

Definition at line 137 of file StubSoundImplementation.h.

References snx::SoundImplementation::setListenerPosition.

00138    {
00139       snx::SoundImplementation::setListenerPosition( mat );
00140    }

virtual void snx::StubSoundImplementation::getListenerPosition gmtl::Matrix44f &    mat [inline, virtual]
 

get the position of the listener.

Reimplemented from snx::SoundImplementation.

Definition at line 145 of file StubSoundImplementation.h.

References snx::SoundImplementation::getListenerPosition.

00146    {
00147       snx::SoundImplementation::getListenerPosition( mat );
00148    }

virtual int snx::StubSoundImplementation::startAPI   [inline, virtual]
 

start the sound API, creating any contexts or other configurations at startup.

@postconditions sound API is ready to go. @semantics this function should be called before using the other functions in the class.

Returns:
values: 0 if failed, 1 if success

Implements snx::SoundImplementation.

Definition at line 156 of file StubSoundImplementation.h.

References snxDBG.

00157    {
00158        vpr::DebugOutputGuard output1(snxDBG, vprDBG_CONFIG_LVL, std::string("Stub::startAPI (does nothing)\n"), std::string("\n"));
00159        return 1;
00160    }

virtual void snx::StubSoundImplementation::shutdownAPI   [inline, virtual]
 

kill the sound API, deallocating any sounds, etc...

@postconditions sound API is ready to go. @semantics this function could be called any time, the function could be called multiple times, so it should be smart.

Reimplemented from snx::SoundImplementation.

Definition at line 167 of file StubSoundImplementation.h.

References snxDBG.

00168    {
00169       vpr::DebugOutputGuard output2(snxDBG, vprDBG_CONFIG_LVL, std::string("Stub::shutdownAPI (does nothing)\n"), std::string("\n"));
00170    }   

virtual bool snx::StubSoundImplementation::isStarted   const [inline, virtual]
 

query whether the API has been started or not @semantics return true if api has been started, false otherwise.

Implements snx::SoundImplementation.

Definition at line 176 of file StubSoundImplementation.h.

00177    {
00178       return true;
00179    }

virtual void snx::StubSoundImplementation::configure const snx::SoundAPIInfo   sai [inline, virtual]
 

Reimplemented from snx::SoundImplementation.

Definition at line 181 of file StubSoundImplementation.h.

00182    {
00183       // nothing to do, call the base impl...
00184       SoundImplementation::configure( sai );
00185    }   

virtual void snx::StubSoundImplementation::configure const std::string &    alias,
const snx::SoundInfo   description
[inline, virtual]
 

configure/reconfigure a sound configure: associate a name (alias) to the description if not already done reconfigure: change properties of the sound to the descriptino provided.

@preconditions provide an alias and a SoundInfo which describes the sound @postconditions alias will point to loaded sound data @semantics associate an alias to sound data. later this alias can be used to operate on this sound data.

Reimplemented from snx::SoundImplementation.

Definition at line 195 of file StubSoundImplementation.h.

References snx::SoundImplementation::configure.

00196    {
00197       snx::SoundImplementation::configure( alias, description );
00198       // do nothing
00199    }

virtual void snx::StubSoundImplementation::remove const std::string &    alias [inline, virtual]
 

remove a configured sound, any future reference to the alias will not cause an error, but will not result in a rendered sound.

Reimplemented from snx::SoundImplementation.

Definition at line 205 of file StubSoundImplementation.h.

References snx::SoundImplementation::remove.

00206    {
00207       snx::SoundImplementation::remove( alias );
00208       // do nothing
00209    }

virtual void snx::StubSoundImplementation::clear   [inline, virtual]
 

clear all associate()tions.

@semantics any existing aliases will be stubbed. aounds will be unbind()ed

Reimplemented from snx::SoundImplementation.

Definition at line 215 of file StubSoundImplementation.h.

00216    {
00217    }   

virtual void snx::StubSoundImplementation::bindAll   [inline, virtual]
 

bind: load (or reload) all associate()d sounds.

@postconditions all sound associations are buffered by the sound API

Reimplemented from snx::SoundImplementation.

Definition at line 223 of file StubSoundImplementation.h.

00224    {
00225    }   

virtual void snx::StubSoundImplementation::unbindAll   [inline, virtual]
 

unbind: unload/deallocate all associate()d sounds.

@postconditions all sound associations are unbuffered by the sound API

Reimplemented from snx::SoundImplementation.

Definition at line 231 of file StubSoundImplementation.h.

00232    {
00233    }

virtual void snx::StubSoundImplementation::bind const std::string &    alias [inline, virtual]
 

load/allocate the sound data this alias refers to the sound API.

@postconditions the sound API has the sound buffered.

Implements snx::SoundImplementation.

Definition at line 239 of file StubSoundImplementation.h.

00240    {
00241       boost::ignore_unused_variable_warning(alias);
00242    }   

virtual void snx::StubSoundImplementation::unbind const std::string &    alias [inline, virtual]
 

unload/deallocate the sound data this alias refers from the sound API.

@postconditions the sound API no longer has the sound buffered.

Implements snx::SoundImplementation.

Definition at line 248 of file StubSoundImplementation.h.

00249    {
00250       boost::ignore_unused_variable_warning(alias);
00251    }

virtual void snx::StubSoundImplementation::step const float &    timeElapsed [inline, virtual]
 

take a time step of [timeElapsed] seconds.

@semantics call once per sound frame (doesn't have to be same as your graphics frame) @input time elapsed since last frame

Reimplemented from snx::SoundImplementation.

Definition at line 258 of file StubSoundImplementation.h.

References snx::SoundImplementation::step.

00259    {
00260       snx::SoundImplementation::step( timeElapsed );
00261       // do nothing
00262    }

void snx::StubSoundImplementation::operator delete void *    p [inline]
 

Invokes the global scope delete operator.

This is required for proper releasing of memory in DLLs on Win32.

Definition at line 268 of file StubSoundImplementation.h.

00269    {
00270       ::operator delete(p);
00271    }

virtual void snx::StubSoundImplementation::destroy   [inline, protected, virtual]
 

Deletes this object.

This is an implementation of the pure virtual snx::ISoundImplementation::destroy() method.

Implements snx::ISoundImplementation.

Definition at line 278 of file StubSoundImplementation.h.

00279    {
00280       delete this;
00281    }


The documentation for this class was generated from the following file:
Generated on Sun May 2 14:39:34 2004 for Juggler Sonix by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002