summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelnearbymedia.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-27 22:58:52 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-27 22:58:52 +0200
commitbc496f5f17a446af27b47cbe227e7e85089bab8d (patch)
treeb7c90fee48d1f48e21c5f62fe84abaca16f8bb81 /indra/newview/llpanelnearbymedia.cpp
parent91c311dd7beb8d723a00efac8e61019eeb8af17b (diff)
parentf89c9e9b20a13acd8f6af76699259cab4c74d5db (diff)
Downstream merge from lindenlab/viewer-lynx
Diffstat (limited to 'indra/newview/llpanelnearbymedia.cpp')
-rw-r--r--indra/newview/llpanelnearbymedia.cpp77
1 files changed, 40 insertions, 37 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index af28ff8e61..b654e928e2 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -554,9 +554,10 @@ void LLPanelNearByMedia::refreshParcelItems()
// Only show "special parcel items" if "All" or "Within" filter
// (and if media is "enabled")
bool should_include = (choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL);
-
+ LLViewerMedia* media_inst = LLViewerMedia::getInstance();
+
// First Parcel Media: add or remove it as necessary
- if (gSavedSettings.getBOOL("AudioStreamingMedia") &&should_include && LLViewerMedia::hasParcelMedia())
+ if (gSavedSettings.getBOOL("AudioStreamingMedia") && should_include && media_inst->hasParcelMedia())
{
// Yes, there is parcel media.
if (NULL == mParcelMediaItem)
@@ -577,7 +578,7 @@ void LLPanelNearByMedia::refreshParcelItems()
if (NULL != mParcelMediaItem)
{
std::string name, url, tooltip;
- getNameAndUrlHelper(LLViewerParcelMedia::getParcelMedia(), name, url, "");
+ getNameAndUrlHelper(LLViewerParcelMedia::getInstance()->getParcelMedia(), name, url, "");
if (name.empty() || name == url)
{
tooltip = url;
@@ -586,20 +587,20 @@ void LLPanelNearByMedia::refreshParcelItems()
{
tooltip = name + " : " + url;
}
- LLViewerMediaImpl *impl = LLViewerParcelMedia::getParcelMedia();
+ LLViewerMediaImpl *impl = LLViewerParcelMedia::getInstance()->getParcelMedia();
updateListItem(mParcelMediaItem,
mParcelMediaName,
tooltip,
-2, // Proximity closer than anything else, before Parcel Audio
impl == NULL || impl->isMediaDisabled(),
- impl != NULL && !LLViewerParcelMedia::getURL().empty(),
+ impl != NULL && !LLViewerParcelMedia::getInstance()->getURL().empty(),
impl != NULL && impl->isMediaTimeBased() && impl->isMediaPlaying(),
MEDIA_CLASS_ALL,
"parcel media");
}
// Next Parcel Audio: add or remove it as necessary (don't show if disabled in prefs)
- if (should_include && LLViewerMedia::hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic"))
+ if (should_include && media_inst->hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic"))
{
// Yes, there is parcel audio.
if (NULL == mParcelAudioItem)
@@ -619,10 +620,10 @@ void LLPanelNearByMedia::refreshParcelItems()
// ... then update it
if (NULL != mParcelAudioItem)
{
- bool is_playing = LLViewerMedia::isParcelAudioPlaying();
+ bool is_playing = media_inst->isParcelAudioPlaying();
std::string url;
- url = LLViewerMedia::getParcelAudioURL();
+ url = media_inst->getParcelAudioURL();
updateListItem(mParcelAudioItem,
mParcelAudioName,
@@ -664,7 +665,8 @@ void LLPanelNearByMedia::refreshList()
refreshParcelItems();
// Get the canonical list from LLViewerMedia
- LLViewerMedia::impl_list impls = LLViewerMedia::getPriorityList();
+ LLViewerMedia* media_inst = LLViewerMedia::getInstance();
+ LLViewerMedia::impl_list impls = media_inst->getPriorityList();
LLViewerMedia::impl_list::iterator priority_iter;
U32 enabled_count = 0;
@@ -717,17 +719,17 @@ void LLPanelNearByMedia::refreshList()
}
mDisableAllCtrl->setEnabled((gSavedSettings.getBOOL("AudioStreamingMusic") ||
gSavedSettings.getBOOL("AudioStreamingMedia")) &&
- (LLViewerMedia::isAnyMediaShowing() ||
- LLViewerMedia::isParcelMediaPlaying() ||
- LLViewerMedia::isParcelAudioPlaying()));
+ (media_inst->isAnyMediaShowing() ||
+ media_inst->isParcelMediaPlaying() ||
+ media_inst->isParcelAudioPlaying()));
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()) ||
+ (media_inst->hasParcelMedia() && ! media_inst->isParcelMediaPlaying()) ||
// parcel audio (if we have it, and it isn't playing, enable "start")
- (LLViewerMedia::hasParcelAudio() && ! LLViewerMedia::isParcelAudioPlaying())));
+ (media_inst->hasParcelAudio() && ! media_inst->isParcelAudioPlaying())));
// 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();
@@ -742,7 +744,7 @@ void LLPanelNearByMedia::refreshList()
if (row_id != PARCEL_MEDIA_LIST_ITEM_UUID &&
row_id != PARCEL_AUDIO_LIST_ITEM_UUID)
{
- LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id);
+ LLViewerMediaImpl* impl = media_inst->getMediaImplFromTextureID(row_id);
if(impl)
{
updateListItem(item, impl);
@@ -787,26 +789,26 @@ void LLPanelNearByMedia::updateColumns()
void LLPanelNearByMedia::onClickEnableAll()
{
- LLViewerMedia::setAllMediaEnabled(true);
+ LLViewerMedia::getInstance()->setAllMediaEnabled(true);
}
void LLPanelNearByMedia::onClickDisableAll()
{
- LLViewerMedia::setAllMediaEnabled(false);
+ LLViewerMedia::getInstance()->setAllMediaEnabled(false);
}
void LLPanelNearByMedia::onClickEnableParcelMedia()
{
- if ( ! LLViewerMedia::isParcelMediaPlaying() )
+ if ( ! LLViewerMedia::getInstance()->isParcelMediaPlaying() )
{
- LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+ LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel());
}
}
void LLPanelNearByMedia::onClickDisableParcelMedia()
{
// This actually unloads the impl, as opposed to "stop"ping the media
- LLViewerParcelMedia::stop();
+ LLViewerParcelMedia::getInstance()->stop();
}
void LLPanelNearByMedia::onCheckItem(LLUICtrl* ctrl, const LLUUID &row_id)
@@ -843,7 +845,7 @@ bool LLPanelNearByMedia::setDisabled(const LLUUID &row_id, bool disabled)
return true;
}
else {
- LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id);
+ LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(row_id);
if(impl)
{
impl->setDisabled(disabled, true);
@@ -864,22 +866,22 @@ void LLPanelNearByMedia::onZoomMedia(void* user_data)
void LLPanelNearByMedia::onClickParcelMediaPlay()
{
- LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+ LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel());
}
void LLPanelNearByMedia::onClickParcelMediaStop()
{
- if (LLViewerParcelMedia::getParcelMedia())
+ if (LLViewerParcelMedia::getInstance()->getParcelMedia())
{
// This stops the media playing, as opposed to unloading it like
// LLViewerParcelMedia::stop() does
- LLViewerParcelMedia::getParcelMedia()->stop();
+ LLViewerParcelMedia::getInstance()->getParcelMedia()->stop();
}
}
void LLPanelNearByMedia::onClickParcelMediaPause()
{
- LLViewerParcelMedia::pause();
+ LLViewerParcelMedia::getInstance()->pause();
}
void LLPanelNearByMedia::onClickParcelAudioPlay()
@@ -900,7 +902,7 @@ void LLPanelNearByMedia::onClickParcelAudioPlay()
}
else
{
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
+ LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getInstance()->getParcelAudioURL());
}
}
@@ -992,16 +994,17 @@ void LLPanelNearByMedia::onMoreLess()
void LLPanelNearByMedia::updateControls()
{
LLUUID selected_media_id = mMediaList->getValue().asUUID();
+ LLViewerMedia* media_inst = LLViewerMedia::getInstance();
if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID)
{
- if (!LLViewerMedia::hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic"))
+ if (!media_inst->getInstance()->hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic"))
{
// disable controls if audio streaming music is disabled from preference
showDisabledControls();
}
else {
- showTimeBasedControls(LLViewerMedia::isParcelAudioPlaying(),
+ showTimeBasedControls(media_inst->isParcelAudioPlaying(),
false, // include_zoom
false, // is_zoomed
gSavedSettings.getBOOL("MuteMusic"),
@@ -1010,13 +1013,13 @@ void LLPanelNearByMedia::updateControls()
}
else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID)
{
- if (!LLViewerMedia::hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia"))
+ if (!media_inst->hasParcelMedia() || !gSavedSettings.getBOOL("AudioStreamingMedia"))
{
// disable controls if audio streaming media is disabled from preference
showDisabledControls();
}
else {
- LLViewerMediaImpl* impl = LLViewerParcelMedia::getParcelMedia();
+ LLViewerMediaImpl* impl = LLViewerParcelMedia::getInstance()->getParcelMedia();
if (NULL == impl)
{
// Just means it hasn't started yet
@@ -1032,7 +1035,7 @@ void LLPanelNearByMedia::updateControls()
}
else {
// non-time-based parcel media
- showBasicControls(LLViewerMedia::isParcelMediaPlaying(),
+ showBasicControls(media_inst->isParcelMediaPlaying(),
false,
false,
impl->getVolume() == 0.0,
@@ -1041,7 +1044,7 @@ void LLPanelNearByMedia::updateControls()
}
}
else {
- LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
+ LLViewerMediaImpl* impl = media_inst->getMediaImplFromTextureID(selected_media_id);
if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia"))
{
@@ -1127,7 +1130,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay()
if (selected_media_id != PARCEL_AUDIO_LIST_ITEM_UUID)
{
LLViewerMediaImpl *impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ?
- ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
+ ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id);
if (NULL != impl)
{
if (impl->isMediaTimeBased() && impl->isMediaPaused())
@@ -1138,7 +1141,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay()
}
else if (impl->isParcelMedia())
{
- LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+ LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel());
}
}
}
@@ -1156,7 +1159,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPause()
onClickParcelMediaPause();
}
else {
- LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
+ LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id);
if (NULL != impl && impl->isMediaTimeBased() && impl->isMediaPlaying())
{
impl->pause();
@@ -1173,7 +1176,7 @@ void LLPanelNearByMedia::onClickSelectedMediaMute()
}
else {
LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ?
- ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
+ ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id);
if (NULL != impl)
{
F32 volume = impl->getVolume();
@@ -1204,7 +1207,7 @@ void LLPanelNearByMedia::onCommitSelectedMediaVolume()
}
else {
LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ?
- ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
+ ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id);
if (NULL != impl)
{
impl->setVolume(mVolumeSlider->getValueF32());