diff options
author | angela <angela@lindenlab.com> | 2010-02-25 10:52:03 +0800 |
---|---|---|
committer | angela <angela@lindenlab.com> | 2010-02-25 10:52:03 +0800 |
commit | e2b347c235e5fb92ef9941be57e049df4bf34168 (patch) | |
tree | 5b70f190a931fe33026d91887dfb7791c246915b | |
parent | fadbd33b52b6deb465a49a4c0857ed8078277b15 (diff) | |
parent | 5fbf81d17eae532da6d9537401bd677eb04c90ff (diff) |
merge
-rw-r--r-- | indra/newview/llpanelnearbymedia.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llstatusbar.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 2 |
3 files changed, 18 insertions, 21 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index c02f154dc8..a73c25a979 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -549,11 +549,10 @@ void LLPanelNearByMedia::refreshParcelItems() MediaClass choice = (MediaClass)choice_llsd.asInteger(); // Only show "special parcel items" if "All" or "Within" filter // (and if media is "enabled") - bool should_include = gSavedSettings.getBOOL("AudioStreamingMedia") && - (choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL); + bool should_include = (choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL); // First Parcel Media: add or remove it as necessary - if (should_include && LLViewerMedia::hasParcelMedia()) + if (gSavedSettings.getBOOL("AudioStreamingMedia") &&should_include && LLViewerMedia::hasParcelMedia()) { // Yes, there is parcel media. if (NULL == mParcelMediaItem) @@ -716,11 +715,14 @@ void LLPanelNearByMedia::refreshList() } } } - mDisableAllCtrl->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") && + mDisableAllCtrl->setEnabled((gSavedSettings.getBOOL("AudioStreamingMusic") || + gSavedSettings.getBOOL("AudioStreamingMedia")) && (LLViewerMedia::isAnyMediaShowing() || LLViewerMedia::isParcelMediaPlaying() || LLViewerMedia::isParcelAudioPlaying())); - mEnableAllCtrl->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") && + + mEnableAllCtrl->setEnabled( (gSavedSettings.getBOOL("AudioStreamingMusic") || + gSavedSettings.getBOOL("AudioStreamingMedia")) && (disabled_count > 0 || // parcel media (if we have it, and it isn't playing, enable "start") (LLViewerMedia::hasParcelMedia() && ! LLViewerMedia::isParcelMediaPlaying()) || @@ -979,20 +981,13 @@ void LLPanelNearByMedia::onMoreLess() void LLPanelNearByMedia::updateControls() { - if (! gSavedSettings.getBOOL("AudioStreamingMedia")) - { - // Just show disabled controls - showDisabledControls(); - return; - } - LLUUID selected_media_id = mMediaList->getValue().asUUID(); if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID) { if (!LLViewerMedia::hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic")) { - // Shouldn't happen, but do this anyway + // disable controls if audio streaming music is disabled from preference showDisabledControls(); } else { @@ -1005,9 +1000,9 @@ void LLPanelNearByMedia::updateControls() } else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) { - if (!LLViewerMedia::hasParcelMedia()) + if (!LLViewerMedia::hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia")) { - // Shouldn't happen, but do this anyway + // disable controls if audio streaming media is disabled from preference showDisabledControls(); } else { @@ -1034,7 +1029,7 @@ void LLPanelNearByMedia::updateControls() else { LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL == impl) + if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) { showDisabledControls(); } diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 732c23982b..9fb496c214 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -360,12 +360,14 @@ void LLStatusBar::refresh() // Disable media toggle if there's no media, parcel media, and no parcel audio // (or if media is disabled) - mMediaToggle->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") && - (LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio())); + bool button_enabled = (gSavedSettings.getBOOL("AudioStreamingMusic")||gSavedSettings.getBOOL("AudioStreamingMedia")) && + (LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio()); + mMediaToggle->setEnabled(button_enabled); // Note the "sense" of the toggle is opposite whether media is playing or not - mMediaToggle->setValue(! (LLViewerMedia::isAnyMediaShowing() || + bool any_media_playing = (LLViewerMedia::isAnyMediaShowing() || LLViewerMedia::isParcelMediaPlaying() || - LLViewerMedia::isParcelAudioPlaying())); + LLViewerMedia::isParcelAudioPlaying()); + mMediaToggle->setValue(!any_media_playing); } void LLStatusBar::setVisibleForMouselook(bool visible) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 86336e353c..344c4c469b 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -851,7 +851,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) } } // update the audio stream here as well - if(!inworld_media_enabled || !inworld_audio_enabled) + if( !inworld_audio_enabled) { if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) { |