From 4cdf3961253b49093bf3e2fceda0099cedef4295 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 28 Oct 2011 17:48:24 -0400 Subject: STORM-591 As a music fan, I want audio to fade in gently so my immersion is increased Co-written with Robin Cornelius --- indra/newview/llviewermedia.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 41b4dc01e8..148bfbf080 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -66,7 +66,7 @@ //#include "llfirstuse.h" #include "llviewernetwork.h" #include "llwindow.h" - +#include "llvieweraudio.h" #include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows. #include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows. @@ -967,7 +967,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) { if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) { - gAudiop->stopInternetStream(); + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); } } pimpl->setPriority(new_priority); @@ -1069,13 +1069,24 @@ void LLViewerMedia::setAllMediaEnabled(bool val) gAudiop && LLViewerMedia::hasParcelAudio()) { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying()) + { + // 'false' means unpause + gAudiop->pauseInternetStream(false); + } + else + { + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); + } } } else { // This actually unloads the impl, as opposed to "stop"ping the media LLViewerParcelMedia::stop(); - if (gAudiop) gAudiop->stopInternetStream(); + if (gAudiop) + { + LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); + } } } @@ -1488,8 +1499,7 @@ void LLViewerMedia::setOpenIDCookie() new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); - // FUI: No longer perform the user_status query - //doOnetimeEarlyHTTPRequests(); + doOnetimeEarlyHTTPRequests(); } } -- cgit v1.2.3