Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 11, 2010, 3:12:37 PM (15 years ago)
Author:
erwin
Message:

Commit before rebase, attempt to fix everything ;-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sound4/src/orxonox/sound/SoundManager.cc

    r6435 r6504  
    4343#include "core/ScopedSingletonManager.h"
    4444#include "core/Resource.h"
    45 #include "SoundBuffer.h"
     45#include "SoundBuffer.h":
    4646#include "BaseSound.h"
    4747#include "AmbientSound.h"
     
    7979
    8080        if (!alutInitWithoutContext(NULL, NULL))
    81             ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
     81            ThrowException(InitialisationFailed, "Sound: Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
    8282        Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
    8383
     
    111111            COUT(1) << "Sound: Just getting the DLL with the dependencies is not enough for Windows (esp. Windows 7)!" << std::endl;
    112112#endif
    113             ThrowException(InitialisationFailed, "Sound Error: Could not open sound device.");
     113            ThrowException(InitialisationFailed, "Sound: Error: Could not open sound device.");
    114114        }
    115115        Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_);
     
    118118        this->context_ = alcCreateContext(this->device_, NULL);
    119119        if (this->context_ == NULL)
    120             ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context");
     120            ThrowException(InitialisationFailed, "Sound: Error: Could not create ALC context");
    121121        Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_);
    122122        if (!alcMakeContextCurrent(this->context_))
    123             ThrowException(InitialisationFailed, "Sound Error: Could not use ALC context");
     123            ThrowException(InitialisationFailed, "Sound: Error: Could not use ALC context");
    124124
    125125        GameMode::setPlaysSound(true);
     
    134134            COUT(4) << "Sound: --- Supported MIME Types: " << types << std::endl;
    135135        else
    136             COUT(2) << "Sound Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;
     136            COUT(2) << "Sound: Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;
    137137
    138138        this->mute_[SoundType::All]     = 1.0f;
     
    148148            this->availableSoundSources_.push_back(source);
    149149        else
    150             ThrowException(InitialisationFailed, "Sound Error: Could not create even a single source");
     150            ThrowException(InitialisationFailed, "Sound: Error: Could not create even a single source");
    151151        // Create a few initial sources
    152152        this->createSoundSources(this->minSources_ - 1);
     
    169169        // If there are still used buffers around, well, that's just very bad...
    170170        if (this->soundBuffers_.size() != this->effectsPool_.size())
    171             COUT(1) << "Sound Error: Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
     171            COUT(1) << "Sound: Error: Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
    172172        // Empty buffer pool and buffer list
    173173        this->effectsPool_.clear();
     
    176176        // There should not be any sources in use anymore
    177177        if (!this->usedSoundSources_.empty())
    178             COUT(1) << "Sound Error: Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
     178            COUT(1) << "Sound: Error: Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
    179179        while (!this->availableSoundSources_.empty())
    180180        {
     
    187187        // Relieve context to destroy it
    188188        if (!alcMakeContextCurrent(NULL))
    189             COUT(1) << "Sound Error: Could not unset ALC context" << std::endl;
     189            COUT(1) << "Sound: Error: Could not unset ALC context" << std::endl;
    190190        alcDestroyContext(this->context_);
    191191        if (ALCenum error = alcGetError(this->device_))
    192192        {
    193193            if (error == AL_INVALID_OPERATION)
    194                 COUT(1) << "Sound Error: Could not destroy ALC context because it is the current one" << std::endl;
     194                COUT(1) << "Sound: Error: Could not destroy ALC context because it is the current one" << std::endl;
    195195            else
    196                 COUT(1) << "Sound Error: Could not destroy ALC context because it is invalid" << std::endl;
     196                COUT(1) << "Sound: Error: Could not destroy ALC context because it is invalid" << std::endl;
    197197        }
    198198#ifdef AL_VERSION_1_1
    199199        if (!alcCloseDevice(this->device_))
    200             COUT(1) << "Sound Error: Could not destroy ALC device. This might be because there are still buffers in use!" << std::endl;
     200            COUT(1) << "Sound: Error: Could not destroy ALC device. This might be because there are still buffers in use!" << std::endl;
    201201#else
    202202        alcCloseDevice(this->device_);
    203203#endif
    204204        if (!alutExit())
    205             COUT(1) << "Sound Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;
     205            COUT(1) << "Sound: Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;
    206206    }
    207207
     
    249249        if (crossFadeStep_ <= 0.0 || crossFadeStep_ >= 1.0 )
    250250        {
    251             COUT(2) << "Sound warning: fade step out of range, ignoring change." << std::endl;
     251            COUT(2) << "Sound: Warning: fade step out of range, ignoring change." << std::endl;
    252252            ResetConfigValue(crossFadeStep_);
    253253        }
     
    258258        float clampedVolume = clamp(this->volume_[type], 0.0f, 1.0f);
    259259        if (clampedVolume != this->volume_[type])
    260             COUT(2) << "Sound warning: Volume setting (" << type << ") out of range, clamping." << std::endl;
     260            COUT(2) << "Sound: Warning: Volume setting (" << type << ") out of range, clamping." << std::endl;
    261261        this->updateVolume(type);
    262262    }
     
    350350                if (it->first == newAmbient)
    351351                {
    352                     COUT(2) << "Sound warning: Will not play an AmbientSound twice." << std::endl;
     352                    COUT(2) << "Sound: Warning: Will not play an AmbientSound twice." << std::endl;
    353353                    return;
    354354                }
     
    618618            alDeleteSources(1, &this->availableSoundSources_.back());
    619619            if (alGetError())
    620                 COUT(1) << "Sound Error: Failed to delete a source --> lost forever" << std::endl;
     620                COUT(1) << "Sound: Error: Failed to delete a source --> lost forever" << std::endl;
    621621            this->availableSoundSources_.pop_back();
    622622        }
Note: See TracChangeset for help on using the changeset viewer.