Changeset 6730 for code/branches/sound5/src
- Timestamp:
- Apr 15, 2010, 1:57:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound5/src/orxonox/sound/AmbientSound.cc
r6674 r6730 149 149 void AmbientSound::setStreamSource(const std::string& source) 150 150 { 151 if (!GameMode::playsSound()) 152 { 153 this->source_ = source; 154 return; 155 } 156 151 157 this->audioSource_ = SoundManager::getInstance().getSoundSource(this); 152 158 if (this->source_ == source) … … 178 184 COUT(2) << "Sound: Failed to create thread." << std::endl; 179 185 186 if (alIsSource(this->audioSource_)) // already playing or paused 187 { 188 // Sound was already playing or paused because there was a source acquired 189 assert(this->isPlaying() || this->isPaused()); 190 alSourcePlay(this->audioSource_); 191 if (int error = alGetError()) 192 COUT(2) << "Sound: Error playing sound: " << getALErrorString(error) << std::endl; 193 if (this->isPaused()) 194 alSourcePause(this->audioSource_); 195 } 196 else // No source acquired so far, but might be set to playing or paused 197 { 198 if (this->isPlaying() || this->isPaused()) 199 doPlay(); 200 if (this->isPaused()) 201 { 202 doPause(); 203 } 204 } 180 205 181 206 this->updateVolume();
Note: See TracChangeset
for help on using the changeset viewer.