Changeset 7856 for code/trunk
- Timestamp:
- Feb 11, 2011, 4:05:55 PM (14 years ago)
- Location:
- code/trunk/src/orxonox/sound
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/sound/AmbientSound.cc
r7854 r7856 57 57 } 58 58 59 voidAmbientSound::stop()59 bool AmbientSound::stop() 60 60 { 61 61 if (GameMode::playsSound()) 62 62 SoundManager::getInstance().unregisterAmbientSound(this); 63 return false; // sound source not (yet) destroyed - return false 63 64 } 64 65 -
code/trunk/src/orxonox/sound/AmbientSound.h
r7854 r7856 51 51 52 52 void play(); 53 voidstop();53 bool stop(); 54 54 void pause(); 55 55 -
code/trunk/src/orxonox/sound/BaseSound.cc
r7163 r7856 96 96 } 97 97 98 voidBaseSound::doStop()98 bool BaseSound::doStop() 99 99 { 100 100 this->state_ = Stopped; … … 109 109 this->audioSource_ += 123455; 110 110 while (alIsSource(++this->audioSource_)); 111 } 111 112 return true; // sound source destroyed - return true 113 } 114 return false; // nothing done - return false 112 115 } 113 116 -
code/trunk/src/orxonox/sound/BaseSound.h
r7854 r7856 51 51 52 52 virtual void play() { this->doPlay(); } 53 virtual void stop() { this->doStop(); }53 virtual bool stop() { return this->doStop(); } // returns true if the sound source was destroyed 54 54 virtual void pause() { this->doPause(); } 55 55 … … 86 86 87 87 void doPlay(); 88 void doStop();88 bool doStop(); // returns true if the sound source was destroyed 89 89 void doPause(); 90 90 -
code/trunk/src/orxonox/sound/SoundManager.cc
r7855 r7856 241 241 if (state == AL_STOPPED) 242 242 { 243 this->usedSoundSources_[i].second->stop();244 --i;243 if (this->usedSoundSources_[i].second->stop()) // if stop() returns true, the sound source was removed, thus decrement the array index 244 --i; 245 245 } 246 246 }
Note: See TracChangeset
for help on using the changeset viewer.