From 324dfa1561efba6492b72ad4d9306e69b9124776 Mon Sep 17 00:00:00 2001 From: Anders Arnholm Date: Fri, 19 Dec 2008 10:12:25 +0100 Subject: Clean up logging to used standard LL metods. --- linden/indra/llaudio/audioengine.cpp | 56 +++++++++++----------- linden/indra/llaudio/audioengine_openal.cpp | 74 ++++++++++++++--------------- 2 files changed, 65 insertions(+), 65 deletions(-) (limited to 'linden/indra/llaudio') diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index 239981b..da9bcba 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -116,7 +116,7 @@ bool LLAudioEngine::init(const S32 num_channels, void* userdata) // Initialize the decode manager gAudioDecodeMgrp = new LLAudioDecodeMgr; - llinfos << "LLAudioEngine::init() AudioEngine successfully initialized" << llendl; + LL_INFOS("AudioEngine") << "LLAudioEngine::init() AudioEngine successfully initialized" << llendl; return true; } @@ -171,7 +171,7 @@ void LLAudioEngine::shutdown() // virtual void LLAudioEngine::startInternetStream(const std::string& url) { - llinfos << "entered startInternetStream()" << llendl; + LL_INFOS("AudioEngine") << "entered startInternetStream()" << llendl; if (!mInternetStreamMedia) { @@ -179,7 +179,7 @@ void LLAudioEngine::startInternetStream(const std::string& url) if (mgr) { mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis. - llinfos << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl; + LL_INFOS("AudioEngine") << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl; } } @@ -187,14 +187,14 @@ void LLAudioEngine::startInternetStream(const std::string& url) return; if (!url.empty()) { - llinfos << "Starting internet stream: " << url << llendl; + LL_INFOS("AudioEngine") << "Starting internet stream: " << url << llendl; mInternetStreamURL = url; mInternetStreamMedia->navigateTo ( url ); - llinfos << "Playing....." << llendl; + LL_INFOS("AudioEngine") << "Playing....." << llendl; mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START); mInternetStreamMedia->updateMedia(); } else { - llinfos << "setting stream to NULL"<< llendl; + LL_INFOS("AudioEngine") << "setting stream to NULL"<< llendl; mInternetStreamURL.clear(); mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP); mInternetStreamMedia->updateMedia(); @@ -205,12 +205,12 @@ void LLAudioEngine::startInternetStream(const std::string& url) // virtual void LLAudioEngine::stopInternetStream() { - llinfos << "entered stopInternetStream()" << llendl; + LL_INFOS("AudioEngine") << "entered stopInternetStream()" << llendl; if(mInternetStreamMedia) { if( ! mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP)){ - llinfos << "attempting to stop stream failed!" << llendl; + LL_INFOS("AudioEngine") << "attempting to stop stream failed!" << llendl; } mInternetStreamMedia->updateMedia(); } @@ -221,7 +221,7 @@ void LLAudioEngine::stopInternetStream() // virtual void LLAudioEngine::pauseInternetStream(int pause) { - llinfos << "entered pauseInternetStream()" << llendl; + LL_INFOS("AudioEngine") << "entered pauseInternetStream()" << llendl; if(!mInternetStreamMedia) return; @@ -230,12 +230,12 @@ void LLAudioEngine::pauseInternetStream(int pause) { if(! mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_PAUSE)) { - llinfos << "attempting to pause stream failed!" << llendl; + LL_INFOS("AudioEngine") << "attempting to pause stream failed!" << llendl; } } else { if(! mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START)) { - llinfos << "attempting to unpause stream failed!" << llendl; + LL_INFOS("AudioEngine") << "attempting to unpause stream failed!" << llendl; } } mInternetStreamMedia->updateMedia(); @@ -386,7 +386,7 @@ void LLAudioEngine::idle(F32 max_decode_time) LLAudioChannel *channelp = getFreeChannel(max_priority); if (channelp) { - //llinfos << "Replacing source in channel due to priority!" << llendl; + //LL_INFOS("AudioEngine") << "Replacing source in channel due to priority!" << llendl; max_sourcep->setChannel(channelp); channelp->setSource(max_sourcep); if (max_sourcep->isSyncSlave()) @@ -553,7 +553,7 @@ void LLAudioEngine::idle(F32 max_decode_time) { if (!mBuffers[i]->mInUse && mBuffers[i]->mLastUseTimer.getElapsedTimeF32() > 30.f) { - //llinfos << "Flushing unused buffer!" << llendl; + //LL_INFOS("AudioEngine") << "Flushing unused buffer!" << llendl; mBuffers[i]->mAudioDatap->mBufferp = NULL; delete mBuffers[i]; mBuffers[i] = NULL; @@ -666,8 +666,8 @@ LLAudioBuffer *LLAudioEngine::getFreeBuffer() if (buffer_id >= 0) { - llinfos << "Taking over unused buffer " << buffer_id << llendl; - //llinfos << "Flushing unused buffer!" << llendl; + LL_INFOS("AudioEngine") << "Taking over unused buffer " << buffer_id << llendl; + //LL_INFOS("AudioEngine") << "Flushing unused buffer!" << llendl; mBuffers[buffer_id]->mAudioDatap->mBufferp = NULL; delete mBuffers[buffer_id]; mBuffers[buffer_id] = createBuffer(); @@ -879,7 +879,7 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i const S32 type, const LLVector3d &pos_global) { // Create a new source (since this can't be associated with an existing source. - //llinfos << "Localized: " << audio_uuid << llendl; + //LL_INFOS("AudioEngine") << "Localized: " << audio_uuid << llendl; if (mMuted) { @@ -1101,10 +1101,10 @@ bool LLAudioEngine::hasLocalFile(const LLUUID &uuid) void LLAudioEngine::startNextTransfer() { - //llinfos << "LLAudioEngine::startNextTransfer()" << llendl; + //LL_INFOS("AudioEngine") << "LLAudioEngine::startNextTransfer()" << llendl; if (mCurrentTransfer.notNull() || getMuted()) { - //llinfos << "Transfer in progress, aborting" << llendl; + //LL_INFOS("AudioEngine") << "Transfer in progress, aborting" << llendl; return; } @@ -1285,7 +1285,7 @@ void LLAudioEngine::startNextTransfer() if (asset_id.notNull()) { - llinfos << "Getting asset data for: " << asset_id << llendl; + LL_INFOS("AudioEngine") << "Getting asset data for: " << asset_id << llendl; gAudiop->mCurrentTransfer = asset_id; gAudiop->mCurrentTransferTimer.reset(); gAssetStorage->getAssetData(asset_id, LLAssetType::AT_SOUND, @@ -1293,7 +1293,7 @@ void LLAudioEngine::startNextTransfer() } else { - //llinfos << "No pending transfers?" << llendl; + //LL_INFOS("AudioEngine") << "No pending transfers?" << llendl; } } @@ -1303,7 +1303,7 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E { if (result_code) { - llinfos << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << llendl; + LL_INFOS("AudioEngine") << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << llendl; // Need to mark data as bad to avoid constant rerequests. LLAudioData *adp = gAudiop->getAudioData(uuid); if (adp) @@ -1524,7 +1524,7 @@ bool LLAudioSource::isDone() { // We don't have a channel assigned, and it's been // over 5 seconds since we tried to play it. Don't bother. - //llinfos << "No channel assigned, source is done" << llendl; + //LL_INFOS("AudioEngine") << "No channel assigned, source is done" << llendl; return true; } else @@ -1684,7 +1684,7 @@ LLAudioChannel::LLAudioChannel() : LLAudioChannel::~LLAudioChannel() { // Need to disconnect any sources which are using this channel. - //llinfos << "Cleaning up audio channel" << llendl; + //LL_INFOS("AudioEngine") << "Cleaning up audio channel" << llendl; if (mCurrentSourcep) { mCurrentSourcep->setChannel(NULL); @@ -1695,12 +1695,12 @@ LLAudioChannel::~LLAudioChannel() void LLAudioChannel::setSource(LLAudioSource *sourcep) { - //llinfos << this << ": setSource(" << sourcep << ")" << llendl; + //LL_INFOS("AudioEngine") << this << ": setSource(" << sourcep << ")" << llendl; if (!sourcep) { // Clearing the source for this channel, don't need to do anything. - //llinfos << "Clearing source for channel" << llendl; + //LL_INFOS("AudioEngine") << "Clearing source for channel" << llendl; cleanup(); mCurrentSourcep = NULL; mWaiting = false; @@ -1710,7 +1710,7 @@ void LLAudioChannel::setSource(LLAudioSource *sourcep) if (sourcep == mCurrentSourcep) { // Don't reallocate the channel, this will make FMOD goofy. - //llinfos << "Calling setSource with same source!" << llendl; + //LL_INFOS("AudioEngine") << "Calling setSource with same source!" << llendl; } mCurrentSourcep = sourcep; @@ -1802,7 +1802,7 @@ bool LLAudioData::load() if (mBufferp) { // We already have this sound in a buffer, don't do anything. - llinfos << "Already have a buffer for this sound, don't bother loading!" << llendl; + LL_INFOS("AudioEngine") << "Already have a buffer for this sound, don't bother loading!" << llendl; return true; } @@ -1810,7 +1810,7 @@ bool LLAudioData::load() if (!mBufferp) { // No free buffers, abort. - llinfos << "Not able to allocate a new audio buffer, aborting." << llendl; + LL_INFOS("AudioEngine") << "Not able to allocate a new audio buffer, aborting." << llendl; return false; } diff --git a/linden/indra/llaudio/audioengine_openal.cpp b/linden/indra/llaudio/audioengine_openal.cpp index 002dfba..f13a5fa 100644 --- a/linden/indra/llaudio/audioengine_openal.cpp +++ b/linden/indra/llaudio/audioengine_openal.cpp @@ -62,33 +62,33 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata) if(!alutInit(NULL, NULL)) { - llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL; return false; } - llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl; + LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL; - llinfos << "OpenAL version: " - << ll_safe_string(alGetString(AL_VERSION)) << llendl; - llinfos << "OpenAL vendor: " - << ll_safe_string(alGetString(AL_VENDOR)) << llendl; - llinfos << "OpenAL renderer: " - << ll_safe_string(alGetString(AL_RENDERER)) << llendl; + LL_INFOS("OpenAL") << "OpenAL version: " + << ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL; + LL_INFOS("OpenAL") << "OpenAL vendor: " + << ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL; + LL_INFOS("OpenAL") << "OpenAL renderer: " + << ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL; ALint major = alutGetMajorVersion (); ALint minor = alutGetMinorVersion (); - llinfos << "ALUT version: " << major << "." << minor << llendl; + LL_INFOS("OpenAL") << "ALUT version: " << major << "." << minor << LL_ENDL; ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext()); alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); - llinfos << "ALC version: " << major << "." << minor << llendl; + LL_INFOS("OpenAL") << "ALC version: " << major << "." << minor << LL_ENDL; - llinfos << "ALC default device: " + LL_INFOS("OpenAL") << "ALC default device: " << ll_safe_string(alcGetString(device, ALC_DEFAULT_DEVICE_SPECIFIER)) - << llendl; + << LL_ENDL; return true; } @@ -128,24 +128,24 @@ void LLAudioEngine_OpenAL::allocateListener() mListenerp = (LLListener *) new LLListener_OpenAL(); if(!mListenerp) { - llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL; } } // virtual void LLAudioEngine_OpenAL::shutdown() { - llinfos << "About to LLAudioEngine::shutdown()" << llendl; + LL_INFOS("OpenAL") << "About to LLAudioEngine::shutdown()" << LL_ENDL; LLAudioEngine::shutdown(); - llinfos << "About to alutExit()" << llendl; + LL_INFOS("OpenAL") << "About to alutExit()" << LL_ENDL; if(!alutExit()) { - llwarns << "Nuts." << llendl; - llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl; + LL_WARNS("OpenAL") << "Nuts." << LL_ENDL; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL; } - llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl; + LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL; delete mListenerp; mListenerp = NULL; @@ -163,7 +163,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel() void LLAudioEngine_OpenAL::setInternalGain(F32 gain) { - //llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl; + //LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL; alListenerf(AL_GAIN, gain); } @@ -191,7 +191,7 @@ void LLAudioChannelOpenAL::play() { if (mALSource == AL_NONE) { - llwarns << "Playing without a mALSource, aborting" << llendl; + LL_WARNS("OpenAL") << "Playing without a mALSource, aborting" << LL_ENDL; return; } @@ -216,8 +216,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp) alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET, &master_offset); - llinfos << "Syncing with master at " << master_offset - << "sec" << llendl; + LL_INFOS("OpenAL") << "Syncing with master at " << master_offset + << "sec" << LL_ENDL; // *TODO: detect when this fails, maybe use AL_SAMPLE_ alSourcef(mALSource, AL_SEC_OFFSET, master_offset); } @@ -341,18 +341,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename) ALenum error = alutGetError(); if (gDirUtilp->fileExists(filename)) { - llwarns << + LL_WARNS("OpenAL") << "LLAudioBufferOpenAL::loadWAV() Error loading " << filename - << " " << alutGetErrorString(error) << llendl; + << " " << alutGetErrorString(error) << LL_ENDL; } else { // It's common for the file to not actually exist. - lldebugs << + LL_DEBUGS("OpenAL") << "LLAudioBufferOpenAL::loadWAV() Error loading " << filename - << " " << alutGetErrorString(error) << llendl; + << " " << alutGetErrorString(error) << LL_ENDL; } return false; } @@ -376,7 +376,7 @@ U32 LLAudioBufferOpenAL::getLength() void LLAudioEngine_OpenAL::initWind() { ALenum error; - llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl; + LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL; mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS; @@ -386,7 +386,7 @@ void LLAudioEngine_OpenAL::initWind() if((error=alGetError()) != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<; @@ -399,16 +399,16 @@ void LLAudioEngine_OpenAL::initWind() if(mWindBuf==NULL) { - llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl; + LL_ERRS("OpenAL") << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL; mEnableWind=false; } - llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl; + LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL; } void LLAudioEngine_OpenAL::cleanupWind() { - llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl; + LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL; if (mWindSource != AL_NONE) { @@ -484,7 +484,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed); mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0); - //llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl; + //LL_INFOS("OpenAL") << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << LL_ENDL; while(processed--) // unqueue old buffers { @@ -495,7 +495,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) error = alGetError(); if(error != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL; } else { @@ -511,7 +511,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) alGenBuffers(1,&buffer); if((error=alGetError()) != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind buffer: " << error << llendl; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::initWind() Error creating wind buffer: " << error << LL_ENDL; break; } @@ -523,12 +523,12 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) mWindBufFreq); error = alGetError(); if(error != AL_NO_ERROR) - llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL; alSourceQueueBuffers(mWindSource, 1, &buffer); error = alGetError(); if(error != AL_NO_ERROR) - llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl; + LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL; --mNumEmptyWindALBuffers; } @@ -539,6 +539,6 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) { alSourcePlay(mWindSource); - llinfos << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl; + LL_INFOS("OpenAL") << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL; } } -- cgit v1.1