Changeset 6733 for code/branches/sound5/src/orxonox/sound/AmbientSound.cc
- Timestamp:
- Apr 15, 2010, 3:42:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound5/src/orxonox/sound/AmbientSound.cc
r6730 r6733 183 183 if(this->soundstreamthread_ == boost::thread()) 184 184 COUT(2) << "Sound: Failed to create thread." << std::endl; 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 } 205 206 this->updateVolume(); 207 this->setPitch(this->getPitch()); 208 this->setLooping(this->getLooping()); 185 209 186 alSource3f(this->audioSource_, AL_POSITION, 0, 0, 0); 210 187 alSource3f(this->audioSource_, AL_VELOCITY, 0, 0, 0);
Note: See TracChangeset
for help on using the changeset viewer.