summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelnearbymedia.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-14 23:44:45 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-14 23:44:45 +0200
commit4dd3d230ec7a43845f1a72dfcc7152ab04550d8e (patch)
tree2f6f9feefa9bdd7dd6ee4595bf65ad1af038047e /indra/newview/llpanelnearbymedia.cpp
parentb1ceef6ea4abffdfb36844c3b8e469283edce229 (diff)
parent78bdf57ad6610b34389226bf941ba736ca0c2225 (diff)
Merged in lindenlab/viewer-release
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 f3a2ed9408..2dca55514d 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -543,9 +543,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)
@@ -566,7 +567,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;
@@ -575,20 +576,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)
@@ -608,10 +609,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,
@@ -653,7 +654,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;
@@ -706,17 +708,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();
@@ -731,7 +733,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);
@@ -776,26 +778,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)
@@ -832,7 +834,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);
@@ -853,22 +855,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()
@@ -889,7 +891,7 @@ void LLPanelNearByMedia::onClickParcelAudioPlay()
}
else
{
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
+ LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getInstance()->getParcelAudioURL());
}
}
@@ -981,16 +983,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"),
@@ -999,13 +1002,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
@@ -1021,7 +1024,7 @@ void LLPanelNearByMedia::updateControls()
}
else {
// non-time-based parcel media
- showBasicControls(LLViewerMedia::isParcelMediaPlaying(),
+ showBasicControls(media_inst->isParcelMediaPlaying(),
false,
false,
impl->getVolume() == 0.0,
@@ -1030,7 +1033,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"))
{
@@ -1116,7 +1119,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())
@@ -1127,7 +1130,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay()
}
else if (impl->isParcelMedia())
{
- LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+ LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel());
}
}
}
@@ -1145,7 +1148,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();
@@ -1162,7 +1165,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();
@@ -1193,7 +1196,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());