From b8a46c81eefc3da66fc1a1c3ed9bfbf4418b535d Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 5 Feb 2010 12:06:57 -0800 Subject: Media classes + A step toward restructuring Nearby Media floater Several changes here: - Implemented support for "media classification": see http://docs.google.com/a/lindenlab.com/View?id=ddznhrqn_29vhnr2pg8 - Added settings for auto-playing of said classifications Nearby Media Floater: - On/Off buttons are now explicit...no more power buttons - Parcel Media and Parcel Audio are "lighter weight", with no more on/off - List now sorts with playing items at top, non-playing below - There is now a "Show" drop-down that filters the list by classification - Added checkboxes to the bottom to control auto-play settings More work is needed, so consider this a checkpoint --- indra/newview/llviewermedia.cpp | 148 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 142 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9ced0194a2..90fb76c715 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -50,6 +50,9 @@ #include "llcallbacklist.h" #include "llparcel.h" #include "llaudioengine.h" // for gAudiop +#include "llvoavatar.h" +#include "llvoavatarself.h" +#include "llviewerregion.h" #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -62,6 +65,10 @@ #include /*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING = "MediaShowOnOthers"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING = "MediaShowWithinParcel"; +/*static*/ const char* LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING = "MediaShowOutsideParcel"; + // Move this to its own file. @@ -365,8 +372,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s // The current media URL is not empty. // If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent, // do a navigate. - bool auto_play = (media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)); - + bool auto_play = media_impl->isAutoPlayable(); if((was_loaded || auto_play) && !update_from_self) { needs_navigate = url_changed; @@ -390,7 +396,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s media_impl->mMediaAutoPlay = media_entry->getAutoPlay(); media_impl->mMediaEntryURL = media_entry->getCurrentURL(); - if(media_impl->mMediaAutoPlay && gSavedSettings.getBOOL(AUTO_PLAY_MEDIA_SETTING)) + if(media_impl->isAutoPlayable()) { needs_navigate = true; } @@ -818,7 +824,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) impl_count_total++; } - + // Overrides if the window is minimized or we lost focus (taking care // not to accidentally "raise" the priority either) if (!gViewerWindow->getActive() /* viewer window minimized? */ @@ -846,7 +852,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } } } - + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -940,6 +946,7 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo { // user has elected to automatically play media. gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); + // XXX TODO: what to do about other AUTO_PLAY settings? gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); @@ -959,6 +966,7 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo else { gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); + // XXX TODO: what to do about other AUTO_PLAY settings? gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); } @@ -2111,6 +2119,21 @@ void LLViewerMediaImpl::scaleMouse(S32 *mouse_x, S32 *mouse_y) #endif } + + +////////////////////////////////////////////////////////////////////////////////////////// +bool LLViewerMediaImpl::isMediaTimeBased() +{ + bool result = false; + + if(mMediaSource) + { + result = mMediaSource->pluginSupportsMediaTime(); + } + + return result; +} + ////////////////////////////////////////////////////////////////////////////////////////// bool LLViewerMediaImpl::isMediaPlaying() { @@ -2172,7 +2195,7 @@ void LLViewerMediaImpl::setDisabled(bool disabled) else { // We just (re)enabled this media. Do a navigate if auto-play is in order. - if(mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)) + if(isAutoPlayable()) { navigateTo(mMediaEntryURL, "", true, true); } @@ -2199,6 +2222,12 @@ bool LLViewerMediaImpl::isForcedUnloaded() const } } + // If this media's class is not supposed to be shown, unload + if (!shouldShowBasedOnClass()) + { + return true; + } + return false; } @@ -2684,3 +2713,110 @@ void LLViewerMediaImpl::setTextureID(LLUUID id) } } +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isAutoPlayable() const +{ + return (mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::shouldShowBasedOnClass() const +{ + // If this is parcel media or in the UI, return true always + if (getUsedInUI() || isParcelMedia()) return true; + + bool attached_to_another_avatar = isAttachedToAnotherAvatar(); + bool inside_parcel = isInAgentParcel(); + + // llinfos << " hasFocus = " << hasFocus() << + // " others = " << (attached_to_another_avatar && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING)) << + // " within = " << (inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING)) << + // " outside = " << (!inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING)) << llendl; + + // If it has focus, we should show it + if (hasFocus()) + return true; + + // If it is attached to an avatar and the pref is off, we shouldn't show it + if (attached_to_another_avatar) + return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); + + if (inside_parcel) + return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); + else + return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isAttachedToAnotherAvatar() const +{ + bool result = false; + + std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin(); + std::list< LLVOVolume* >::const_iterator end = mObjectList.end(); + for ( ; iter != end; iter++) + { + if (isObjectAttachedToAnotherAvatar(*iter)) + { + result = true; + break; + } + } + return result; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +//static +bool LLViewerMediaImpl::isObjectAttachedToAnotherAvatar(LLVOVolume *obj) +{ + bool result = false; + LLXform *xform = obj; + // Walk up parent chain + while (NULL != xform) + { + LLViewerObject *object = dynamic_cast (xform); + if (NULL != object) + { + LLVOAvatar *avatar = object->asAvatar(); + if (NULL != avatar && avatar != gAgent.getAvatarObject()) + { + result = true; + break; + } + } + xform = xform->getParent(); + } + return result; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isInAgentParcel() const +{ + bool result = false; + + std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin(); + std::list< LLVOVolume* >::const_iterator end = mObjectList.end(); + for ( ; iter != end; iter++) + { + LLVOVolume *object = *iter; + if (LLViewerMediaImpl::isObjectInAgentParcel(object)) + { + result = true; + break; + } + } + return result; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +// static +bool LLViewerMediaImpl::isObjectInAgentParcel(LLVOVolume *obj) +{ + return (LLViewerParcelMgr::getInstance()->inAgentParcel(obj->getPositionGlobal())); +} -- cgit v1.2.3 From 3aa7e1b0c10fcb660cfc13308dd2a45223696e11 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 9 Feb 2010 13:47:13 -0800 Subject: PARTIAL EXT-5261: add new "MediaTentativeAutoPlay" setting --- indra/newview/llviewermedia.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index e77106bb2c..3063341ade 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2663,7 +2663,9 @@ void LLViewerMediaImpl::setTextureID(LLUUID id) // bool LLViewerMediaImpl::isAutoPlayable() const { - return (mMediaAutoPlay && gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)); + return (mMediaAutoPlay && + gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) && + gSavedSettings.getBOOL("MediaTentativeAutoPlay")); } ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 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 From 234f5a48a70d92e00aded1003814b2b883fa5ef4 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 10 Feb 2010 17:31:46 -0800 Subject: Code review feedback: add comments, move teleport hook to a callback in llviewermedia Review #100 --- indra/newview/llviewermedia.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index c4f2f0eed7..1b6236ce4a 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -262,6 +262,7 @@ static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; static F32 sGlobalVolume = 1.0f; static F64 sLowestLoadableImplInterest = 0.0f; static bool sAnyMediaShowing = false; +static boost::signals2::connection sTeleportFinishConnection; ////////////////////////////////////////////////////////////////////////////////////////// static void add_media_impl(LLViewerMediaImpl* media) @@ -863,6 +864,10 @@ void LLViewerMedia::updateMedia(void *dummy_arg) total_cpu += pimpl->getCPUUsage(); + // Only set sAnyMedia​Showing if it isn't used in the UI. If it isn't + // parcel media, do the normal "hasMedia()" check. If it is parcel media, + // hasMedia() seems to always be true, so we do some other checks to see + // if there actually is parcel media showing if (!pimpl->getUsedInUI()) { if (! pimpl->isParcelMedia()) @@ -951,7 +956,9 @@ void LLViewerMedia::setAllMediaEnabled(bool val) // static void LLViewerMedia::initClass() { - gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); + gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); + sTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> + setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished)); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -959,6 +966,15 @@ void LLViewerMedia::initClass() void LLViewerMedia::cleanupClass() { gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); + sTeleportFinishConnection.disconnect(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::onTeleportFinished() +{ + // On teleport, clear this setting (i.e. set it to true) + gSavedSettings.setBOOL("MediaTentativeAutoPlay", true); } ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From ffd962f3a3eafd7b65f90039a5bb04dccb0205bc Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 12 Feb 2010 13:38:17 -0800 Subject: EXT-5267 EXT-5268: Add Parcel Media and Parcel Audio items to nearby media panel Review #109 This (fairly major) change adds new "items" to the media list for Parcel Media and Parcel Audio. Since these items are special (before the items were always MoaP impls), they had to be treated special. Moreover, actions on all of "media" had to be centralized so that they would have similar behavior. --- indra/newview/llviewermedia.cpp | 98 ++++++++++++++++++++++++++++++++--------- 1 file changed, 78 insertions(+), 20 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1b6236ce4a..7b5d1d9814 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -864,26 +864,9 @@ void LLViewerMedia::updateMedia(void *dummy_arg) total_cpu += pimpl->getCPUUsage(); - // Only set sAnyMedia​Showing if it isn't used in the UI. If it isn't - // parcel media, do the normal "hasMedia()" check. If it is parcel media, - // hasMedia() seems to always be true, so we do some other checks to see - // if there actually is parcel media showing - if (!pimpl->getUsedInUI()) + if (!pimpl->getUsedInUI() && pimpl->hasMedia()) { - if (! pimpl->isParcelMedia()) - { - if (pimpl->hasMedia()) - { - sAnyMediaShowing = true; - } - } - else { - // Parcel media showing? - if (!LLViewerParcelMedia::getURL().empty() && LLViewerParcelMedia::getParcelMedia().notNull()) - { - sAnyMediaShowing = true; - } - } + sAnyMediaShowing = true; } } @@ -947,9 +930,84 @@ void LLViewerMedia::setAllMediaEnabled(bool val) for(; iter != end; iter++) { LLViewerMediaImpl* pimpl = *iter; - if (!pimpl->getUsedInUI()) + if (!pimpl->getUsedInUI()) + { pimpl->setDisabled(!val); + } + } + + // Also do Parcel Media and Parcel Audio + if (val) + { + if (!LLViewerMedia::isParcelMediaPlaying()) + { + LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + } + + if (!LLViewerMedia::isParcelAudioPlaying() && gAudiop) + { + gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + } } + else { + // This actually unloads the impl, as opposed to "stop"ping the media + LLViewerParcelMedia::stop(); + if (gAudiop) gAudiop->stopInternetStream(); + } +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::isParcelMediaPlaying() +{ + return (LLViewerMedia::hasParcelMedia() && LLViewerParcelMedia::getParcelMedia() && LLViewerParcelMedia::getParcelMedia()->hasMedia()); +} + +///////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::isParcelAudioPlaying() +{ + return (LLViewerMedia::hasParcelAudio() && gAudiop && LLAudioEngine::AUDIO_PLAYING == gAudiop->isInternetStreamPlaying()); +} + +bool LLViewerMedia::hasInWorldMedia() +{ + if (! gSavedSettings.getBOOL("AudioStreamingMedia")) return false; + if (sInWorldMediaDisabled) return false; + impl_list::iterator iter = sViewerMediaImplList.begin(); + impl_list::iterator end = sViewerMediaImplList.end(); + // This should be quick, because there should be very few non-in-world-media impls + for (; iter != end; iter++) + { + LLViewerMediaImpl* pimpl = *iter; + if (!pimpl->getUsedInUI() && !pimpl->isParcelMedia()) + { + // Found an in-world media impl + return true; + } + } + return false; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::hasParcelMedia() +{ + return !LLViewerParcelMedia::getURL().empty(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::hasParcelAudio() +{ + return !LLViewerMedia::getParcelAudioURL().empty(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +std::string LLViewerMedia::getParcelAudioURL() +{ + return LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL(); } ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From a623f852cde86a290c8efda5c7b034f9b7bb75c2 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 16 Feb 2010 14:17:09 +0000 Subject: EXT-5394 [crashhunters] Crash in LLViewerMediaImpl::calculateInterest() --- indra/newview/llviewermedia.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0e133f8729..25c843cf15 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2399,16 +2399,25 @@ void LLViewerMediaImpl::calculateInterest() for(; iter != mObjectList.end() ; ++iter) { LLVOVolume *obj = *iter; - if(LLMuteList::getInstance()->isMuted(obj->getID())) + llassert(obj); + if (!obj) continue; + if(LLMuteList::getInstance() && + LLMuteList::getInstance()->isMuted(obj->getID())) + { mIsMuted = true; + } else { // We won't have full permissions data for all objects. Attempt to mute objects when we can tell their owners are muted. - LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj); - if(obj_perm) + if (LLSelectMgr::getInstance()) { - if(LLMuteList::getInstance()->isMuted(obj_perm->getOwner())) - mIsMuted = true; + LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj); + if(obj_perm) + { + if(LLMuteList::getInstance() && + LLMuteList::getInstance()->isMuted(obj_perm->getOwner())) + mIsMuted = true; + } } } } -- cgit v1.2.3 From 0e234edcc67ecf534df15f088158ef236f6de102 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 16 Feb 2010 15:42:33 -0800 Subject: EXT-5270: Implement "dynamic" controls based on the selected item in Nearby Media Review #112 This change adds controls that change state based on the selection in the nearby media panel. There are basically 3 sets: - Time-based - Web-based ("Normal") - Disabled Again, these change based on what you've got selected in the panel --- indra/newview/llviewermedia.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 7b5d1d9814..3fc578aa5e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -939,12 +939,12 @@ void LLViewerMedia::setAllMediaEnabled(bool val) // Also do Parcel Media and Parcel Audio if (val) { - if (!LLViewerMedia::isParcelMediaPlaying()) + if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia()) { LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } - if (!LLViewerMedia::isParcelAudioPlaying() && gAudiop) + if (!LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) { gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); } @@ -2246,7 +2246,7 @@ void LLViewerMediaImpl::resetPreviousMediaState() ////////////////////////////////////////////////////////////////////////////////////////// // -void LLViewerMediaImpl::setDisabled(bool disabled) +void LLViewerMediaImpl::setDisabled(bool disabled, bool forcePlayOnEnable) { if(mIsDisabled != disabled) { @@ -2261,7 +2261,7 @@ void LLViewerMediaImpl::setDisabled(bool disabled) else { // We just (re)enabled this media. Do a navigate if auto-play is in order. - if(isAutoPlayable()) + if(isAutoPlayable() || forcePlayOnEnable) { navigateTo(mMediaEntryURL, "", true, true); } -- cgit v1.2.3