summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichard <none@none>2010-02-11 18:06:25 -0800
committerrichard <none@none>2010-02-11 18:06:25 -0800
commit6c5b984bf670e34fd88a8f1a0bdeb1042fa531b2 (patch)
tree32865ad0feb6311d06b3c12a738fb60bcf8c1ac5
parent62e1508bf603a58afdd5e2cc8ca40927a791ba47 (diff)
converted llfloaternearbymedia to llpanelnearbymedia
moved from LLTransientDockableFloater model to popup panel model like volume popup
-rw-r--r--indra/llui/llscrolllistctrl.cpp4
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llpanelnearbymedia.cpp825
-rw-r--r--indra/newview/llpanelnearbymedia.h157
-rw-r--r--indra/newview/llpanelvolumepulldown.cpp5
-rw-r--r--indra/newview/llstatusbar.cpp33
-rw-r--r--indra/newview/llstatusbar.h7
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewermedia.h2
-rw-r--r--indra/newview/llviewerparcelmgr.cpp10
-rw-r--r--indra/newview/skins/default/xui/en/panel_nearby_media.xml501
11 files changed, 1533 insertions, 17 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 478e270c98..ac4811210b 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1388,6 +1388,8 @@ void LLScrollListCtrl::drawItems()
LLGLSUIDefault gls_ui;
+ F32 alpha = getDrawContext().mAlpha;
+
{
LLLocalClipRect clip(mItemListRect);
@@ -1463,7 +1465,7 @@ void LLScrollListCtrl::drawItems()
bg_color = mBgReadOnlyColor.get();
}
- item->draw(item_rect, fg_color, bg_color, highlight_color, mColumnPadding);
+ item->draw(item_rect, fg_color % alpha, bg_color% alpha, highlight_color % alpha, mColumnPadding);
cur_y -= mLineHeight;
}
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index cd7c002096..6242783717 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -182,7 +182,6 @@ set(viewer_SOURCE_FILES
llfloatermediasettings.cpp
llfloatermemleak.cpp
llfloaternamedesc.cpp
- llfloaternearbymedia.cpp
llfloaternotificationsconsole.cpp
llfloateropenobject.cpp
llfloaterparcel.cpp
@@ -323,6 +322,7 @@ set(viewer_SOURCE_FILES
llpanelmediasettingspermissions.cpp
llpanelmediasettingssecurity.cpp
llpanelme.cpp
+ llpanelnearbymedia.cpp
llpanelobject.cpp
llpanelobjectinventory.cpp
llpaneloutfitsinventory.cpp
@@ -682,7 +682,6 @@ set(viewer_HEADER_FILES
llfloatermediasettings.h
llfloatermemleak.h
llfloaternamedesc.h
- llfloaternearbymedia.h
llfloaternotificationsconsole.h
llfloateropenobject.h
llfloaterparcel.h
@@ -818,6 +817,7 @@ set(viewer_HEADER_FILES
llpanelmediasettingspermissions.h
llpanelmediasettingssecurity.h
llpanelme.h
+ llpanelnearbymedia.h
llpanelobject.h
llpanelobjectinventory.h
llpaneloutfitsinventory.h
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
new file mode 100644
index 0000000000..82aa67783d
--- /dev/null
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -0,0 +1,825 @@
+/**
+ * @file llpanelnearbymedia.cpp
+ * @brief Management interface for muting and controlling nearby media
+ *
+ * $LicenseInfo:firstyear=2005&license=viewergpl$
+ *
+ * Copyright (c) 2005-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llpanelnearbymedia.h"
+
+#include "llaudioengine.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
+#include "llscrolllistctrl.h"
+#include "llscrolllistitem.h"
+#include "llscrolllistcell.h"
+#include "llsliderctrl.h"
+#include "llagent.h"
+#include "llagentui.h"
+#include "llbutton.h"
+#include "lltextbox.h"
+#include "llviewermedia.h"
+#include "llviewerparcelmedia.h"
+#include "llviewerregion.h"
+#include "llviewermediafocus.h"
+#include "llviewerparcelmgr.h"
+#include "llparcel.h"
+#include "llpluginclassmedia.h"
+#include "llvovolume.h"
+#include "llstatusbar.h"
+#include "llsdutil.h"
+
+#include <stringize.h>
+
+extern LLControlGroup gSavedSettings;
+
+// Ugh, isInternetStreamPlaying() returns not a bool, but an *int*, with
+// 0 = stopped, 1 = playing, 2 = paused.
+static const int PARCEL_AUDIO_STOPPED = 0;
+static const int PARCEL_AUDIO_PLAYING = 1;
+static const int PARCEL_AUDIO_PAUSED = 2;
+
+//
+// LLPanelNearByMedia
+//
+
+LLPanelNearByMedia::LLPanelNearByMedia()
+: mMediaList(NULL),
+ mEnableAllCtrl(NULL),
+ mEnableParcelMediaCtrl(NULL),
+ mAllMediaDisabled(false),
+ mDebugInfoVisible(false)
+{
+ mParcelAudioAutoStart = gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING);
+
+ mCommitCallbackRegistrar.add("MediaListCtrl.EnableAll", boost::bind(&LLPanelNearByMedia::onClickEnableAll, this));
+ mCommitCallbackRegistrar.add("MediaListCtrl.DisableAll", boost::bind(&LLPanelNearByMedia::onClickDisableAll, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.ParcelMediaVolume", boost::bind(&LLPanelNearByMedia::onParcelMediaVolumeSlider, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.MuteParcelMedia", boost::bind(&LLPanelNearByMedia::onClickMuteParcelMedia, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.EnableParcelMedia", boost::bind(&LLPanelNearByMedia::onClickEnableParcelMedia, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.DisableParcelMedia", boost::bind(&LLPanelNearByMedia::onClickDisableParcelMedia, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.Play", boost::bind(&LLPanelNearByMedia::onClickParcelMediaPlay, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.Stop", boost::bind(&LLPanelNearByMedia::onClickParcelMediaStop, this));
+ mCommitCallbackRegistrar.add("ParcelMediaCtrl.Pause", boost::bind(&LLPanelNearByMedia::onClickParcelMediaPause, this));
+ mCommitCallbackRegistrar.add("ParcelAudioCtrl.Play", boost::bind(&LLPanelNearByMedia::onClickParcelAudioPlay, this));
+ mCommitCallbackRegistrar.add("ParcelAudioCtrl.Stop", boost::bind(&LLPanelNearByMedia::onClickParcelAudioStop, this));
+ mCommitCallbackRegistrar.add("ParcelAudioCtrl.Pause", boost::bind(&LLPanelNearByMedia::onClickParcelAudioPause, this));
+ LLUICtrlFactory::instance().buildPanel(this, "panel_nearby_media.xml");
+}
+
+LLPanelNearByMedia::~LLPanelNearByMedia()
+{
+}
+
+BOOL LLPanelNearByMedia::postBuild()
+{
+ LLPanel::postBuild();
+
+ mMediaList = getChild<LLScrollListCtrl>("media_list");
+ mEnableAllCtrl = getChild<LLUICtrl>("all_nearby_media_enable_btn");
+ mDisableAllCtrl = getChild<LLUICtrl>("all_nearby_media_disable_btn");
+ mParcelMediaVolumeSlider = getChild<LLSliderCtrl>("parcel_media_volume");
+ mParcelMediaMuteCtrl = getChild<LLButton>("parcel_media_mute");
+ mEnableParcelMediaCtrl = getChild<LLUICtrl>("parcel_media_enable_btn");
+ mDisableParcelMediaCtrl = getChild<LLUICtrl>("parcel_media_disable_btn");
+ mParcelMediaText = getChild<LLTextBox>("parcel_media_name");
+ mItemCountText = getChild<LLTextBox>("media_item_count");
+ mParcelMediaPlayCtrl = getChild<LLButton>("parcel_media_play_btn");
+ mParcelMediaPauseCtrl = getChild<LLButton>("parcel_media_pause_btn");
+ mParcelMediaCtrl = getChild<LLUICtrl>("parcel_media_ctrls");
+ mParcelAudioPlayCtrl = getChild<LLButton>("parcel_audio_play_btn");
+ mParcelAudioPauseCtrl = getChild<LLButton>("parcel_audio_pause_btn");
+ mParcelAudioCtrl = getChild<LLUICtrl>("parcel_audio_ctrls");
+ mShowCtrl = getChild<LLComboBox>("show_combo");
+
+ mEmptyNameString = getString("empty_item_text");
+ mDefaultParcelMediaName = getString("default_parcel_media_name");
+ mDefaultParcelMediaToolTip = getString("default_parcel_media_tool_tip");
+
+ mMediaList->setDoubleClickCallback(onZoomMedia, this);
+ mMediaList->sortByColumnIndex(PROXIMITY_COLUMN, TRUE);
+ mMediaList->sortByColumnIndex(VISIBILITY_COLUMN, FALSE);
+
+ std::string url = LLViewerParcelMedia::getURL();
+ if (!url.empty())
+ {
+ std::string name = LLViewerParcelMedia::getName();
+ mParcelMediaText->setValue(name.empty()?url:name);
+ mParcelMediaText->setToolTip(url);
+ }
+ refreshList();
+ updateColumns();
+
+ return TRUE;
+}
+
+/*virtual*/
+void LLPanelNearByMedia::onMouseEnter(S32 x, S32 y, MASK mask)
+{
+ mHoverTimer.stop();
+ LLPanel::onMouseEnter(x,y,mask);
+}
+
+
+/*virtual*/
+void LLPanelNearByMedia::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+ mHoverTimer.start();
+ LLPanel::onMouseLeave(x,y,mask);
+}
+
+/*virtual*/
+void LLPanelNearByMedia::handleVisibilityChange ( BOOL new_visibility )
+{
+ if (new_visibility)
+ {
+ mHoverTimer.start(); // timer will be stopped when mouse hovers over panel
+ gFocusMgr.setTopCtrl(this);
+ }
+ else
+ {
+ mHoverTimer.stop();
+ if (gFocusMgr.getTopCtrl() == this)
+ {
+ gFocusMgr.setTopCtrl(NULL);
+ }
+ }
+}
+
+/*virtual*/
+void LLPanelNearByMedia::onTopLost ()
+{
+ setVisible(FALSE);
+}
+
+
+const F32 AUTO_CLOSE_FADE_TIME_START= 4.0f;
+const F32 AUTO_CLOSE_FADE_TIME_END = 5.0f;
+
+void LLPanelNearByMedia::draw()
+{
+ mItemCountText->setValue(llformat(getString("media_item_count_format").c_str(), mMediaList->getItemCount()));
+
+ refreshParcelMediaUI();
+ refreshParcelAudioUI();
+ refreshList();
+
+ F32 alpha = mHoverTimer.getStarted()
+ ? clamp_rescale(mHoverTimer.getElapsedTimeF32(), AUTO_CLOSE_FADE_TIME_START, AUTO_CLOSE_FADE_TIME_END, 1.f, 0.f)
+ : 1.0f;
+ LLViewDrawContext context(alpha);
+
+ LLPanel::draw();
+
+ if (alpha == 0.f)
+ {
+ setVisible(false);
+ }
+}
+
+bool LLPanelNearByMedia::getParcelAudioAutoStart()
+{
+ return mParcelAudioAutoStart;
+}
+
+void LLPanelNearByMedia::addMediaItem(const LLUUID &id)
+{
+ if (NULL == mMediaList) return;
+
+ // Just set up the columns -- the values will be filled in by updateMediaItem().
+
+ LLSD row;
+ row["id"] = id;
+
+ LLSD &columns = row["columns"];
+
+ columns[CHECKBOX_COLUMN]["column"] = "media_checkbox_ctrl";
+ columns[CHECKBOX_COLUMN]["type"] = "checkbox";
+ //if(mDebugInfoVisible)
+ {
+ columns[PROXIMITY_COLUMN]["column"] = "media_proximity";
+ columns[PROXIMITY_COLUMN]["value"] = "";
+ columns[VISIBILITY_COLUMN]["column"] = "media_visibility";
+ columns[VISIBILITY_COLUMN]["value"] = "";
+ columns[CLASS_COLUMN]["column"] = "media_class";
+ columns[CLASS_COLUMN]["type"] = "text";
+ columns[CLASS_COLUMN]["value"] = "";
+ }
+ columns[NAME_COLUMN]["column"] = "media_name";
+ columns[NAME_COLUMN]["type"] = "text";
+ columns[NAME_COLUMN]["value"] = "";
+ //if(mDebugInfoVisible)
+ {
+ columns[DEBUG_COLUMN]["column"] = "media_debug";
+ columns[DEBUG_COLUMN]["type"] = "text";
+ columns[DEBUG_COLUMN]["value"] = "";
+ }
+
+ LLScrollListItem* new_item = mMediaList->addElement(row);
+ LLScrollListCheck* scroll_list_check = dynamic_cast<LLScrollListCheck*>(new_item->getColumn(CHECKBOX_COLUMN));
+ if (scroll_list_check)
+ {
+ LLCheckBoxCtrl *check = scroll_list_check->getCheckBox();
+ check->setCommitCallback(boost::bind(&LLPanelNearByMedia::onCheckItem, this, _1, id));
+ }
+}
+
+void LLPanelNearByMedia::updateMediaItem(LLScrollListItem* item, LLViewerMediaImpl* impl)
+{
+ LLScrollListCell* cell = item->getColumn(PROXIMITY_COLUMN);
+ if(cell)
+ {
+ // since we are forced to sort by text, encode sort order as string
+ std::string proximity_string = STRINGIZE(/*llformat("%010d", */impl->getProximity());
+ std::string old_proximity_string = cell->getValue().asString();
+ if(proximity_string != old_proximity_string)
+ {
+ cell->setValue(proximity_string);
+ mMediaList->setNeedsSort(true);
+ }
+ }
+
+ cell = item->getColumn(CHECKBOX_COLUMN);
+ if(cell)
+ {
+ cell->setValue(!impl->isMediaDisabled());
+ }
+
+ cell = item->getColumn(VISIBILITY_COLUMN);
+ if(cell)
+ {
+ S32 old_visibility = cell->getValue();
+ S32 new_visibility = (impl->hasMedia()) ? 1 : ((impl->isMediaDisabled()) ? 0 : -1);
+ cell->setValue(STRINGIZE(new_visibility));
+ if (new_visibility != old_visibility)
+ {
+ mMediaList->setNeedsSort(true);
+ }
+ }
+
+ S32 media_class = -1;
+ cell = item->getColumn(NAME_COLUMN);
+ if(cell)
+ {
+ std::string name;
+ std::string url;
+
+ getNameAndUrlHelper(impl, name, url, mEmptyNameString);
+
+ cell->setToolTip(url);
+ std::string old_name = cell->getValue().asString();
+ if(old_name != name)
+ {
+ cell->setValue(name);
+ }
+
+ LLColor4 cell_color = LLColor4::white;
+ U8 font_style = LLFontGL::NORMAL;
+
+ // Focused
+ if (impl->hasFocus())
+ {
+ if (mDebugInfoVisible) cell_color = LLColor4::yellow;
+ media_class = MEDIA_CLASS_FOCUSED;
+ }
+ // Is attached to another avatar?
+ else if (impl->isAttachedToAnotherAvatar())
+ {
+ if (mDebugInfoVisible) cell_color = LLColor4::red;
+ media_class = MEDIA_CLASS_ON_OTHERS;
+ }
+ // Outside agent parcel
+ else if (!impl->isInAgentParcel())
+ {
+ if (mDebugInfoVisible) cell_color = LLColor4::orange;
+ media_class = MEDIA_CLASS_OUTSIDE_PARCEL;
+ }
+ else {
+ // inside parcel
+ media_class = MEDIA_CLASS_WITHIN_PARCEL;
+ }
+ if (impl->isMediaDisabled())
+ {
+ if (mDebugInfoVisible) font_style |= LLFontGL::ITALIC;
+ if (mDebugInfoVisible) cell_color = LLColor4::black;
+ }
+ // Dim it if it isn't "showing"
+ else if (!impl->hasMedia())
+ {
+ cell_color.setAlpha(0.25);
+ }
+ // Bold it if it is time-based media and it is playing
+ else if (impl->isMediaTimeBased() &&
+ impl->isMediaPlaying())
+ {
+ if (mDebugInfoVisible) font_style |= LLFontGL::BOLD;
+ }
+ cell->setColor(cell_color);
+ LLScrollListText *text_cell = dynamic_cast<LLScrollListText*> (cell);
+ if (text_cell)
+ {
+ text_cell->setFontStyle(font_style);
+ }
+ }
+
+ cell = item->getColumn(CLASS_COLUMN);
+ if(cell)
+ {
+ // TODO: clean this up!
+ cell->setValue(STRINGIZE(media_class));
+ }
+
+ if(mDebugInfoVisible)
+ {
+ cell = item->getColumn(DEBUG_COLUMN);
+ if(cell)
+ {
+ std::string s;
+
+ s += llformat("%g/", (float)impl->getInterest());
+
+ // proximity distance is actually distance squared -- display it as straight distance.
+ s += llformat("%g/", fsqrtf(impl->getProximityDistance()));
+
+// s += llformat("%g/", (float)impl->getCPUUsage());
+// s += llformat("%g/", (float)impl->getApproximateTextureInterest());
+ s += llformat("%g/", (float)(NULL == impl->getSomeObject()) ? 0.0 : impl->getSomeObject()->getPixelArea());
+
+ s += LLPluginClassMedia::priorityToString(impl->getPriority());
+
+ if(impl->hasMedia())
+ {
+ s += '@';
+ }
+ else if(impl->isPlayable())
+ {
+ s += '+';
+ }
+ else if(impl->isForcedUnloaded())
+ {
+ s += '!';
+ }
+
+ cell->setValue(s);
+ }
+ }
+}
+
+void LLPanelNearByMedia::removeMediaItem(const LLUUID &id)
+{
+ if (NULL == mMediaList) return;
+
+ mMediaList->deleteSingleItem(mMediaList->getItemIndex(id));
+}
+
+void LLPanelNearByMedia::refreshParcelMediaUI()
+{
+ std::string url = LLViewerParcelMedia::getURL();
+ LLStyle::Params style_params;
+ if (url.empty())
+ {
+ style_params.font.style = "ITALIC";
+ mParcelMediaText->setText(mDefaultParcelMediaName, style_params);
+ mParcelMediaText->setToolTip(mDefaultParcelMediaToolTip);
+ mEnableParcelMediaCtrl->setEnabled(false);
+ mDisableParcelMediaCtrl->setEnabled(false);
+ }
+ else {
+ std::string name = LLViewerParcelMedia::getName();
+ if (name.empty()) name = url;
+ mParcelMediaText->setText(name, style_params);
+ mParcelMediaText->setToolTip(url);
+ mEnableParcelMediaCtrl->setEnabled(true);
+ mDisableParcelMediaCtrl->setEnabled(true);
+ }
+
+ // Set up the default play controls state
+ mParcelMediaPauseCtrl->setEnabled(false);
+ mParcelMediaPauseCtrl->setVisible(false);
+ mParcelMediaPlayCtrl->setEnabled(true);
+ mParcelMediaPlayCtrl->setVisible(true);
+ mParcelMediaCtrl->setEnabled(false);
+
+ if (LLViewerParcelMedia::getParcelMedia())
+ {
+ if (LLViewerParcelMedia::getParcelMedia()->getMediaPlugin() &&
+ LLViewerParcelMedia::getParcelMedia()->getMediaPlugin()->pluginSupportsMediaTime())
+ {
+ mParcelMediaCtrl->setEnabled(true);
+
+ switch(LLViewerParcelMedia::getParcelMedia()->getMediaPlugin()->getStatus())
+ {
+ case LLPluginClassMediaOwner::MEDIA_PLAYING:
+ mParcelMediaPlayCtrl->setEnabled(false);
+ mParcelMediaPlayCtrl->setVisible(false);
+ mParcelMediaPauseCtrl->setEnabled(true);
+ mParcelMediaPauseCtrl->setVisible(true);
+ break;
+ case LLPluginClassMediaOwner::MEDIA_PAUSED:
+ default:
+ // default play status is kosher
+ break;
+ }
+ }
+ }
+}
+
+void LLPanelNearByMedia::refreshParcelAudioUI()
+{
+ bool parcel_audio_enabled = !getParcelAudioURL().empty();
+
+ mParcelAudioCtrl->setToolTip(getParcelAudioURL());
+
+ if (gAudiop && parcel_audio_enabled)
+ {
+ mParcelAudioCtrl->setEnabled(true);
+
+ if (PARCEL_AUDIO_PLAYING == gAudiop->isInternetStreamPlaying())
+ {
+ mParcelAudioPlayCtrl->setEnabled(false);
+ mParcelAudioPlayCtrl->setVisible(false);
+ mParcelAudioPauseCtrl->setEnabled(true);
+ mParcelAudioPauseCtrl->setVisible(true);
+ }
+ else {
+ mParcelAudioPlayCtrl->setEnabled(true);
+ mParcelAudioPlayCtrl->setVisible(true);
+ mParcelAudioPauseCtrl->setEnabled(false);
+ mParcelAudioPauseCtrl->setVisible(false);
+ }
+ }
+ else {
+ mParcelAudioCtrl->setEnabled(false);
+ mParcelAudioPlayCtrl->setEnabled(true);
+ mParcelAudioPlayCtrl->setVisible(true);
+ mParcelAudioPauseCtrl->setEnabled(false);
+ mParcelAudioPauseCtrl->setVisible(false);
+ }
+}
+
+void LLPanelNearByMedia::refreshList()
+{
+ bool all_items_deleted = false;
+
+ if(!mMediaList)
+ {
+ // None of this makes any sense if the media list isn't there.
+ return;
+ }
+
+ // Check whether the debug column has been shown/hidden.
+ bool debug_info_visible = gSavedSettings.getBOOL("MediaPerformanceManagerDebug");
+ if(debug_info_visible != mDebugInfoVisible)
+ {
+ mDebugInfoVisible = debug_info_visible;
+
+ // Clear all items so the list gets regenerated.
+ mMediaList->deleteAllItems();
+ all_items_deleted = true;
+
+ updateColumns();
+ }
+
+ // Get the canonical list from LLViewerMedia
+ LLViewerMedia::impl_list impls = LLViewerMedia::getPriorityList();
+ LLViewerMedia::impl_list::iterator priority_iter;
+
+ // iterate over the impl list, creating rows as necessary.
+ for(priority_iter = impls.begin(); priority_iter != impls.end(); priority_iter++)
+ {
+ // If we just emptied out the list, every flag needs to be reset.
+ if(all_items_deleted)
+ {
+ (*priority_iter)->setInNearbyMediaList(false);
+ }
+
+ if(! (*priority_iter)->isParcelMedia())
+ {
+ LLUUID media_id = (*priority_iter)->getMediaTextureID();
+ S32 proximity = (*priority_iter)->getProximity();
+ // This is expensive (i.e. a linear search) -- don't use it here. We now use mInNearbyMediaList instead.
+// S32 index = mMediaList->getItemIndex(media_id);
+
+ if(proximity < 0 || !shouldShow(*priority_iter))
+ {
+ // This isn't inworld media -- don't show it in the list.
+ if ((*priority_iter)->getInNearbyMediaList())
+ {
+ // There's a row for this impl -- remove it.
+ removeMediaItem(media_id);
+ (*priority_iter)->setInNearbyMediaList(false);
+ }
+ }
+ else
+ {
+ if (!(*priority_iter)->getInNearbyMediaList())
+ {
+ // We don't have a row for this impl -- add one.
+ addMediaItem(media_id);
+ (*priority_iter)->setInNearbyMediaList(true);
+ }
+ }
+ }
+ }
+
+ int disabled_count = 0;
+ int enabled_count = 0;
+
+ // Iterate over the rows in the control, updating ones whose impl exists, and deleting ones whose impl has gone away.
+ std::vector<LLScrollListItem*> items = mMediaList->getAllData();
+
+ for (std::vector<LLScrollListItem*>::iterator item_it = items.begin();
+ item_it != items.end();
+ ++item_it)
+ {
+ LLScrollListItem* item = (*item_it);
+ LLUUID row_id = item->getUUID();
+
+ LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id);
+ if(impl)
+ {
+ updateMediaItem(item, impl);
+ if(impl->isMediaDisabled())
+ disabled_count++;
+ else
+ enabled_count++;
+ }
+ else
+ {
+ // This item's impl has been deleted -- remove the row.
+ // Removing the row won't throw off our iteration, since we have a local copy of the array.
+ // We just need to make sure we don't access this item after the delete.
+ removeMediaItem(row_id);
+ }
+ }
+ mEnableAllCtrl->setEnabled(! LLViewerMedia::getInWorldMediaDisabled() && disabled_count > 0);
+ mDisableAllCtrl->setEnabled(! LLViewerMedia::getInWorldMediaDisabled() && enabled_count > 0);
+
+ // Set the selection to whatever media impl the media focus/hover is on.
+ // This is an experiment, and can be removed by ifdefing out these 4 lines.
+ LLUUID media_target = LLViewerMediaFocus::getInstance()->getControlsMediaID();
+ if(media_target.notNull())
+ {
+ mMediaList->selectByID(media_target);
+ }
+}
+
+void LLPanelNearByMedia::updateColumns()
+{
+ if (!mDebugInfoVisible)
+ {
+ mMediaList->getColumn(VISIBILITY_COLUMN)->setWidth(-1);
+ mMediaList->getColumn(PROXIMITY_COLUMN)->setWidth(-1);
+ mMediaList->getColumn(CLASS_COLUMN)->setWidth(-1);
+ mMediaList->getColumn(DEBUG_COLUMN)->setWidth(-1);
+ }
+ else {
+ mMediaList->getColumn(VISIBILITY_COLUMN)->setWidth(20);
+ mMediaList->getColumn(PROXIMITY_COLUMN)->setWidth(30);
+ mMediaList->getColumn(CLASS_COLUMN)->setWidth(20);
+ mMediaList->getColumn(DEBUG_COLUMN)->setWidth(200);
+ }
+}
+
+void LLPanelNearByMedia::onClickEnableAll()
+ {
+ enableAllHelper(true);
+ }
+
+void LLPanelNearByMedia::onClickDisableAll()
+{
+ enableAllHelper(false);
+}
+
+void LLPanelNearByMedia::enableAllHelper(bool enabled)
+{
+ bool disabled = !enabled;
+
+ // Iterate over the rows in the control, setting the disable flag on the impl for each.
+ std::vector<LLScrollListItem*> items = mMediaList->getAllData();
+
+ for (std::vector<LLScrollListItem*>::iterator item_it = items.begin();
+ item_it != items.end();
+ ++item_it)
+ {
+ setDisabled((*item_it)->getUUID(), disabled);
+ }
+
+ // Now do the parcel media
+ if (LLViewerParcelMedia::getParcelMedia())
+ {
+ LLViewerParcelMedia::getParcelMedia()->setDisabled(disabled);
+ }
+
+ // And finally, parcel audio
+ if (disabled)
+ {
+ onClickParcelAudioStop();
+ }
+ else {
+ onClickParcelAudioPlay();
+ }
+
+ // The hilight state of the control will be adjusted the next time through refreshList().
+}
+
+void LLPanelNearByMedia::onClickEnableParcelMedia()
+{
+ LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+ }
+
+void LLPanelNearByMedia::onClickDisableParcelMedia()
+{
+ // This actually unloads the impl, as opposed to "stop"ping the media
+ LLViewerParcelMedia::stop();
+ }
+
+void LLPanelNearByMedia::onCheckItem(LLUICtrl* ctrl, const LLUUID &row_id)
+{
+ LLCheckBoxCtrl* check = static_cast<LLCheckBoxCtrl*>(ctrl);
+
+ setDisabled(row_id, ! check->getValue());
+}
+
+bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled)
+{
+ LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id);
+ if(impl)
+ {
+ impl->setDisabled(disabled);
+ return true;
+ }
+ return false;
+}
+
+//static
+void LLPanelNearByMedia::onZoomMedia(void* user_data)
+{
+ LLPanelNearByMedia* panelp = (LLPanelNearByMedia*)user_data;
+ LLUUID media_id = panelp->mMediaList->getValue().asUUID();
+
+ LLViewerMediaFocus::getInstance()->focusZoomOnMedia(media_id);
+}
+
+void LLPanelNearByMedia::onClickMuteParcelMedia()
+{
+ if (LLViewerParcelMedia::getParcelMedia())
+ {
+ bool muted = mParcelMediaMuteCtrl->getValue();
+ LLViewerParcelMedia::getParcelMedia()->setVolume(muted ? (F32)0 : mParcelMediaVolumeSlider->getValueF32() );
+ }
+}
+
+void LLPanelNearByMedia::onParcelMediaVolumeSlider()
+{
+ if (LLViewerParcelMedia::getParcelMedia())
+ {
+ LLViewerParcelMedia::getParcelMedia()->setVolume(mParcelMediaVolumeSlider->getValueF32());
+ }
+}
+
+void LLPanelNearByMedia::onClickParcelMediaPlay()
+{
+ LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+}
+
+void LLPanelNearByMedia::onClickParcelMediaStop()
+{
+ if (LLViewerParcelMedia::getParcelMedia())
+ {
+ // This stops the media playing, as opposed to unloading it like
+ // LLViewerParcelMedia::stop() does
+ LLViewerParcelMedia::getParcelMedia()->stop();
+ }
+}
+
+void LLPanelNearByMedia::onClickParcelMediaPause()
+{
+ LLViewerParcelMedia::pause();
+}
+
+void LLPanelNearByMedia::onClickParcelAudioPlay()
+{
+ // 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;
+
+ if (PARCEL_AUDIO_PAUSED == gAudiop->isInternetStreamPlaying())
+ {
+ // 'false' means unpause
+ gAudiop->pauseInternetStream(false);
+ }
+ else {
+ gAudiop->startInternetStream(getParcelAudioURL());
+ }
+}
+
+void LLPanelNearByMedia::onClickParcelAudioStop()
+{
+ // User *explicitly* stopped the internet stream, so don't
+ // re-start audio when i.e. they move to another parcel, until
+ // they explicitly start it again.
+ mParcelAudioAutoStart = false;
+
+ if (!gAudiop)
+ return;
+
+ gAudiop->stopInternetStream();
+}
+
+void LLPanelNearByMedia::onClickParcelAudioPause()
+{
+ if (!gAudiop)
+ return;
+
+ // 'true' means pause
+ gAudiop->pauseInternetStream(true);
+}
+
+bool LLPanelNearByMedia::shouldShow(LLViewerMediaImpl* impl)
+{
+ const LLSD &choice_llsd = mShowCtrl->getSelectedValue();
+ MediaClass choice = (MediaClass)choice_llsd.asInteger();
+
+ switch (choice)
+ {
+ case MEDIA_CLASS_ALL:
+ return true;
+ break;
+ case MEDIA_CLASS_WITHIN_PARCEL:
+ return impl->isInAgentParcel();
+ break;
+ case MEDIA_CLASS_OUTSIDE_PARCEL:
+ return ! impl->isInAgentParcel();
+ break;
+ case MEDIA_CLASS_ON_OTHERS:
+ return impl->isAttachedToAnotherAvatar();
+ break;
+ default:
+ break;
+ }
+ return true;
+}
+
+// static
+void LLPanelNearByMedia::getNameAndUrlHelper(LLViewerMediaImpl* impl, std::string& name, std::string & url, const std::string &defaultName)
+{
+ if (NULL == impl) return;
+
+ name = impl->getName();
+ url = impl->getCurrentMediaURL(); // This is the URL the media impl actually has loaded
+ if (url.empty())
+ {
+ url = impl->getMediaEntryURL(); // This is the current URL from the media data
+ }
+ if (url.empty())
+ {
+ url = impl->getHomeURL(); // This is the home URL from the media data
+ }
+ if (name.empty())
+ {
+ name = url;
+ }
+ if (name.empty())
+ {
+ name = defaultName;
+ }
+}
+
+// static
+std::string LLPanelNearByMedia::getParcelAudioURL()
+{
+ return LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL();
+}
+
+
diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h
new file mode 100644
index 0000000000..654e0980a6
--- /dev/null
+++ b/indra/newview/llpanelnearbymedia.h
@@ -0,0 +1,157 @@
+/**
+ * @file llpanelnearbymedia.h
+ * @brief Management interface for muting and controlling nearby media
+ *
+ * $LicenseInfo:firstyear=2005&license=viewergpl$
+ *
+ * Copyright (c) 2005-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLPANELNEARBYMEDIA_H
+#define LL_LLPANELNEARBYMEDIA_H
+
+#include "llpanel.h"
+
+class LLPanelNearbyMedia;
+class LLButton;
+class LLScrollListCtrl;
+class LLSliderCtrl;
+class LLCheckBoxCtrl;
+class LLTextBox;
+class LLComboBox;
+class LLViewerMediaImpl;
+
+class LLPanelNearByMedia : public LLPanel
+{
+public:
+
+ /*virtual*/ BOOL postBuild();
+ /*virtual*/ void draw();
+ /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
+ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
+ /*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
+ /*virtual*/ void onTopLost ();
+
+ // this is part of the nearby media *dialog* so we can track whether
+ // the user *implicitly* wants audio on or off via their *explicit*
+ // interaction with our buttons.
+ bool getParcelAudioAutoStart();
+
+ LLPanelNearByMedia();
+ virtual ~LLPanelNearByMedia();
+
+private:
+
+ enum ColumnIndex {
+ CHECKBOX_COLUMN = 0,
+ PROXIMITY_COLUMN = 1,
+ VISIBILITY_COLUMN = 2,
+ CLASS_COLUMN = 3,
+ NAME_COLUMN = 4,
+ DEBUG_COLUMN = 5
+ };
+
+ // Media "class" enumeration
+ enum MediaClass {
+ MEDIA_CLASS_ALL = 0,
+ MEDIA_CLASS_FOCUSED = 1,
+ MEDIA_CLASS_WITHIN_PARCEL = 2,
+ MEDIA_CLASS_OUTSIDE_PARCEL = 3,
+ MEDIA_CLASS_ON_OTHERS = 4
+ };
+
+ // Add/remove an LLViewerMediaImpl to/from the list
+ void addMediaItem(const LLUUID &id);
+ void updateMediaItem(LLScrollListItem* item, LLViewerMediaImpl* impl);
+ void removeMediaItem(const LLUUID &id);
+
+ // Refresh the list in the UI
+ void refreshList();
+
+ void refreshParcelMediaUI();
+ void refreshParcelAudioUI();
+
+ // UI Callbacks
+ void onClickEnableAll();
+ void onClickDisableAll();
+ void onClickEnableParcelMedia();
+ void onClickDisableParcelMedia();
+ void onClickMuteParcelMedia();
+ void onParcelMediaVolumeSlider();
+ void onClickParcelMediaPlay();
+ void onClickParcelMediaStop();
+ void onClickParcelMediaPause();
+ void onClickParcelAudioPlay();
+ void onClickParcelAudioStop();
+ void onClickParcelAudioPause();
+ void onCheckAutoPlay();
+
+ void onCheckItem(LLUICtrl* ctrl, const LLUUID &row_id);
+
+ static void onZoomMedia(void* user_data);
+
+private:
+ bool setDisabled(const LLUUID &id, bool disabled);
+
+ static void getNameAndUrlHelper(LLViewerMediaImpl* impl, std::string& name, std::string & url, const std::string &defaultName);
+
+ static std::string getParcelAudioURL();
+
+ void updateColumns();
+
+ void enableAllHelper(bool val);
+
+ bool shouldShow(LLViewerMediaImpl* impl);
+
+ LLScrollListCtrl* mMediaList;
+ LLUICtrl* mEnableAllCtrl;
+ LLUICtrl* mDisableAllCtrl;
+ LLSliderCtrl* mParcelMediaVolumeSlider;
+ LLButton* mParcelMediaMuteCtrl;
+ LLUICtrl* mEnableParcelMediaCtrl;
+ LLUICtrl* mDisableParcelMediaCtrl;
+ LLTextBox* mParcelMediaText;
+ LLTextBox* mItemCountText;
+ LLUICtrl* mParcelMediaCtrl;
+ LLUICtrl* mParcelMediaPlayCtrl;
+ LLUICtrl* mParcelMediaPauseCtrl;
+ LLUICtrl* mParcelAudioCtrl;
+ LLUICtrl* mParcelAudioPlayCtrl;
+ LLUICtrl* mParcelAudioPauseCtrl;
+ LLComboBox* mShowCtrl;
+
+ bool mAllMediaDisabled;
+ bool mDebugInfoVisible;
+ bool mParcelAudioAutoStart;
+ std::string mEmptyNameString;
+ std::string mDefaultParcelMediaName;
+ std::string mDefaultParcelMediaToolTip;
+
+ LLFrameTimer mHoverTimer;
+};
+
+
+#endif // LL_LLPANELNEARBYMEDIA_H
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index 74e37efe4e..247134ad63 100644
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -96,7 +96,10 @@ void LLPanelVolumePulldown::handleVisibilityChange ( BOOL new_visibility )
else
{
mHoverTimer.stop();
- gFocusMgr.setTopCtrl(NULL);
+ if (gFocusMgr.getTopCtrl() == this)
+ {
+ gFocusMgr.setTopCtrl(NULL);
+ }
}
}
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index a2648e4c3a..64cb739bea 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -41,6 +41,7 @@
#include "llviewercontrol.h"
#include "llfloaterbuycurrency.h"
#include "llfloaterlagmeter.h"
+#include "llpanelnearbymedia.h"
#include "llpanelvolumepulldown.h"
#include "llfloaterregioninfo.h"
#include "llfloaterscriptdebug.h"
@@ -189,7 +190,7 @@ BOOL LLStatusBar::postBuild()
mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this));
LLButton* media_toggle = getChild<LLButton>("media_toggle_btn");
- media_toggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true));
+ media_toggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this));
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
@@ -238,6 +239,9 @@ BOOL LLStatusBar::postBuild()
mPanelVolumePulldown = new LLPanelVolumePulldown();
addChild(mPanelVolumePulldown);
+ mPanelNearByMedia = new LLPanelNearByMedia();
+ addChild(mPanelNearByMedia);
+
LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect();
LLButton* volbtn = getChild<LLButton>( "volume_btn" );
volume_pulldown_rect.setLeftTopAndSize(volbtn->getRect().mLeft -
@@ -250,6 +254,21 @@ BOOL LLStatusBar::postBuild()
mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
mPanelVolumePulldown->setVisible(FALSE);
+ LLRect nearby_media_rect = mPanelNearByMedia->getRect();
+ LLButton* nearby_media_btn = getChild<LLButton>( "media_toggle_btn" );
+ nearby_media_rect.setLeftTopAndSize(nearby_media_btn->getRect().mLeft -
+ (volume_pulldown_rect.getWidth() - nearby_media_btn->getRect().getWidth())/2,
+ nearby_media_btn->calcScreenRect().mBottom,
+ nearby_media_rect.getWidth(),
+ nearby_media_rect.getHeight());
+ // force onscreen
+ nearby_media_rect.translate(getRect().getWidth() - nearby_media_rect.mRight, 0);
+
+ mPanelNearByMedia->setShape(nearby_media_rect);
+ mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
+ mPanelNearByMedia->setVisible(FALSE);
+
+
return TRUE;
}
@@ -511,13 +530,19 @@ static void onClickScriptDebug(void*)
LLFloaterScriptDebug::show(LLUUID::null);
}
-//static
-void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl)
+void LLStatusBar::onMouseEnterVolume()
+{
+ // show the master volume pull-down
+ mPanelVolumePulldown->setVisible(TRUE);
+}
+
+void LLStatusBar::onMouseEnterNearbyMedia()
{
// show the master volume pull-down
- gStatusBar->mPanelVolumePulldown->setVisible(TRUE);
+ mPanelNearByMedia->setVisible(TRUE);
}
+
static void onClickVolume(void* data)
{
// toggle the master mute setting
diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h
index 21a98dd753..d979f02bfd 100644
--- a/indra/newview/llstatusbar.h
+++ b/indra/newview/llstatusbar.h
@@ -48,6 +48,7 @@ class LLUUID;
class LLFrameTimer;
class LLStatGraph;
class LLPanelVolumePulldown;
+class LLPanelNearByMedia;
class LLStatusBar
: public LLPanel
@@ -87,6 +88,8 @@ public:
S32 getSquareMetersCommitted() const;
S32 getSquareMetersLeft() const;
+ LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; }
+
private:
// simple method to setup the part that holds the date
void setupDate();
@@ -94,7 +97,8 @@ private:
void onClickBuyCurrency();
void onVolumeChanged(const LLSD& newvalue);
- static void onMouseEnterVolume(LLUICtrl* ctrl);
+ void onMouseEnterVolume();
+ void onMouseEnterNearbyMedia();
static void onClickStatGraph(void* data);
private:
@@ -113,6 +117,7 @@ private:
LLFrameTimer* mBalanceTimer;
LLFrameTimer* mHealthTimer;
LLPanelVolumePulldown* mPanelVolumePulldown;
+ LLPanelNearByMedia* mPanelNearByMedia;
static std::vector<std::string> sDays;
static std::vector<std::string> sMonths;
static const U32 MAX_DATE_STRING_LENGTH;
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 29114c33c5..435636ceef 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -77,7 +77,6 @@
#include "llfloatermap.h"
#include "llfloatermemleak.h"
#include "llfloaternamedesc.h"
-#include "llfloaternearbymedia.h"
#include "llfloaternotificationsconsole.h"
#include "llfloateropenobject.h"
#include "llfloaterpay.h"
@@ -194,7 +193,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("mute_object_by_name", "floater_mute_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGetBlockedObjectName>);
LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMap>);
- LLFloaterReg::add("nearby_media", "floater_nearby_media.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNearbyMedia>);
LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>);
LLFloaterReg::add("notification_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNotificationWellWindow>);
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index b6aaca8cfa..581a4ad2e4 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -385,7 +385,7 @@ private:
LLMimeDiscoveryResponder *mMimeTypeProbe;
bool mMediaAutoPlay;
std::string mMediaEntryURL;
- bool mInNearbyMediaList; // used by LLFloaterNearbyMedia::refreshList() for performance reasons
+ bool mInNearbyMediaList; // used by LLPanelNearbyMedia::refreshList() for performance reasons
bool mClearCache;
LLColor4 mBackgroundColor;
bool mNavigateSuspended;
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 07c8867e26..0c0936c103 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -53,7 +53,7 @@
//#include "llfirstuse.h"
#include "llfloaterbuyland.h"
#include "llfloatergroups.h"
-#include "llfloaternearbymedia.h"
+#include "llpanelnearbymedia.h"
#include "llfloatersellland.h"
#include "llfloatertools.h"
#include "llparcelselection.h"
@@ -1795,11 +1795,11 @@ void optionally_start_music(const std::string& music_url)
{
// only play music when you enter a new parcel if the UI control for this
// was not *explicitly* stopped by the user. (part of SL-4878)
- LLFloaterNearbyMedia *nearby_media_floater = LLFloaterReg::findTypedInstance<LLFloaterNearbyMedia>("nearby_media");
- if ((nearby_media_floater &&
- nearby_media_floater->getParcelAudioAutoStart()) ||
+ LLPanelNearByMedia* nearby_media_panel = gStatusBar->getNearbyMediaPanel();;
+ if ((nearby_media_panel &&
+ nearby_media_panel->getParcelAudioAutoStart()) ||
// or they have expressed no opinion in the UI, but have autoplay on...
- (!nearby_media_floater &&
+ (!nearby_media_panel &&
gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)))
{
llinfos << "Starting parcel music " << music_url << llendl;
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
new file mode 100644
index 0000000000..3ff0f127c7
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml
@@ -0,0 +1,501 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ can_resize="true"
+ can_close="false"
+ height="550"
+ background_opaque="true"
+ background_visible="true"
+ layout="topleft"
+ name="nearby_media"
+ help_topic="nearby_media"
+ width="440">
+ <string name="media_item_count_format">(%ld media items)</string>
+ <string name="empty_item_text">&lt;empty&gt;</string>
+ <string name="default_parcel_media_name">&lt;No Media Available&gt;</string>
+ <string name="default_parcel_media_tool_tip">Turn parcel media on/off</string>
+ <panel
+ bottom="550"
+ follows="left|top|right|bottom"
+ left="0"
+ mouse_opaque="false"
+ name="nearby_media_panel"
+ top="0">
+ <panel
+ bevel_style="in"
+ bg_alpha_color="0 0 0 0"
+ bg_opaque_color="0 0 0 0.3"
+ follows="left|right|top"
+ top="0"
+ height="45"
+ left="0">
+ <text
+ type="string"
+ length="1"
+ follows="top|left|right"
+ font="SansSerifBold"
+ left="10">
+ All Media
+ </text>
+ <text
+ top_delta="0"
+ type="string"
+ length="1"
+ follows="top|right"
+ font="SansSerif"
+ name="media_item_count"
+ left="190">
+ (?? media items)
+ </text>
+ <button
+ name="all_nearby_media_enable_btn"
+ top_delta="18"
+ follows="left"
+ tool_tip="Turn all nearby media on"
+ left="15"
+ width="28"
+ height="22"
+ label="On">
+ <button.commit_callback
+ function="MediaListCtrl.EnableAll" />
+ </button>
+ <button
+ name="all_nearby_media_disable_btn"
+ follows="left"
+ tool_tip="Turn all nearby media off"
+ left_pad="4"
+ width="28"
+ height="22"
+ label="Off">
+ <button.commit_callback
+ function="MediaListCtrl.DisableAll" />
+ </button>
+ <slider
+ height="15"
+ top="27"
+ left_delta="48"
+ control_name="AudioLevelMedia"
+ increment="0.05"
+ initial_value="0.5"
+ width="110"
+ name="all_media_volume"
+ show_text="false"
+ volume="true">
+ <slider.commit_callback
+ function="Pref.setControlFalse"
+ parameter="MuteMedia" />
+ </slider>
+ <button
+ control_name="MuteMedia"
+ height="16"
+ image_selected="AudioMute_Off"
+ image_unselected="Audio_Off"
+ is_toggle="true"
+ left_delta="120"
+ name="mute_all_media"
+ tab_stop="false"
+ top_delta="-1"
+ width="18" />
+ </panel>
+ <!-- Parcel Media controls -->
+ <text
+ type="string"
+ length="1"
+ follows="left|top|right"
+ font="SansSerif"
+ font.size="Small"
+ top_pad="10"
+ left="40"
+ width="80">
+ Parcel Media
+ </text>
+ <text
+ name="parcel_media_name"
+ use_ellipses="true"
+ type="string"
+ length="1"
+ follows="top|left|right"
+ font="SansSerif"
+ font.style="ITALIC"
+ font.size="Small"
+ left_pad="10"
+ right="-10">
+ &lt;No Media Available&gt;
+ </text>
+<!--
+ <panel
+ bevel_style="in"
+ bg_alpha_color="0 0 0 0"
+ bg_opaque_color="0 0 0 0.3"
+ follows="left|top|right"
+ height="25"
+ left="25"
+ right="-10">
+ <button
+ name="parcel_media_enable_btn"
+ follows="left"
+ tool_tip="Turn parcel media on"
+ left="15"
+ width="28"
+ height="22"
+ label="On">
+ <button.commit_callback
+ function="ParcelMediaCtrl.EnableParcelMedia" />
+ </button>
+ <button
+ name="parcel_media_disable_btn"
+ follows="left"
+ tool_tip="Turn parcel media off"
+ left_pad="4"
+ width="28"
+ height="22"
+ label="Off">
+ <button.commit_callback
+ function="ParcelMediaCtrl.DisableParcelMedia" />
+ </button>
+ </panel>
+-->
+ <panel
+ name="parcel_media_ctrls"
+ bevel_style="in"
+ follows="left|top|right"
+ top_pad="2"
+ height="30"
+ left="0">
+ <button
+ name="parcel_media_play_btn"
+ image_overlay="Play_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ tool_tip = "Play parcel media"
+ left="40"
+ height="22"
+ min_width="22"
+ width="22">
+ <button.commit_callback
+ function="ParcelMediaCtrl.Play" />
+ </button>
+ <button
+ name="parcel_media_pause_btn"
+ image_overlay="Pause_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ left_delta="0"
+ height="22"
+ tool_tip = "Pause parcel media">
+ <button.commit_callback
+ function="ParcelMediaCtrl.Pause" />
+ </button>
+ <button
+ name="parcel_media_stop_btn"
+ image_overlay="Stop_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ left_delta="25"
+ height="22"
+ tool_tip="Stop parcel media"
+ min_width="22"
+ width="22">
+ <button.commit_callback
+ function="ParcelMediaCtrl.Stop" />
+ </button>
+ <slider
+ height="15"
+ top="7"
+ left="95"
+ increment="0.05"
+ initial_value="0.5"
+ width="110"
+ name="parcel_media_volume"
+ show_text="false"
+ volume="true">
+ <slider.commit_callback
+ function="ParcelMediaCtrl.ParcelMediaVolume"/>
+ </slider>
+ <button
+ height="16"
+ image_selected="AudioMute_Off"
+ image_unselected="Audio_Off"
+ is_toggle="true"
+ left_delta="120"
+ name="parcel_media_mute"
+ tab_stop="false"
+ top_delta="-1"
+ width="18" >
+ <button.commit_callback
+ function="ParcelMediaCtrl.MuteParcelMedia" />
+ </button>
+ </panel>
+ <!-- parcel audio -->
+ <panel
+ name="parcel_audio_ctrls"
+ bevel_style="in"
+ follows="left|top|right"
+ top_delta="30"
+ height="40"
+ left="0">
+ <text
+ type="string"
+ length="1"
+ top="0"
+ follows="top|left|right"
+ font="SansSerif"
+ font.size="Small"
+ left="40">
+ Parcel Audio
+ </text>
+ <button
+ name="parcel_audio_play_btn"
+ image_overlay="Play_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ tool_tip = "Play parcel audio"
+ top="15"
+ left="40"
+ height="22"
+ min_width="22"
+ width="22">
+ <button.commit_callback
+ function="ParcelAudioCtrl.Play" />
+ </button>
+ <button
+ name="parcel_audio_pause_btn"
+ image_overlay="Pause_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ left_delta="0"
+ height="22"
+ tool_tip = "Pause parcel audio">
+ <button.commit_callback
+ function="ParcelAudioCtrl.Pause" />
+ </button>
+ <button
+ name="parcel_audio_stop_btn"
+ image_overlay="Stop_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ left_delta="25"
+ height="22"
+ tool_tip="Stop parcel audio"
+ min_width="22"
+ width="22">
+ <button.commit_callback
+ function="ParcelAudioCtrl.Stop" />
+ </button>
+ <slider
+ control_name="AudioLevelMusic"
+ follows="left|top"
+ height="15"
+ increment="0.05"
+ initial_value="0.5"
+ left="95"
+ width="110"
+ name="Music Volume"
+ show_text="false"
+ top_delta="4"
+ volume="true">
+ <slider.commit_callback
+ function="Pref.setControlFalse"
+ parameter="MuteMusic" />
+ </slider>
+ <button
+ control_name="MuteMusic"
+ height="16"
+ image_selected="AudioMute_Off"
+ image_unselected="Audio_Off"
+ is_toggle="true"
+ left_delta="120"
+ name="mute_music"
+ tab_stop="false"
+ top_delta="-1"
+ width="18" />
+ </panel>
+ <panel
+ bevel_style="in"
+ border_style="line"
+ bg_alpha_color="0 0 0 0"
+ bg_opaque_color="0 0 0 0.3"
+ follows="left|right|top|bottom"
+ top_delta="45"
+ right="-1"
+ left="0"
+ height="265">
+ <text
+ type="string"
+ length="1"
+ follows="top|left|right"
+ font="SansSerifBold"
+ left="10">
+ Nearby Media
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="top|left|right"
+ font="SansSerif"
+ font.size="Small"
+ font.style="ITALIC"
+ top_pad="8"
+ left="10">
+ Check to enable/disable media; double-click to zoom view
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="top|left|right"
+ font="SansSerif"
+ top_pad="15"
+ left="10">
+ Show:
+ </text>
+ <combo_box
+ height="23"
+ left="50"
+ width="120"
+ top_delta="-5"
+ follows="left|right|top"
+ name="show_combo">
+ <combo_box.item
+ label="All"
+ value="0"
+ name="All" />
+ <combo_box.item
+ label="In this Parcel"
+ value="2"
+ name="WithinParcel" />
+ <combo_box.item
+ label="Outside this Parcel"
+ value="3"
+ name="OutsideParcel" />
+ <combo_box.item
+ label="On other Avatars"
+ value="4"
+ ame="OnOthers" />
+ </combo_box>
+ <scroll_list
+ follows="left|top|bottom|right"
+ column_padding="0"
+ height="200"
+ draw_heading="false"
+ draw_stripes="true"
+ bg_stripe_color="0.25 0.25 0.25 0.25"
+ top_pad="8"
+ left="10"
+ right="-10"
+ name="media_list">
+ <scroll_list.columns
+ type="checkbox"
+ width="20"
+ label=""
+ name="media_checkbox_ctrl" />
+ <scroll_list.columns
+ sort_column="media_proximity"
+ width="-1"
+ label="Proximity"
+ name="media_proximity" />
+ <scroll_list.columns
+ sort_column="media_visibility"
+ width="-1"
+ label="Visible"
+ name="media_visibility" />
+ <scroll_list.columns
+ sort_column="media_class"
+ width="-1"
+ label="Class"
+ name="media_class" />
+ <scroll_list.columns
+ label="Name"
+ name="media_name" />
+ <scroll_list.columns
+ sort_column="media_debug"
+ width="-1"
+ label="Debug"
+ name="media_debug" />
+ </scroll_list>
+ </panel>
+ <panel
+ bevel_style="in"
+ background_visible="true"
+ bg_alpha_color="0.0 0.0 0.0 1.0"
+ bg_opaque_color="0 0 0 0.3"
+ follows="left|right|bottom"
+ top_pad="10"
+ height="110"
+ left="10"
+ right="-10">
+ <check_box
+ name="media_enabled_btn"
+ control_name="AudioStreamingMedia"
+ value="true"
+ follows="left|bottom|right"
+ height="15"
+ tool_tip="Check this to enable all media"
+ label="All Media Enabled"
+ top="10"
+ left="10"
+ width="20"/>
+ <check_box
+ name="media_auto_play_btn"
+ control_name="ParcelMediaAutoPlayEnable"
+ enabled_control="AudioStreamingMedia"
+ value="true"
+ follows="left|bottom|right"
+ height="15"
+ tool_tip="Check this to let media auto-play if it wants"
+ label="Allow Media to auto-play"
+ top_pad="5"
+ left="10"
+ width="20"/>
+ <check_box
+ name="media_show_within_parcel_btn"
+ control_name="MediaShowWithinParcel"
+ enabled_control="AudioStreamingMedia"
+ value="true"
+ follows="left|bottom|right"
+ height="15"
+ tool_tip="Uncheck this to hide media within the parcel you are standing in"
+ label="Show media within current parcel"
+ left="10"
+ width="20"/>
+ <check_box
+ name="media_show_outside_parcel_btn"
+ control_name="MediaShowOutsideParcel"
+ enabled_control="AudioStreamingMedia"
+ value="true"
+ follows="left|bottom|right"
+ height="15"
+ tool_tip="Uncheck this to hide media outside the parcel you are standing in"
+ label="Show media outside current parcel"
+ left="10"
+ width="20"/>
+ <check_box
+ name="media_show_on_others_btn"
+ control_name="MediaShowOnOthers"
+ enabled_control="AudioStreamingMedia"
+ value="true"
+ follows="left|bottom|right"
+ height="15"
+ tool_tip="Uncheck this to hide media attached to other avatars nearby"
+ label="Show media attached to other avatars"
+ left="10"
+ width="20"/>
+ </panel>
+ </panel>
+</panel>