summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2010-02-10 14:28:46 -0800
committerRick Pasetto <rick@lindenlab.com>2010-02-10 14:28:46 -0800
commitc680368e19f5be7265e2f15a1f4b626b1600e773 (patch)
tree8a38590b168d8b65e2d185ba76ada2de17d4b2e0 /indra/newview/llviewermedia.cpp
parent3aa7e1b0c10fcb660cfc13308dd2a45223696e11 (diff)
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
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp50
1 files changed, 48 insertions, 2 deletions
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.
@@ -901,6 +922,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()
{
gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL);
@@ -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
//////////////////////////////////////////////////////////////////////////////////////////