From 98a0c11da9e1c7ee8351cb9ab6d9cd5345a4e002 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 22 Feb 2010 17:34:28 +0800 Subject: EXT-5410 Streaming audio does ignores preference setting. --- indra/newview/llpanelnearbymedia.cpp | 47 +++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'indra/newview/llpanelnearbymedia.cpp') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 8ad5389566..6d6edcc9ee 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -568,11 +568,20 @@ 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(), + impl == NULL || impl->isMediaDisabled() || (!is_enabled), impl != NULL && !LLViewerParcelMedia::getURL().empty(), impl != NULL && impl->isMediaTimeBased() && impl->isMediaPlaying(), MEDIA_CLASS_ALL, @@ -601,11 +610,20 @@ 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_playing) && is_enabled, is_playing, is_playing, MEDIA_CLASS_ALL, @@ -824,7 +842,10 @@ void LLPanelNearByMedia::onZoomMedia(void* user_data) void LLPanelNearByMedia::onClickParcelMediaPlay() { - LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + if (gSavedSettings.getBOOL("AudioStreamingMedia")) + { + LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); + } } void LLPanelNearByMedia::onClickParcelMediaStop() @@ -844,14 +865,18 @@ void LLPanelNearByMedia::onClickParcelMediaPause() void LLPanelNearByMedia::onClickParcelAudioStart() { - // 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; + //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; + + if (!gAudiop) + return; - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + } } void LLPanelNearByMedia::onClickParcelAudioPlay() @@ -1081,7 +1106,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay() impl->play(); return; } - else if (impl->isParcelMedia()) + else if (NULL != impl && impl->isParcelMedia()) { LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel()); } -- cgit v1.2.3 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 +++++++++--------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'indra/newview/llpanelnearbymedia.cpp') 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() -- cgit v1.2.3 From 8cf7dad209fd97c1ab822ef183e8a74faceeb3d8 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 23 Feb 2010 17:36:25 -0800 Subject: =?UTF-8?q?FIX=20EXT-5680:=20Get=20rid=20of=20unnecessary=20code?= =?UTF-8?q?=20that=20formats=20the=20media=20item=20count=20Review=20#139?= =?UTF-8?q?=20The=20crash=20was=20happening=20because=20the=20German=20(lo?= =?UTF-8?q?cale=20"de")=20version=20of=20the=20format=20string=20had=20an?= =?UTF-8?q?=20=E2=80=8B%ls=20in=20it,=20which=20was=20causing=20the=20cras?= =?UTF-8?q?h.=20Getting=20rid=20of=20the=20widget=20and=20the=20string=20s?= =?UTF-8?q?ince=20it=20is=20no=20longer=20desired=20in=20the=20design.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelnearbymedia.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llpanelnearbymedia.cpp') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index b73d7db770..3b5192b07f 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -135,7 +135,6 @@ BOOL LLPanelNearByMedia::postBuild() mMediaList = getChild("media_list"); mEnableAllCtrl = getChild("all_nearby_media_enable_btn"); mDisableAllCtrl = getChild("all_nearby_media_disable_btn"); - mItemCountText = getChild("media_item_count"); mShowCtrl = getChild("show_combo"); // Dynamic (selection-dependent) controls @@ -250,8 +249,6 @@ void LLPanelNearByMedia::draw() setShape(new_rect); } - mItemCountText->setValue(llformat(getString("media_item_count_format").c_str(), mMediaList->getItemCount())); - refreshList(); updateControls(); -- cgit v1.2.3 From 262f34b25dbdde7940ef28ff02058f4ef12d92f1 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 23 Feb 2010 18:13:50 -0800 Subject: FIX EXT-5517: clear hover face when cursor hovers over Nearby Media panel Review #140 This isn't the most generalized solution, but it fixes the proximal problem of selecting items in the Nearby Media panel, and is low risk because the code change is isolated to that panel. --- indra/newview/llpanelnearbymedia.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/newview/llpanelnearbymedia.cpp') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 3b5192b07f..1d720ceb25 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -231,6 +231,7 @@ void LLPanelNearByMedia::reshape(S32 width, S32 height, BOOL called_from_parent) const F32 AUTO_CLOSE_FADE_TIME_START= 4.0f; const F32 AUTO_CLOSE_FADE_TIME_END = 5.0f; +/*virtual*/ void LLPanelNearByMedia::draw() { //LLUICtrl* new_top = gFocusMgr.getTopCtrl(); @@ -265,6 +266,21 @@ void LLPanelNearByMedia::draw() } } +/*virtual*/ +BOOL LLPanelNearByMedia::handleHover(S32 x, S32 y, MASK mask) +{ + LLPanel::handleHover(x, y, mask); + + // If we are hovering over this panel, make sure to clear any hovered media + // ID. Note that the more general solution would be to clear this ID when + // the mouse leaves the in-scene view, but that proved to be problematic. + // See EXT-5517 + LLViewerMediaFocus::getInstance()->clearHover(); + + // Always handle + return true; +} + bool LLPanelNearByMedia::getParcelAudioAutoStart() { return mParcelAudioAutoStart; -- cgit v1.2.3 From 5fbf81d17eae532da6d9537401bd677eb04c90ff Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 25 Feb 2010 01:00:50 +0800 Subject: EXT-5410 Streaming audio does ignores preference setting. --- indra/newview/llpanelnearbymedia.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'indra/newview/llpanelnearbymedia.cpp') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 75b25b6a40..fe77689d63 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) @@ -708,11 +707,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()) || @@ -971,20 +973,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 { @@ -997,9 +992,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 { @@ -1026,7 +1021,7 @@ void LLPanelNearByMedia::updateControls() else { LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL == impl) + if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) { showDisabledControls(); } -- cgit v1.2.3