00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef SNXSTUBSOUNDIMPLEMENTATION_H
00044 #define SNXSTUBSOUNDIMPLEMENTATION_H
00045 #include <string>
00046 #include <boost/concept_check.hpp>
00047 #include <gmtl/Math.h>
00048 #include <gmtl/Matrix.h>
00049 #include <gmtl/Vec.h>
00050 #include <gmtl/MatrixOps.h>
00051 #include <gmtl/VecOps.h>
00052 #include <gmtl/Xforms.h>
00053
00054 #include "snx/SoundImplementation.h"
00055 #include "snx/SoundInfo.h"
00056 #include "snx/SoundAPIInfo.h"
00057 #include "snx/Util/Debug.h"
00058
00059 namespace snx
00060 {
00061
00062 class StubSoundImplementation : public snx::SoundImplementation
00063 {
00064 public:
00068 StubSoundImplementation() : snx::SoundImplementation() { this->setName( "Stub" ); }
00069
00073 virtual ~StubSoundImplementation()
00074 {
00075 }
00076
00080 virtual void clone( snx::ISoundImplementation* &newCopy )
00081 {
00082 StubSoundImplementation* temp = new StubSoundImplementation;
00083
00084
00085 temp->copy( *this );
00086
00087 newCopy = temp;
00088 }
00089
00096 virtual void trigger( const std::string & alias, const int & looping = 0 )
00097 {
00098 snx::SoundImplementation::trigger( alias, looping );
00099 this->lookup( alias ).triggerOnNextBind = true;
00100
00101
00102 }
00103
00108 virtual void stop( const std::string & alias )
00109 {
00110 snx::SoundImplementation::stop( alias );
00111 this->lookup( alias ).triggerOnNextBind = false;
00112
00113
00114 }
00115
00119 virtual void setPosition( const std::string& alias, float x, float y, float z )
00120 {
00121 snx::SoundImplementation::setPosition( alias, x, y, z );
00122 }
00123
00129 virtual void getPosition( const std::string& alias, float& x, float& y, float& z )
00130 {
00131 snx::SoundImplementation::getPosition( alias, x, y, z );
00132 }
00133
00137 virtual void setListenerPosition( const gmtl::Matrix44f& mat )
00138 {
00139 snx::SoundImplementation::setListenerPosition( mat );
00140 }
00141
00145 virtual void getListenerPosition( gmtl::Matrix44f& mat )
00146 {
00147 snx::SoundImplementation::getListenerPosition( mat );
00148 }
00149
00156 virtual int startAPI()
00157 {
00158 vpr::DebugOutputGuard output1(snxDBG, vprDBG_CONFIG_LVL, std::string("Stub::startAPI (does nothing)\n"), std::string("\n"));
00159 return 1;
00160 }
00161
00167 virtual void shutdownAPI()
00168 {
00169 vpr::DebugOutputGuard output2(snxDBG, vprDBG_CONFIG_LVL, std::string("Stub::shutdownAPI (does nothing)\n"), std::string("\n"));
00170 }
00171
00176 virtual bool isStarted() const
00177 {
00178 return true;
00179 }
00180
00181 virtual void configure( const snx::SoundAPIInfo& sai )
00182 {
00183
00184 SoundImplementation::configure( sai );
00185 }
00186
00195 virtual void configure( const std::string& alias, const snx::SoundInfo& description )
00196 {
00197 snx::SoundImplementation::configure( alias, description );
00198
00199 }
00200
00205 virtual void remove( const std::string& alias )
00206 {
00207 snx::SoundImplementation::remove( alias );
00208
00209 }
00210
00215 virtual void clear()
00216 {
00217 }
00218
00223 virtual void bindAll()
00224 {
00225 }
00226
00231 virtual void unbindAll()
00232 {
00233 }
00234
00239 virtual void bind( const std::string& alias )
00240 {
00241 boost::ignore_unused_variable_warning(alias);
00242 }
00243
00248 virtual void unbind( const std::string& alias )
00249 {
00250 boost::ignore_unused_variable_warning(alias);
00251 }
00252
00258 virtual void step( const float & timeElapsed )
00259 {
00260 snx::SoundImplementation::step( timeElapsed );
00261
00262 }
00263
00268 void operator delete(void* p)
00269 {
00270 ::operator delete(p);
00271 }
00272
00273 protected:
00278 virtual void destroy()
00279 {
00280 delete this;
00281 }
00282
00283 private:
00284
00286
00287
00289
00290 };
00291
00292 }
00293
00294 #endif //SNXSTUBSOUNDIMPLEMENTATION_H