summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelnearbymedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelnearbymedia.cpp')
-rw-r--r--indra/newview/llpanelnearbymedia.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index f3a2ed9408..a85e9e3882 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)
@@ -588,7 +589,7 @@ void LLPanelNearByMedia::refreshParcelItems()
}
// 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,17 +778,17 @@ 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());
}
@@ -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);
@@ -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,7 +1002,7 @@ 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();
@@ -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::getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id);
if (NULL != impl)
{
if (impl->isMediaTimeBased() && impl->isMediaPaused())
@@ -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::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::getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id);
if (NULL != impl)
{
impl->setVolume(mVolumeSlider->getValueF32());