Changeset 8858 for code/trunk/src/orxonox/sound
- Timestamp:
- Aug 23, 2011, 12:45:53 AM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 vs 3 4 dependencies
-
- Property svn:mergeinfo changed
/code/branches/output (added) merged: 8739-8740,8765,8771-8772,8774-8780,8787-8789,8794-8799,8801,8803-8812,8814,8816-8817,8820,8822,8825-8837,8840,8844,8846,8848-8850,8853-8854
- Property svn:ignore
-
code/trunk/src/orxonox/sound/AmbientSound.cc
r8706 r8858 94 94 this->setSource(path); 95 95 else 96 COUT(3) << "Sound: " << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << std::endl;96 orxout(internal_warning, context::sound) << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << endl; 97 97 } 98 98 } -
code/trunk/src/orxonox/sound/BaseSound.cc
r8729 r8858 94 94 alSourcePlay(this->audioSource_); 95 95 if (int error = alGetError()) 96 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;96 orxout(internal_error, context::sound) << "Error playing sound: " << SoundManager::getALErrorString(error) << endl; 97 97 } 98 98 } … … 147 147 alSource3f(this->audioSource_, AL_DIRECTION, 0, 0, 0); 148 148 if (ALint error = alGetError()) 149 COUT(2) << "Sound Warning:Setting source parameters to 0 failed: "150 << SoundManager::getALErrorString(error) << std::endl;149 orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: " 150 << SoundManager::getALErrorString(error) << endl; 151 151 assert(this->soundBuffer_ != NULL); 152 152 alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer()); 153 153 if (ALuint error = alGetError()) 154 COUT(1) << "Sound Error: Could not set buffer \"" << this->source_ << "\": " << SoundManager::getALErrorString(error) << std::endl;154 orxout(internal_error, context::sound) << "Could not set buffer \"" << this->source_ << "\": " << SoundManager::getALErrorString(error) << endl; 155 155 } 156 156 … … 159 159 this->volume_ = clamp(vol, 0.0f, 1.0f); 160 160 if (this->volume_ != vol) 161 COUT(2) << "Sound warning: volume out of range, clamping value." << std::endl;161 orxout(internal_warning, context::sound) << "Volume out of range, clamping value." << endl; 162 162 this->updateVolume(); 163 163 } … … 170 170 alSourcef(this->audioSource_, AL_GAIN, volume); 171 171 if (int error = alGetError()) 172 COUT(2) << "Sound:Error setting volume to " << volume173 << ": " << SoundManager::getALErrorString(error) << std::endl;172 orxout(internal_error, context::sound) << "Error setting volume to " << volume 173 << ": " << SoundManager::getALErrorString(error) << endl; 174 174 } 175 175 } … … 186 186 if (pitch > 2 || pitch < 0.5f) 187 187 { 188 COUT(2) << "Sound warning: pitch out of range, cropping value." << std::endl;188 orxout(internal_warning, context::sound) << "Pitch out of range, cropping value." << endl; 189 189 pitch = pitch > 2.0f ? 2.0f : pitch; 190 190 pitch = pitch < 0.5f ? 0.5f : pitch; … … 195 195 alSourcef(this->audioSource_, AL_PITCH, pitch); 196 196 if (int error = alGetError()) 197 COUT(2) << "Sound: Error setting pitch: " << SoundManager::getALErrorString(error) << std::endl;197 orxout(internal_error, context::sound) << "Error setting pitch: " << SoundManager::getALErrorString(error) << endl; 198 198 } 199 199 } … … 240 240 if (ALuint error = alGetError()) 241 241 { 242 COUT(1) << "Sound Error: Could not set buffer \"" << source << "\": " << SoundManager::getALErrorString(error) << std::endl;242 orxout(internal_error, context::sound) << "Could not set buffer \"" << source << "\": " << SoundManager::getALErrorString(error) << endl; 243 243 return; 244 244 } … … 248 248 alSourcePlay(this->audioSource_); 249 249 if (int error = alGetError()) 250 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;250 orxout(internal_error, context::sound) << "Error playing sound: " << SoundManager::getALErrorString(error) << endl; 251 251 if (this->isPaused()) 252 252 alSourcePause(this->audioSource_); -
code/trunk/src/orxonox/sound/SoundBuffer.cc
r8351 r8858 51 51 if (fileInfo == NULL) 52 52 { 53 COUT(2) << "Sound: Warning: Sound file '" << filename << "' not found" << std::endl;53 orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl; 54 54 return; 55 55 } … … 144 144 if (ret < 0) 145 145 { 146 COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;146 orxout(internal_error, context::sound) << "libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << endl; 147 147 ov_clear(&vf); 148 148 ThrowException(General, "Sound Error: Ogg file loader failed when opening the bitstream"); … … 160 160 else if (ret < 0) 161 161 { 162 COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;162 orxout(internal_error, context::sound) << "libvorbisfile: error reading the file" << endl; 163 163 ov_clear(&vf); 164 164 ThrowException(General, "Sound Error: Ogg file loader failed when decoding the file"); -
code/trunk/src/orxonox/sound/SoundManager.cc
r8521 r8858 71 71 RegisterRootObject(SoundManager); 72 72 73 orxout(user_status) << "Loading sound" << endl; 74 73 75 this->bDestructorCalled_ = false; 74 76 … … 89 91 std::string renderDevice; 90 92 SetConfigValue(renderDevice, std::string(device)).description("Sound device used for rendering"); 91 COUT(4) << "Sound: Available devices: ";93 orxout(verbose, context::sound) << "Sound: Available devices: "; 92 94 while (true) 93 95 { 94 96 this->deviceNames_.push_back(devices); 95 COUT(4) << '"' << devices << "\", ";97 orxout(verbose, context::sound) << '"' << devices << "\", "; 96 98 devices += strlen(devices) + 1; 97 99 if (*devices == '\0') 98 100 break; 99 101 } 100 COUT(4) << std::endl;102 orxout(verbose, context::sound) << endl; 101 103 102 104 // Open the selected device 103 COUT(3) << "Sound: Opening device \"" << renderDevice << '\' << std::endl;105 orxout(internal_info, context::sound) << "Sound: Opening device \"" << renderDevice << '\' << endl; 104 106 this->device_ = alcOpenDevice(renderDevice.c_str()); 105 107 */ … … 122 124 // Get some information about the sound 123 125 if (const char* version = alGetString(AL_VERSION)) 124 COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;126 orxout(internal_info, context::sound) << "Sound: --- OpenAL Version: " << version << endl; 125 127 if (const char* vendor = alGetString(AL_VENDOR)) 126 COUT(4) << "Sound: --- OpenAL Vendor : " << vendor << std::endl;128 orxout(internal_info, context::sound) << "Sound: --- OpenAL Vendor : " << vendor << endl; 127 129 if (const char* types = alutGetMIMETypes(ALUT_LOADER_BUFFER)) 128 COUT(4) << "Sound: --- Supported MIME Types: " << types << std::endl;130 orxout(internal_info, context::sound) << "Sound: --- Supported MIME Types: " << types << endl; 129 131 else 130 COUT(2) << "Sound Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;132 orxout(internal_warning, context::sound) << "MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << endl; 131 133 132 134 this->mute_[SoundType::All] = 1.0f; … … 152 154 resetPlaysSoundGuard.Dismiss(); 153 155 154 COUT(4) << "Sound: Initialisation complete" << std::endl;156 orxout(internal_status, context::sound) << "Sound: Initialisation complete" << endl; 155 157 } 156 158 … … 164 166 // If there are still used buffers around, well, that's just very bad... 165 167 if (this->soundBuffers_.size() != this->effectsPool_.size()) 166 COUT(1) << "Sound Error: Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << std::endl;168 orxout(internal_error, context::sound) << "Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << endl; 167 169 // Empty buffer pool and buffer list 168 170 this->effectsPool_.clear(); … … 171 173 // There should not be any sources in use anymore 172 174 if (!this->usedSoundSources_.empty()) 173 COUT(1) << "Sound Error: Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << std::endl;175 orxout(internal_error, context::sound) << "Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << endl; 174 176 while (!this->availableSoundSources_.empty()) 175 177 { … … 182 184 // Relieve context to destroy it 183 185 if (!alcMakeContextCurrent(NULL)) 184 COUT(1) << "Sound Error: Could not unset ALC context" << std::endl;186 orxout(internal_error, context::sound) << "Could not unset ALC context" << endl; 185 187 alcDestroyContext(this->context_); 186 188 if (ALCenum error = alcGetError(this->device_)) 187 189 { 188 190 if (error == AL_INVALID_OPERATION) 189 COUT(1) << "Sound Error: Could not destroy ALC context because it is the current one" << std::endl;191 orxout(internal_error, context::sound) << "Could not destroy ALC context because it is the current one" << endl; 190 192 else 191 COUT(1) << "Sound Error: Could not destroy ALC context because it is invalid" << std::endl;193 orxout(internal_error, context::sound) << "Could not destroy ALC context because it is invalid" << endl; 192 194 } 193 195 #ifdef AL_VERSION_1_1 194 196 if (!alcCloseDevice(this->device_)) 195 COUT(1) << "Sound Error: Could not destroy ALC device. This might be because there are still buffers in use!" << std::endl;197 orxout(internal_error, context::sound) << "Could not destroy ALC device. This might be because there are still buffers in use!" << endl; 196 198 #else 197 199 alcCloseDevice(this->device_); 198 200 #endif 199 201 if (!alutExit()) 200 COUT(1) << "Sound Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;202 orxout(internal_error, context::sound) << "Closing ALUT failed: " << alutGetErrorString(alutGetError()) << endl; 201 203 } 202 204 … … 244 246 if (crossFadeStep_ <= 0.0 || crossFadeStep_ >= 1.0 ) 245 247 { 246 COUT(2) << "Sound warning: fade step out of range, ignoring change." << std::endl;248 orxout(internal_warning, context::sound) << "Fade step out of range, ignoring change." << endl; 247 249 ResetConfigValue(crossFadeStep_); 248 250 } … … 253 255 float clampedVolume = clamp(this->volume_[type], 0.0f, 1.0f); 254 256 if (clampedVolume != this->volume_[type]) 255 COUT(2) << "Sound warning: Volume setting (" << type << ") out of range, clamping." << std::endl;257 orxout(internal_warning, context::sound) << "Volume setting (" << type << ") out of range, clamping." << endl; 256 258 this->updateVolume(type); 257 259 } … … 321 323 if (error == AL_INVALID_VALUE) 322 324 // @TODO: Follow this constantly appearing, nerve-racking warning 323 COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;325 orxout(internal_error, context::sound) << "OpenAL: Invalid listener position" << endl; 324 326 } 325 327 … … 335 337 ALenum error = alGetError(); 336 338 if (error == AL_INVALID_VALUE) 337 COUT(2) << "Sound: OpenAL: Invalid listener orientation" << std::endl;339 orxout(internal_error, context::sound) << "OpenAL: Invalid listener orientation" << endl; 338 340 } 339 341 … … 346 348 if (it->first == newAmbient) 347 349 { 348 COUT(2) << "Sound warning: Will not play an AmbientSound twice." << std::endl;350 orxout(internal_warning, context::sound) << "Will not play an AmbientSound twice." << endl; 349 351 return; 350 352 } … … 520 522 catch (const std::exception& ex) 521 523 { 522 COUT(1) << ex.what() << std::endl;524 orxout(internal_error, context::sound) << ex.what() << endl; 523 525 return buffer; 524 526 } … … 614 616 alDeleteSources(1, &this->availableSoundSources_.back()); 615 617 if (alGetError()) 616 COUT(1) << "Sound Error: Failed to delete a source --> lost forever" << std::endl;618 orxout(internal_error, context::sound) << "Failed to delete a source --> lost forever" << endl; 617 619 this->availableSoundSources_.pop_back(); 618 620 } -
code/trunk/src/orxonox/sound/SoundStreamer.cc
r7163 r8858 51 51 if (ret < 0) 52 52 { 53 COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;53 orxout(internal_error, context::sound) << "libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << endl; 54 54 ov_clear(&vf); 55 55 return; … … 77 77 else if (ret < 0) 78 78 { 79 COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;79 orxout(internal_error, context::sound) << "libvorbisfile: error reading the file" << endl; 80 80 ov_clear(&vf); 81 81 return; … … 91 91 alGetSourcei(audioSource, AL_BUFFERS_PROCESSED, &processed); 92 92 if (ALint error = alGetError()) 93 COUT(2) << "Sound Warning:Couldn't get number of processed buffers: "94 << SoundManager::getALErrorString(error) << std::endl;93 orxout(internal_warning, context::sound) << "Couldn't get number of processed buffers: " 94 << SoundManager::getALErrorString(error) << endl; 95 95 96 96 if(processed > 0) … … 99 99 alSourceUnqueueBuffers(audioSource, processed, buffers); 100 100 if (ALint error = alGetError()) 101 COUT(2) << "Sound Warning:Couldn't unqueue buffers: "102 << SoundManager::getALErrorString(error) << std::endl;101 orxout(internal_warning, context::sound) << "Couldn't unqueue buffers: " 102 << SoundManager::getALErrorString(error) << endl; 103 103 104 104 for(int i = 0; i < processed; i++) … … 111 111 else if (ret < 0) 112 112 { 113 COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;113 orxout(internal_error, context::sound) << "libvorbisfile: error reading the file" << endl; 114 114 ov_clear(&vf); 115 115 return; … … 121 121 alSourceQueueBuffers(audioSource, processed, buffers); 122 122 if (ALint error = alGetError()) 123 COUT(2) << "Sound Warning:Couldn't queue buffers: "124 << SoundManager::getALErrorString(error) << std::endl;123 orxout(internal_warning, context::sound) << "Couldn't queue buffers: " 124 << SoundManager::getALErrorString(error) << endl; 125 125 } 126 126 } -
code/trunk/src/orxonox/sound/WorldSound.cc
r8351 r8858 94 94 ALenum error = alGetError(); 95 95 if (error == AL_INVALID_VALUE) 96 COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl;96 orxout(internal_error, context::sound) << "OpenAL: Invalid sound position" << endl; 97 97 98 98 const Vector3& vel = this->getVelocity(); … … 100 100 error = alGetError(); 101 101 if (error == AL_INVALID_VALUE) 102 COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl;102 orxout(internal_error, context::sound) << "OpenAL: Invalid sound velocity" << endl; 103 103 104 104 const Vector3& direction = -this->getWorldOrientation().zAxis(); … … 106 106 error = alGetError(); 107 107 if (error == AL_INVALID_VALUE) 108 COUT(2) << "Sound: OpenAL: Invalid sound direction" << std::endl;108 orxout(internal_error, context::sound) << "OpenAL: Invalid sound direction" << endl; 109 109 } 110 110 }
Note: See TracChangeset
for help on using the changeset viewer.