Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 1, 2011, 4:37:38 PM (13 years ago)
Author:
landauf
Message:

Replaced COUT() with orxout() in tools and orxonox library. Requires quite some fine-tuning.

File:
1 edited

Legend:

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

    r8521 r8809  
    8989        std::string renderDevice;
    9090        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: ";
    9292        while (true)
    9393        {
    9494            this->deviceNames_.push_back(devices);
    95             COUT(4) << '"' << devices << "\", ";
     95            orxout(verbose, context::sound) << '"' << devices << "\", ";
    9696            devices += strlen(devices) + 1;
    9797            if (*devices == '\0')
    9898                break;
    9999        }
    100         COUT(4) << std::endl;
     100        orxout(verbose, context::sound) << endl;
    101101
    102102        // Open the selected device
    103         COUT(3) << "Sound: Opening device \"" << renderDevice << '\' << std::endl;
     103        orxout(internal_info, context::sound) << "Sound: Opening device \"" << renderDevice << '\' << endl;
    104104        this->device_ = alcOpenDevice(renderDevice.c_str());
    105105*/
     
    122122        // Get some information about the sound
    123123        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;
    125125        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;
    127127        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;
    129129        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;
    131131
    132132        this->mute_[SoundType::All]     = 1.0f;
     
    152152        resetPlaysSoundGuard.Dismiss();
    153153
    154         COUT(4) << "Sound: Initialisation complete" << std::endl;
     154        orxout(internal_status, context::sound) << "Sound: Initialisation complete" << endl;
    155155    }
    156156
     
    164164        // If there are still used buffers around, well, that's just very bad...
    165165        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;
    167167        // Empty buffer pool and buffer list
    168168        this->effectsPool_.clear();
     
    171171        // There should not be any sources in use anymore
    172172        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;
    174174        while (!this->availableSoundSources_.empty())
    175175        {
     
    182182        // Relieve context to destroy it
    183183        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;
    185185        alcDestroyContext(this->context_);
    186186        if (ALCenum error = alcGetError(this->device_))
    187187        {
    188188            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;
    190190            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;
    192192        }
    193193#ifdef AL_VERSION_1_1
    194194        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;
    196196#else
    197197        alcCloseDevice(this->device_);
    198198#endif
    199199        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;
    201201    }
    202202
     
    244244        if (crossFadeStep_ <= 0.0 || crossFadeStep_ >= 1.0 )
    245245        {
    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;
    247247            ResetConfigValue(crossFadeStep_);
    248248        }
     
    253253        float clampedVolume = clamp(this->volume_[type], 0.0f, 1.0f);
    254254        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;
    256256        this->updateVolume(type);
    257257    }
     
    321321        if (error == AL_INVALID_VALUE)
    322322            // @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;
    324324    }
    325325
     
    335335        ALenum error = alGetError();
    336336        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;
    338338    }
    339339
     
    346346                if (it->first == newAmbient)
    347347                {
    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;
    349349                    return;
    350350                }
     
    520520            catch (const std::exception& ex)
    521521            {
    522                 COUT(1) << ex.what() << std::endl;
     522                orxout(internal_error, context::sound) << ex.what() << endl;
    523523                return buffer;
    524524            }
     
    614614            alDeleteSources(1, &this->availableSoundSources_.back());
    615615            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;
    617617            this->availableSoundSources_.pop_back();
    618618        }
Note: See TracChangeset for help on using the changeset viewer.