Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 1, 2011, 5:16:52 AM (13 years ago)
Author:
rgrieder
Message:

Reverted last commit (forgot to tick "Switch working copy to new branch"…)

Location:
code/branches/usability
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability

  • code/branches/usability/src/orxonox/sound/SoundManager.cc

    r8005 r8006  
    2222 *   Author:
    2323 *       Erwin 'vaiursch' Herrsche
    24  *       
    25  *   Co-authors:
    2624 *       Kevin Young
    2725 *       Reto Grieder
     26 *   Co-authors:
     27 *      ...
    2828 *
    2929 */
     
    5252    ManageScopedSingleton(SoundManager, ScopeID::Graphics, true);
    5353
    54     // From SoundPrereqs.h
    55     std::string getALErrorString(ALenum code)
     54    std::string SoundManager::getALErrorString(ALenum code)
    5655    {
    5756        switch (code)
     
    8180
    8281        if (!alutInitWithoutContext(NULL, NULL))
    83             ThrowException(InitialisationFailed, "Sound: Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
     82            ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
    8483        Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit);
    8584
     
    113112            COUT(1) << "Sound: Just getting the DLL with the dependencies is not enough for Windows (esp. Windows 7)!" << std::endl;
    114113#endif
    115             ThrowException(InitialisationFailed, "Sound: Error: Could not open sound device.");
     114            ThrowException(InitialisationFailed, "Sound Error: Could not open sound device.");
    116115        }
    117116        Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_);
    118117
    119118        // Create sound context and make it the currently used one
    120         const ALint contattr[]  = {ALC_SYNC, 1, 0};
    121         this->context_ = alcCreateContext(this->device_, contattr);
     119        this->context_ = alcCreateContext(this->device_, NULL);
    122120        if (this->context_ == NULL)
    123             ThrowException(InitialisationFailed, "Sound: Error: Could not create ALC context");
     121            ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context");
    124122        Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_);
    125123        if (!alcMakeContextCurrent(this->context_))
    126             ThrowException(InitialisationFailed, "Sound: Error: Could not use ALC context");
     124            ThrowException(InitialisationFailed, "Sound Error: Could not use ALC context");
    127125
    128126        GameMode::setPlaysSound(true);
     
    137135            COUT(4) << "Sound: --- Supported MIME Types: " << types << std::endl;
    138136        else
    139             COUT(2) << "Sound: Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;
     137            COUT(2) << "Sound Warning: MIME Type retrieval failed: " << alutGetErrorString(alutGetError()) << std::endl;
    140138
    141139        this->mute_[SoundType::All]     = 1.0f;
     
    151149            this->availableSoundSources_.push_back(source);
    152150        else
    153             ThrowException(InitialisationFailed, "Sound: Error: Could not create even a single source");
     151            ThrowException(InitialisationFailed, "Sound Error: Could not create even a single source");
    154152        // Create a few initial sources
    155153        this->createSoundSources(this->minSources_ - 1);
     
    173171        // If there are still used buffers around, well, that's just very bad...
    174172        if (this->soundBuffers_.size() != this->effectsPool_.size())
    175             COUT(1) << "Sound: Error: Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
     173            COUT(1) << "Sound Error: Some sound buffers are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
    176174        // Empty buffer pool and buffer list
    177175        this->effectsPool_.clear();
     
    180178        // There should not be any sources in use anymore
    181179        if (!this->usedSoundSources_.empty())
    182             COUT(1) << "Sound: Error: Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
     180            COUT(1) << "Sound Error: Some sound sources are still in use but OpenAL is about to shut down. Fix this!" << std::endl;
    183181        while (!this->availableSoundSources_.empty())
    184182        {
     
    191189        // Relieve context to destroy it
    192190        if (!alcMakeContextCurrent(NULL))
    193             COUT(1) << "Sound: Error: Could not unset ALC context" << std::endl;
     191            COUT(1) << "Sound Error: Could not unset ALC context" << std::endl;
    194192        alcDestroyContext(this->context_);
    195193        if (ALCenum error = alcGetError(this->device_))
    196194        {
    197195            if (error == AL_INVALID_OPERATION)
    198                 COUT(1) << "Sound: Error: Could not destroy ALC context because it is the current one" << std::endl;
     196                COUT(1) << "Sound Error: Could not destroy ALC context because it is the current one" << std::endl;
    199197            else
    200                 COUT(1) << "Sound: Error: Could not destroy ALC context because it is invalid" << std::endl;
     198                COUT(1) << "Sound Error: Could not destroy ALC context because it is invalid" << std::endl;
    201199        }
    202200#ifdef AL_VERSION_1_1
    203201        if (!alcCloseDevice(this->device_))
    204             COUT(1) << "Sound: Error: Could not destroy ALC device. This might be because there are still buffers in use!" << std::endl;
     202            COUT(1) << "Sound Error: Could not destroy ALC device. This might be because there are still buffers in use!" << std::endl;
    205203#else
    206204        alcCloseDevice(this->device_);
    207205#endif
    208206        if (!alutExit())
    209             COUT(1) << "Sound: Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;
     207            COUT(1) << "Sound Error: Closing ALUT failed: " << alutGetErrorString(alutGetError()) << std::endl;
    210208    }
    211209
     
    253251        if (crossFadeStep_ <= 0.0 || crossFadeStep_ >= 1.0 )
    254252        {
    255             COUT(2) << "Sound: Warning: fade step out of range, ignoring change." << std::endl;
     253            COUT(2) << "Sound warning: fade step out of range, ignoring change." << std::endl;
    256254            ResetConfigValue(crossFadeStep_);
    257255        }
     
    262260        float clampedVolume = clamp(this->volume_[type], 0.0f, 1.0f);
    263261        if (clampedVolume != this->volume_[type])
    264             COUT(2) << "Sound: Warning: Volume setting (" << type << ") out of range, clamping." << std::endl;
     262            COUT(2) << "Sound warning: Volume setting (" << type << ") out of range, clamping." << std::endl;
    265263        this->updateVolume(type);
    266264    }
     
    354352                if (it->first == newAmbient)
    355353                {
    356                     COUT(2) << "Sound: Warning: Will not play an AmbientSound twice." << std::endl;
     354                    COUT(2) << "Sound warning: Will not play an AmbientSound twice." << std::endl;
    357355                    return;
    358356                }
     
    622620            alDeleteSources(1, &this->availableSoundSources_.back());
    623621            if (alGetError())
    624                 COUT(1) << "Sound: Error: Failed to delete a source --> lost forever" << std::endl;
     622                COUT(1) << "Sound Error: Failed to delete a source --> lost forever" << std::endl;
    625623            this->availableSoundSources_.pop_back();
    626624        }
Note: See TracChangeset for help on using the changeset viewer.