Changeset 4209 in orxonox.OLD for orxonox/branches/openAL/src/lib
- Timestamp:
- May 17, 2005, 10:38:59 PM (20 years ago)
- Location:
- orxonox/branches/openAL/src/lib/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/openAL/src/lib/sound/sound_engine.cc
r4208 r4209 98 98 } 99 99 100 /** 101 \brief deletes a SoundSource 102 */ 100 103 SoundSource::~SoundSource(void) 101 104 { … … 159 162 { 160 163 this->setClassName ("SoundEngine"); 161 162 this->initAudio(); 163 164 this->listener = NULL; 165 this->bufferList = new tList<SoundBuffer>; 166 this->sourceList = new tList<SoundSource>; 164 165 this->listener = NULL; 166 this->bufferList = new tList<SoundBuffer>; 167 this->sourceList = new tList<SoundSource>; 167 168 } 168 169 … … 209 210 } 210 211 delete bufferIterator; 212 213 // removing openAL from AudioResource 214 alutExit(); 211 215 } 212 216 … … 232 236 this->listener = listener; 233 237 } 238 239 /** 240 \brief Sets the doppler values of openAL 241 \param dopplerFactor the extent of the doppler-effect 242 \param the Speed the sound travels 243 */ 244 void SoundEngine::setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity) 245 { 246 alDopplerFactor(dopplerFactor); 247 alDopplerVelocity(dopplerVelocity); 248 } 249 234 250 235 251 /** … … 345 361 bool SoundEngine::initAudio(void) 346 362 { 363 ALenum result; 364 365 PRINTF(3)("Initialisazing openAL sound library\n"); 366 347 367 alutInit(NULL, 0); 348 alGetError();349 350 alDopplerFactor(SOUND_DOPPLER_FACTOR); 351 alDopplerVelocity(SOUND_DOPPLER_VELOCITY);368 if ((result = alGetError()) != AL_NO_ERROR) 369 SoundEngine::PrintALErrorString(result); 370 371 this->setDopplerValues(SOUND_DOPPLER_FACTOR, SOUND_DOPPLER_VELOCITY); 352 372 } 353 373 -
orxonox/branches/openAL/src/lib/sound/sound_engine.h
r4207 r4209 1 1 /*! 2 2 \file sound_engine.h 3 \brief Definition of the SoundEngine singleton Class 4 3 \brief Definition of the SoundEngine singleton Class 5 4 */ 6 5 … … 78 77 79 78 void setListener(PNode* listener); 79 void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity); 80 80 81 81 82 void addBuffer(SoundBuffer* buffer); … … 86 87 void update(void); 87 88 89 // administrative 88 90 void flushUnusedBuffers(void); 91 bool initAudio(void); 89 92 90 93 // error handling: … … 92 95 // static void PrintALCErrorString(ALenum err); 93 96 97 94 98 private: 95 99 SoundEngine(void); 96 100 static SoundEngine* singletonRef; 97 101 98 bool initAudio(void);99 102 100 103 PNode* listener; //!< The listener of the Scene
Note: See TracChangeset
for help on using the changeset viewer.