summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelnearbymedia.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-02-03 15:18:34 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-02-03 15:18:34 +0200
commite0727702ea00c975361cf94b4d2903a9fec6f6f8 (patch)
treed64f1cf4ebf58a08fb7fc197206ce31fab2aa115 /indra/newview/llpanelnearbymedia.cpp
parentc5195905b8c9b30a2b3aab652aa9828e9825c42f (diff)
parente58b5263598368b6dec4a836c72c69b50d701911 (diff)
Merge branch 'DRTVWR-501' into trunk
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());