Changeset 8809 for code/branches/output/src/orxonox/sound
- Timestamp:
- Aug 1, 2011, 4:37:38 PM (14 years ago)
- Location:
- code/branches/output/src/orxonox/sound
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/orxonox/sound/AmbientSound.cc
r8706 r8809 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/branches/output/src/orxonox/sound/BaseSound.cc
r8729 r8809 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/branches/output/src/orxonox/sound/SoundBuffer.cc
r8351 r8809 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/branches/output/src/orxonox/sound/SoundManager.cc
r8521 r8809 89 89 std::string renderDevice; 90 90 SetConfigValue(renderDevice, std::string(device)).description("Sound device used for rendering"); 91 COUT(4) << "Sound: Available devices: ";91 orxout(verbose, context::sound) << "Sound: Available devices: "; 92 92 while (true) 93 93 { 94 94 this->deviceNames_.push_back(devices); 95 COUT(4) << '"' << devices << "\", ";95 orxout(verbose, context::sound) << '"' << devices << "\", "; 96 96 devices += strlen(devices) + 1; 97 97 if (*devices == '\0') 98 98 break; 99 99 } 100 COUT(4) << std::endl;100 orxout(verbose, context::sound) << endl; 101 101 102 102 // Open the selected device 103 COUT(3) << "Sound: Opening device \"" << renderDevice << '\' << std::endl;103 orxout(internal_info, context::sound) << "Sound: Opening device \"" << renderDevice << '\' << endl; 104 104 this->device_ = alcOpenDevice(renderDevice.c_str()); 105 105 */ … … 122 122 // Get some information about the sound 123 123 if (const char* version = alGetString(AL_VERSION)) 124 COUT(4) << "Sound: --- OpenAL Version: " << version << std::endl;124 orxout(internal_info, context::sound) << "Sound: --- OpenAL Version: " << version << endl; 125 125 if (const char* vendor = alGetString(AL_VENDOR)) 126 COUT(4) << "Sound: --- OpenAL Vendor : " << vendor << std::endl;126 orxout(internal_info, context::sound) << "Sound: --- OpenAL Vendor : " << vendor << endl; 127 127 if (const char* types = alutGetMIMETypes(ALUT_LOADER_BUFFER)) 128 COUT(4) << "Sound: --- Supported MIME Types: " << types << std::endl;128 orxout(internal_info, context::sound) << "Sound: --- Supported MIME Types: " << types << endl; 129 129 else 130 COUT(2) << "Sound Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;130 orxout(internal_warning, context::sound) << "MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << endl; 131 131 132 132 this->mute_[SoundType::All] = 1.0f; … … 152 152 resetPlaysSoundGuard.Dismiss(); 153 153 154 COUT(4) << "Sound: Initialisation complete" << std::endl;154 orxout(internal_status, context::sound) << "Sound: Initialisation complete" << endl; 155 155 } 156 156 … … 164 164 // If there are still used buffers around, well, that's just very bad... 165 165 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;166 orxout(internal_error, context::sound) << "Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << endl; 167 167 // Empty buffer pool and buffer list 168 168 this->effectsPool_.clear(); … … 171 171 // There should not be any sources in use anymore 172 172 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;173 orxout(internal_error, context::sound) << "Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << endl; 174 174 while (!this->availableSoundSources_.empty()) 175 175 { … … 182 182 // Relieve context to destroy it 183 183 if (!alcMakeContextCurrent(NULL)) 184 COUT(1) << "Sound Error: Could not unset ALC context" << std::endl;184 orxout(internal_error, context::sound) << "Could not unset ALC context" << endl; 185 185 alcDestroyContext(this->context_); 186 186 if (ALCenum error = alcGetError(this->device_)) 187 187 { 188 188 if (error == AL_INVALID_OPERATION) 189 COUT(1) << "Sound Error: Could not destroy ALC context because it is the current one" << std::endl;189 orxout(internal_error, context::sound) << "Could not destroy ALC context because it is the current one" << endl; 190 190 else 191 COUT(1) << "Sound Error: Could not destroy ALC context because it is invalid" << std::endl;191 orxout(internal_error, context::sound) << "Could not destroy ALC context because it is invalid" << endl; 192 192 } 193 193 #ifdef AL_VERSION_1_1 194 194 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;195 orxout(internal_error, context::sound) << "Could not destroy ALC device. This might be because there are still buffers in use!" << endl; 196 196 #else 197 197 alcCloseDevice(this->device_); 198 198 #endif 199 199 if (!alutExit()) 200 COUT(1) << "Sound Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;200 orxout(internal_error, context::sound) << "Closing ALUT failed: " << alutGetErrorString(alutGetError()) << endl; 201 201 } 202 202 … … 244 244 if (crossFadeStep_ <= 0.0 || crossFadeStep_ >= 1.0 ) 245 245 { 246 COUT(2) << "Sound warning: fade step out of range, ignoring change." << std::endl;246 orxout(internal_warning, context::sound) << "Fade step out of range, ignoring change." << endl; 247 247 ResetConfigValue(crossFadeStep_); 248 248 } … … 253 253 float clampedVolume = clamp(this->volume_[type], 0.0f, 1.0f); 254 254 if (clampedVolume != this->volume_[type]) 255 COUT(2) << "Sound warning: Volume setting (" << type << ") out of range, clamping." << std::endl;255 orxout(internal_warning, context::sound) << "Volume setting (" << type << ") out of range, clamping." << endl; 256 256 this->updateVolume(type); 257 257 } … … 321 321 if (error == AL_INVALID_VALUE) 322 322 // @TODO: Follow this constantly appearing, nerve-racking warning 323 COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;323 orxout(internal_error, context::sound) << "OpenAL: Invalid listener position" << endl; 324 324 } 325 325 … … 335 335 ALenum error = alGetError(); 336 336 if (error == AL_INVALID_VALUE) 337 COUT(2) << "Sound: OpenAL: Invalid listener orientation" << std::endl;337 orxout(internal_error, context::sound) << "OpenAL: Invalid listener orientation" << endl; 338 338 } 339 339 … … 346 346 if (it->first == newAmbient) 347 347 { 348 COUT(2) << "Sound warning: Will not play an AmbientSound twice." << std::endl;348 orxout(internal_warning, context::sound) << "Will not play an AmbientSound twice." << endl; 349 349 return; 350 350 } … … 520 520 catch (const std::exception& ex) 521 521 { 522 COUT(1) << ex.what() << std::endl;522 orxout(internal_error, context::sound) << ex.what() << endl; 523 523 return buffer; 524 524 } … … 614 614 alDeleteSources(1, &this->availableSoundSources_.back()); 615 615 if (alGetError()) 616 COUT(1) << "Sound Error: Failed to delete a source --> lost forever" << std::endl;616 orxout(internal_error, context::sound) << "Failed to delete a source --> lost forever" << endl; 617 617 this->availableSoundSources_.pop_back(); 618 618 } -
code/branches/output/src/orxonox/sound/SoundStreamer.cc
r7163 r8809 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/branches/output/src/orxonox/sound/WorldSound.cc
r8351 r8809 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.