Changeset 8005 for code/branches/usability/src/orxonox/sound/BaseSound.cc
- Timestamp:
- Mar 1, 2011, 5:10:29 AM (13 years ago)
- Location:
- code/branches/usability
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability
- Property svn:mergeinfo changed
/code/branches/sound4 (added) merged: 6435,6476,6504 /code/branches/sound5 (added) merged: 6505-6511,6562,6674,6726,6729-6730,6733,6767,6769,6931,6962,7720
- Property svn:mergeinfo changed
-
code/branches/usability/src/orxonox/sound/BaseSound.cc
r7858 r8005 92 92 alSourcePlay(this->audioSource_); 93 93 if (int error = alGetError()) 94 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;94 COUT(2) << "Sound: Error playing sound: " << getALErrorString(error) << std::endl; 95 95 } 96 96 } … … 145 145 alSource3f(this->audioSource_, AL_DIRECTION, 0, 0, 0); 146 146 if (ALint error = alGetError()) 147 COUT(2) << "Sound Warning: Setting source parameters to 0 failed: "148 << SoundManager::getALErrorString(error) << std::endl;149 assert(this->soundBuffer_ != NULL);150 alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer());147 COUT(2) << "Sound: Warning: Setting source parameters to 0 failed: " << getALErrorString(error) << std::endl; 148 if(this->soundBuffer_ != NULL) { 149 alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer()); 150 } 151 151 if (ALuint error = alGetError()) 152 COUT(1) << "Sound Error: Could not set buffer \"" << this->source_ << "\": " << SoundManager::getALErrorString(error) << std::endl;152 COUT(1) << "Sound: Error: Could not set buffer \"" << this->source_ << "\": " << getALErrorString(error) << std::endl; 153 153 } 154 154 … … 157 157 this->volume_ = clamp(vol, 0.0f, 1.0f); 158 158 if (this->volume_ != vol) 159 COUT(2) << "Sound warning: volume out of range, clamping value." << std::endl;159 COUT(2) << "Sound: Warning: volume out of range, clamping value." << std::endl; 160 160 this->updateVolume(); 161 161 } … … 168 168 alSourcef(this->audioSource_, AL_GAIN, volume); 169 169 if (int error = alGetError()) 170 COUT(2) << "Sound: Error setting volume to " << volume 171 << ": " << SoundManager::getALErrorString(error) << std::endl; 170 COUT(2) << "Sound: Error setting volume to " << volume << ": " << getALErrorString(error) << std::endl; 172 171 } 173 172 } … … 184 183 if (pitch > 2 || pitch < 0.5f) 185 184 { 186 COUT(2) << "Sound warning: pitch out of range, cropping value." << std::endl;185 COUT(2) << "Sound: Warning: pitch out of range, cropping value." << std::endl; 187 186 pitch = pitch > 2.0f ? 2.0f : pitch; 188 187 pitch = pitch < 0.5f ? 0.5f : pitch; … … 193 192 alSourcef(this->audioSource_, AL_PITCH, pitch); 194 193 if (int error = alGetError()) 195 COUT(2) << "Sound: Error setting pitch: " << SoundManager::getALErrorString(error) << std::endl;194 COUT(2) << "Sound: Error setting pitch: " << getALErrorString(error) << std::endl; 196 195 } 197 196 } … … 238 237 if (ALuint error = alGetError()) 239 238 { 240 COUT(1) << "Sound Error: Could not set buffer \"" << source << "\": " << SoundManager::getALErrorString(error) << std::endl;239 COUT(1) << "Sound: Error: Could not set buffer \"" << source << "\": " << getALErrorString(error) << std::endl; 241 240 return; 242 241 } … … 246 245 alSourcePlay(this->audioSource_); 247 246 if (int error = alGetError()) 248 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;247 COUT(2) << "Sound: Error playing sound: " << getALErrorString(error) << std::endl; 249 248 if (this->isPaused()) 250 249 alSourcePause(this->audioSource_);
Note: See TracChangeset
for help on using the changeset viewer.