Changeset 5982 for code/branches/sound3/src/orxonox/sound/SoundManager.cc
- Timestamp:
- Oct 21, 2009, 5:28:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/sound/SoundManager.cc
r5946 r5982 36 36 #include "core/GameMode.h" 37 37 #include "core/ScopedSingletonManager.h" 38 #include "BaseSound.h" 38 39 39 40 namespace orxonox … … 114 115 COUT(2) << "Sound: OpenAL: Invalid listener orientation" << std::endl; 115 116 } 117 118 void SoundManager::registerAmbientSound(BaseSound* newAmbient) 119 { 120 if (!(this->ambientSounds_.empty())) 121 { 122 this->ambientSounds_.front()->pause(); 123 } 124 this->ambientSounds_.push_front(newAmbient); 125 } 126 127 void SoundManager::unregisterAmbientSound(BaseSound* currentAmbient) 128 { 129 if(this->ambientSounds_.front() == currentAmbient) 130 { 131 this->ambientSounds_.pop_front(); 132 this->ambientSounds_.front()->replay(); 133 } 134 else 135 { 136 for(std::list<BaseSound*>::iterator it= this->ambientSounds_.begin(); it != this->ambientSounds_.end(); it++) 137 { 138 if(*it == currentAmbient) 139 { 140 this->ambientSounds_.erase(it); 141 break; 142 } 143 } 144 } 145 } 116 146 }
Note: See TracChangeset
for help on using the changeset viewer.