From c680368e19f5be7265e2f15a1f4b626b1600e773 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 10 Feb 2010 14:28:46 -0800 Subject: EXT-5261 EXT-5263 EXT-5265 EXT-5266 EXT-5271 - Reformat NMF and enable behavior of media toggle in chrome Review #100 http://10.1.19.90:8080/go?page=ReviewDisplay&reviewid=100 This encompasses the first of the behavioral and structural changes for the Nearby Media Floater and the chrome button at the top of the UI. It includes: - Removal of the Parcel Media and Parcel Audio UI. Still not in the list yet. - New More/Less button, which doesn't quite work right (see below) - Changed icon for UI chrome - Enabled "turning on" and "turning off" media from the chrome and NMF - Added gear icon to bring up prefs - XUI changes to the structure of NMF - Implementation of the "tentative" autoplay flag This is basically a checkpoint so that Richard can help with the More/Less implementation --- indra/newview/llviewermedia.cpp | 50 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 3063341ade..c4f2f0eed7 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -261,6 +261,7 @@ static LLTimer sMediaCreateTimer; static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; static F32 sGlobalVolume = 1.0f; static F64 sLowestLoadableImplInterest = 0.0f; +static bool sAnyMediaShowing = false; ////////////////////////////////////////////////////////////////////////////////////////// static void add_media_impl(LLViewerMediaImpl* media) @@ -694,6 +695,7 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi // static void LLViewerMedia::updateMedia(void *dummy_arg) { + sAnyMediaShowing = false; impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); @@ -860,6 +862,25 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } total_cpu += pimpl->getCPUUsage(); + + if (!pimpl->getUsedInUI()) + { + if (! pimpl->isParcelMedia()) + { + if (pimpl->hasMedia()) + { + sAnyMediaShowing = true; + } + } + else { + // Parcel media showing? + if (!LLViewerParcelMedia::getURL().empty() && LLViewerParcelMedia::getParcelMedia().notNull()) + { + sAnyMediaShowing = true; + } + } + } + } // Re-calculate this every time. @@ -899,6 +920,33 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::isAnyMediaShowing() +{ + return sAnyMediaShowing; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setAllMediaEnabled(bool val) +{ + // Set "tentative" autoplay first. We need to do this here or else + // re-enabling won't start up the media below. + gSavedSettings.setBOOL("MediaTentativeAutoPlay", val); + + // Then + impl_list::iterator iter = sViewerMediaImplList.begin(); + impl_list::iterator end = sViewerMediaImplList.end(); + + for(; iter != end; iter++) + { + LLViewerMediaImpl* pimpl = *iter; + if (!pimpl->getUsedInUI()) + pimpl->setDisabled(!val); + } +} + ////////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::initClass() @@ -913,8 +961,6 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } - // XXX TODO: what to do about other AUTO_PLAY settings? - // XXX TODO: what to do about other AUTO_PLAY settings? ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3