From 0eea585ef13426bf343fb5bcc3642cdfc769c022 Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 23 Feb 2010 11:30:12 +0800 Subject: revert some changed from EXT-5410 but keep the changes for disabling streaming audio when music or media is disabled. reviewed by rick --- indra/newview/llpanelnearbymedia.cpp | 41 ++++++---------------- indra/newview/llviewermedia.cpp | 7 ++-- .../skins/default/xui/en/panel_nearby_media.xml | 2 -- .../default/xui/en/panel_preferences_sound.xml | 14 ++++---- 4 files changed, 20 insertions(+), 44 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 6d6edcc9ee..e1676d2299 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -568,20 +568,11 @@ void LLPanelNearByMedia::refreshParcelItems() tooltip = name + " : " + url; } LLViewerMediaImpl *impl = LLViewerParcelMedia::getParcelMedia(); - bool is_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - if(is_enabled) - { - mParcelMediaName = getString("parcel_media_name"); - } - else - { - mParcelMediaName = getString("parcel_media_name_disabled"); - } updateListItem(mParcelMediaItem, mParcelMediaName, tooltip, -2, // Proximity closer than anything else, before Parcel Audio - impl == NULL || impl->isMediaDisabled() || (!is_enabled), + impl == NULL || impl->isMediaDisabled(), impl != NULL && !LLViewerParcelMedia::getURL().empty(), impl != NULL && impl->isMediaTimeBased() && impl->isMediaPlaying(), MEDIA_CLASS_ALL, @@ -610,20 +601,12 @@ void LLPanelNearByMedia::refreshParcelItems() if (NULL != mParcelAudioItem) { bool is_playing = LLViewerMedia::isParcelAudioPlaying(); - bool is_enabled = gSavedSettings.getBOOL("AudioStreamingMusic"); - if(is_enabled) - { - mParcelAudioName = getString("parcel_audio_name"); - } - else - { - mParcelAudioName = getString("parcel_audio_name_disabled"); - } + updateListItem(mParcelAudioItem, mParcelAudioName, LLViewerMedia::getParcelAudioURL(), -1, // Proximity after Parcel Media, but closer than anything else - (!is_playing) && is_enabled, + (!is_playing), is_playing, is_playing, MEDIA_CLASS_ALL, @@ -865,18 +848,14 @@ void LLPanelNearByMedia::onClickParcelMediaPause() void LLPanelNearByMedia::onClickParcelAudioStart() { - //only do this when it's audio streaming is enabled - if (gSavedSettings.getBOOL("AudioStreamingMusic")) - { - // User *explicitly* started the internet stream, so keep the stream - // playing and updated as they cross to other parcels etc. - mParcelAudioAutoStart = true; + // User *explicitly* started the internet stream, so keep the stream + // playing and updated as they cross to other parcels etc. + mParcelAudioAutoStart = true; - if (!gAudiop) - return; - - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); - } + if (!gAudiop) + return; + gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + } void LLPanelNearByMedia::onClickParcelAudioPlay() diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0d16a3c2cb..f1ca56a8ae 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_audio_enabled) + if(!inworld_media_enabled || !inworld_audio_enabled) { if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) { @@ -947,12 +947,12 @@ void LLViewerMedia::setAllMediaEnabled(bool val) // Also do Parcel Media and Parcel Audio if (val) { - if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia()&& gSavedSettings.getBOOL("AudioStreamingMedia")) + if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia()) { LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } - if (!LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()&& gSavedSettings.getBOOL("AudioStreamingMusic")) + if (!LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio()) { gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); } @@ -980,7 +980,6 @@ bool LLViewerMedia::isParcelAudioPlaying() 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(); diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml index f3dfd56fbe..0f911f789e 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml @@ -14,9 +14,7 @@ (%ld media items) <empty> Parcel Streaming Media - Parcel Streaming Media (Disabled) Parcel Streaming Audio - Parcel Streaming Audio (Disabled) (playing) @@ -49,7 +49,7 @@ label="Mute when minimized" layout="topleft" name="mute_when_minimized" - top_delta="3" + top_delta="3" left_pad="5" width="215" />