diff options
author | Anders Arnholm | 2008-12-19 10:12:25 +0100 |
---|---|---|
committer | Anders Arnholm | 2008-12-19 10:12:25 +0100 |
commit | 324dfa1561efba6492b72ad4d9306e69b9124776 (patch) | |
tree | ec203e765d20e7e042bbb042cd520f00b3185f43 /linden/indra/llaudio/audioengine_openal.cpp | |
parent | Make openal-1 version info (diff) | |
download | meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.zip meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.tar.gz meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.tar.bz2 meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.tar.xz |
Clean up logging to used standard LL metods.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llaudio/audioengine_openal.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
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) | |||
62 | 62 | ||
63 | if(!alutInit(NULL, NULL)) | 63 | if(!alutInit(NULL, NULL)) |
64 | { | 64 | { |
65 | llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl; | 65 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL; |
66 | return false; | 66 | return false; |
67 | } | 67 | } |
68 | 68 | ||
69 | llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl; | 69 | LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL; |
70 | 70 | ||
71 | llinfos << "OpenAL version: " | 71 | LL_INFOS("OpenAL") << "OpenAL version: " |
72 | << ll_safe_string(alGetString(AL_VERSION)) << llendl; | 72 | << ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL; |
73 | llinfos << "OpenAL vendor: " | 73 | LL_INFOS("OpenAL") << "OpenAL vendor: " |
74 | << ll_safe_string(alGetString(AL_VENDOR)) << llendl; | 74 | << ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL; |
75 | llinfos << "OpenAL renderer: " | 75 | LL_INFOS("OpenAL") << "OpenAL renderer: " |
76 | << ll_safe_string(alGetString(AL_RENDERER)) << llendl; | 76 | << ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL; |
77 | 77 | ||
78 | ALint major = alutGetMajorVersion (); | 78 | ALint major = alutGetMajorVersion (); |
79 | ALint minor = alutGetMinorVersion (); | 79 | ALint minor = alutGetMinorVersion (); |
80 | llinfos << "ALUT version: " << major << "." << minor << llendl; | 80 | LL_INFOS("OpenAL") << "ALUT version: " << major << "." << minor << LL_ENDL; |
81 | 81 | ||
82 | ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext()); | 82 | ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext()); |
83 | 83 | ||
84 | alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); | 84 | alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); |
85 | alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); | 85 | alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); |
86 | llinfos << "ALC version: " << major << "." << minor << llendl; | 86 | LL_INFOS("OpenAL") << "ALC version: " << major << "." << minor << LL_ENDL; |
87 | 87 | ||
88 | llinfos << "ALC default device: " | 88 | LL_INFOS("OpenAL") << "ALC default device: " |
89 | << ll_safe_string(alcGetString(device, | 89 | << ll_safe_string(alcGetString(device, |
90 | ALC_DEFAULT_DEVICE_SPECIFIER)) | 90 | ALC_DEFAULT_DEVICE_SPECIFIER)) |
91 | << llendl; | 91 | << LL_ENDL; |
92 | 92 | ||
93 | return true; | 93 | return true; |
94 | } | 94 | } |
@@ -128,24 +128,24 @@ void LLAudioEngine_OpenAL::allocateListener() | |||
128 | mListenerp = (LLListener *) new LLListener_OpenAL(); | 128 | mListenerp = (LLListener *) new LLListener_OpenAL(); |
129 | if(!mListenerp) | 129 | if(!mListenerp) |
130 | { | 130 | { |
131 | llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl; | 131 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | // virtual | 135 | // virtual |
136 | void LLAudioEngine_OpenAL::shutdown() | 136 | void LLAudioEngine_OpenAL::shutdown() |
137 | { | 137 | { |
138 | llinfos << "About to LLAudioEngine::shutdown()" << llendl; | 138 | LL_INFOS("OpenAL") << "About to LLAudioEngine::shutdown()" << LL_ENDL; |
139 | LLAudioEngine::shutdown(); | 139 | LLAudioEngine::shutdown(); |
140 | 140 | ||
141 | llinfos << "About to alutExit()" << llendl; | 141 | LL_INFOS("OpenAL") << "About to alutExit()" << LL_ENDL; |
142 | if(!alutExit()) | 142 | if(!alutExit()) |
143 | { | 143 | { |
144 | llwarns << "Nuts." << llendl; | 144 | LL_WARNS("OpenAL") << "Nuts." << LL_ENDL; |
145 | llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl; | 145 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL; |
146 | } | 146 | } |
147 | 147 | ||
148 | llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl; | 148 | LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL; |
149 | 149 | ||
150 | delete mListenerp; | 150 | delete mListenerp; |
151 | mListenerp = NULL; | 151 | mListenerp = NULL; |
@@ -163,7 +163,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel() | |||
163 | 163 | ||
164 | void LLAudioEngine_OpenAL::setInternalGain(F32 gain) | 164 | void LLAudioEngine_OpenAL::setInternalGain(F32 gain) |
165 | { | 165 | { |
166 | //llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl; | 166 | //LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL; |
167 | alListenerf(AL_GAIN, gain); | 167 | alListenerf(AL_GAIN, gain); |
168 | } | 168 | } |
169 | 169 | ||
@@ -191,7 +191,7 @@ void LLAudioChannelOpenAL::play() | |||
191 | { | 191 | { |
192 | if (mALSource == AL_NONE) | 192 | if (mALSource == AL_NONE) |
193 | { | 193 | { |
194 | llwarns << "Playing without a mALSource, aborting" << llendl; | 194 | LL_WARNS("OpenAL") << "Playing without a mALSource, aborting" << LL_ENDL; |
195 | return; | 195 | return; |
196 | } | 196 | } |
197 | 197 | ||
@@ -216,8 +216,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp) | |||
216 | alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET, | 216 | alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET, |
217 | &master_offset); | 217 | &master_offset); |
218 | 218 | ||
219 | llinfos << "Syncing with master at " << master_offset | 219 | LL_INFOS("OpenAL") << "Syncing with master at " << master_offset |
220 | << "sec" << llendl; | 220 | << "sec" << LL_ENDL; |
221 | // *TODO: detect when this fails, maybe use AL_SAMPLE_ | 221 | // *TODO: detect when this fails, maybe use AL_SAMPLE_ |
222 | alSourcef(mALSource, AL_SEC_OFFSET, master_offset); | 222 | alSourcef(mALSource, AL_SEC_OFFSET, master_offset); |
223 | } | 223 | } |
@@ -341,18 +341,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename) | |||
341 | ALenum error = alutGetError(); | 341 | ALenum error = alutGetError(); |
342 | if (gDirUtilp->fileExists(filename)) | 342 | if (gDirUtilp->fileExists(filename)) |
343 | { | 343 | { |
344 | llwarns << | 344 | LL_WARNS("OpenAL") << |
345 | "LLAudioBufferOpenAL::loadWAV() Error loading " | 345 | "LLAudioBufferOpenAL::loadWAV() Error loading " |
346 | << filename | 346 | << filename |
347 | << " " << alutGetErrorString(error) << llendl; | 347 | << " " << alutGetErrorString(error) << LL_ENDL; |
348 | } | 348 | } |
349 | else | 349 | else |
350 | { | 350 | { |
351 | // It's common for the file to not actually exist. | 351 | // It's common for the file to not actually exist. |
352 | lldebugs << | 352 | LL_DEBUGS("OpenAL") << |
353 | "LLAudioBufferOpenAL::loadWAV() Error loading " | 353 | "LLAudioBufferOpenAL::loadWAV() Error loading " |
354 | << filename | 354 | << filename |
355 | << " " << alutGetErrorString(error) << llendl; | 355 | << " " << alutGetErrorString(error) << LL_ENDL; |
356 | } | 356 | } |
357 | return false; | 357 | return false; |
358 | } | 358 | } |
@@ -376,7 +376,7 @@ U32 LLAudioBufferOpenAL::getLength() | |||
376 | void LLAudioEngine_OpenAL::initWind() | 376 | void LLAudioEngine_OpenAL::initWind() |
377 | { | 377 | { |
378 | ALenum error; | 378 | ALenum error; |
379 | llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl; | 379 | LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL; |
380 | 380 | ||
381 | mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS; | 381 | mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS; |
382 | 382 | ||
@@ -386,7 +386,7 @@ void LLAudioEngine_OpenAL::initWind() | |||
386 | 386 | ||
387 | if((error=alGetError()) != AL_NO_ERROR) | 387 | if((error=alGetError()) != AL_NO_ERROR) |
388 | { | 388 | { |
389 | llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<llendl; | 389 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<LL_ENDL; |
390 | } | 390 | } |
391 | 391 | ||
392 | mWindGen = new LLWindGen<WIND_SAMPLE_T>; | 392 | mWindGen = new LLWindGen<WIND_SAMPLE_T>; |
@@ -399,16 +399,16 @@ void LLAudioEngine_OpenAL::initWind() | |||
399 | 399 | ||
400 | if(mWindBuf==NULL) | 400 | if(mWindBuf==NULL) |
401 | { | 401 | { |
402 | llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl; | 402 | LL_ERRS("OpenAL") << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL; |
403 | mEnableWind=false; | 403 | mEnableWind=false; |
404 | } | 404 | } |
405 | 405 | ||
406 | llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl; | 406 | LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL; |
407 | } | 407 | } |
408 | 408 | ||
409 | void LLAudioEngine_OpenAL::cleanupWind() | 409 | void LLAudioEngine_OpenAL::cleanupWind() |
410 | { | 410 | { |
411 | llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl; | 411 | LL_INFOS("OpenAL") << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL; |
412 | 412 | ||
413 | if (mWindSource != AL_NONE) | 413 | if (mWindSource != AL_NONE) |
414 | { | 414 | { |
@@ -484,7 +484,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) | |||
484 | mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed); | 484 | mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed); |
485 | mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0); | 485 | mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0); |
486 | 486 | ||
487 | //llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl; | 487 | //LL_INFOS("OpenAL") << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << LL_ENDL; |
488 | 488 | ||
489 | while(processed--) // unqueue old buffers | 489 | while(processed--) // unqueue old buffers |
490 | { | 490 | { |
@@ -495,7 +495,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) | |||
495 | error = alGetError(); | 495 | error = alGetError(); |
496 | if(error != AL_NO_ERROR) | 496 | if(error != AL_NO_ERROR) |
497 | { | 497 | { |
498 | llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl; | 498 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL; |
499 | } | 499 | } |
500 | else | 500 | else |
501 | { | 501 | { |
@@ -511,7 +511,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) | |||
511 | alGenBuffers(1,&buffer); | 511 | alGenBuffers(1,&buffer); |
512 | if((error=alGetError()) != AL_NO_ERROR) | 512 | if((error=alGetError()) != AL_NO_ERROR) |
513 | { | 513 | { |
514 | llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind buffer: " << error << llendl; | 514 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::initWind() Error creating wind buffer: " << error << LL_ENDL; |
515 | break; | 515 | break; |
516 | } | 516 | } |
517 | 517 | ||
@@ -523,12 +523,12 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) | |||
523 | mWindBufFreq); | 523 | mWindBufFreq); |
524 | error = alGetError(); | 524 | error = alGetError(); |
525 | if(error != AL_NO_ERROR) | 525 | if(error != AL_NO_ERROR) |
526 | llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl; | 526 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL; |
527 | 527 | ||
528 | alSourceQueueBuffers(mWindSource, 1, &buffer); | 528 | alSourceQueueBuffers(mWindSource, 1, &buffer); |
529 | error = alGetError(); | 529 | error = alGetError(); |
530 | if(error != AL_NO_ERROR) | 530 | if(error != AL_NO_ERROR) |
531 | llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl; | 531 | LL_WARNS("OpenAL") << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL; |
532 | 532 | ||
533 | --mNumEmptyWindALBuffers; | 533 | --mNumEmptyWindALBuffers; |
534 | } | 534 | } |
@@ -539,6 +539,6 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) | |||
539 | { | 539 | { |
540 | alSourcePlay(mWindSource); | 540 | alSourcePlay(mWindSource); |
541 | 541 | ||
542 | llinfos << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl; | 542 | LL_INFOS("OpenAL") << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL; |
543 | } | 543 | } |
544 | } | 544 | } |