aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llmediaremotectrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llmediaremotectrl.cpp')
-rw-r--r--linden/indra/newview/llmediaremotectrl.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp
index 61c0042..448bc7f 100644
--- a/linden/indra/newview/llmediaremotectrl.cpp
+++ b/linden/indra/newview/llmediaremotectrl.cpp
@@ -40,7 +40,7 @@
40#include "llviewermedia.h" 40#include "llviewermedia.h"
41#include "llviewerparcelmedia.h" 41#include "llviewerparcelmedia.h"
42#include "llviewerparcelmgr.h" 42#include "llviewerparcelmgr.h"
43#include "llvieweruictrlfactory.h" 43#include "lluictrlfactory.h"
44#include "llpanelaudiovolume.h" 44#include "llpanelaudiovolume.h"
45#include "llparcel.h" 45#include "llparcel.h"
46#include "llviewercontrol.h" 46#include "llviewercontrol.h"
@@ -49,6 +49,9 @@
49//////////////////////////////////////////////////////////////////////////////// 49////////////////////////////////////////////////////////////////////////////////
50// 50//
51// 51//
52
53static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote");
54
52LLMediaRemoteCtrl::LLMediaRemoteCtrl() 55LLMediaRemoteCtrl::LLMediaRemoteCtrl()
53{ 56{
54 setIsChrome(TRUE); 57 setIsChrome(TRUE);
@@ -64,11 +67,11 @@ void LLMediaRemoteCtrl::build()
64 deleteAllChildren(); 67 deleteAllChildren();
65 if (gSavedSettings.getBOOL("ShowVolumeSettingsPopup")) 68 if (gSavedSettings.getBOOL("ShowVolumeSettingsPopup"))
66 { 69 {
67 gUICtrlFactory->buildPanel(this, "panel_media_remote_expanded.xml", &getFactoryMap()); 70 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_remote_expanded.xml", &getFactoryMap());
68 } 71 }
69 else 72 else
70 { 73 {
71 gUICtrlFactory->buildPanel(this, "panel_media_remote.xml", &getFactoryMap()); 74 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_remote.xml", &getFactoryMap());
72 } 75 }
73} 76}
74 77
@@ -92,7 +95,7 @@ void LLMediaRemoteCtrl::draw()
92{ 95{
93 enableMediaButtons(); 96 enableMediaButtons();
94 97
95 LLButton* expand_button = LLUICtrlFactory::getButtonByName(this, "expand"); 98 LLButton* expand_button = getChild<LLButton>("expand");
96 if (expand_button) 99 if (expand_button)
97 { 100 {
98 if (expand_button->getToggleState()) 101 if (expand_button->getToggleState())
@@ -155,7 +158,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
155 158
156 // Put this in xui file 159 // Put this in xui file
157 LLString media_url = mControls->getString("default_tooltip_label"); 160 LLString media_url = mControls->getString("default_tooltip_label");
158 LLParcel* parcel = gParcelMgr->getAgentParcel(); 161 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
159 162
160 if (gSavedSettings.getBOOL("AudioStreamingVideo")) 163 if (gSavedSettings.getBOOL("AudioStreamingVideo"))
161 { 164 {
@@ -222,14 +225,14 @@ void LLMediaRemoteCtrl::enableMediaButtons()
222 stop_media_enabled = false; 225 stop_media_enabled = false;
223 } 226 }
224 } 227 }
225 const LLUUID media_icon_id = LLUUID(gViewerArt.findString(LLMIMETypes::findIcon(media_type))); 228 const LLString media_icon_name = LLMIMETypes::findIcon(media_type);
226 LLButton* music_play_btn = LLUICtrlFactory::getButtonByName(this, "music_play"); 229 LLButton* music_play_btn = getChild<LLButton>("music_play");
227 LLButton* music_stop_btn = LLUICtrlFactory::getButtonByName(this, "music_stop"); 230 LLButton* music_stop_btn = getChild<LLButton>("music_stop");
228 LLButton* music_pause_btn = LLUICtrlFactory::getButtonByName(this, "music_pause"); 231 LLButton* music_pause_btn = getChild<LLButton>("music_pause");
229 LLButton* media_play_btn = LLUICtrlFactory::getButtonByName(this, "media_play"); 232 LLButton* media_play_btn = getChild<LLButton>("media_play");
230 LLButton* media_stop_btn = LLUICtrlFactory::getButtonByName(this, "media_stop"); 233 LLButton* media_stop_btn = getChild<LLButton>("media_stop");
231 LLButton* media_pause_btn = LLUICtrlFactory::getButtonByName(this, "media_pause"); 234 LLButton* media_pause_btn = getChild<LLButton>("media_pause");
232 LLIconCtrl* media_icon = LLUICtrlFactory::getIconByName(this, "media_icon"); 235 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon");
233 236
234 music_play_btn->setEnabled(play_music_enabled); 237 music_play_btn->setEnabled(play_music_enabled);
235 music_stop_btn->setEnabled(stop_music_enabled); 238 music_stop_btn->setEnabled(stop_music_enabled);
@@ -237,9 +240,9 @@ void LLMediaRemoteCtrl::enableMediaButtons()
237 music_pause_btn->setVisible(music_show_pause); 240 music_pause_btn->setVisible(music_show_pause);
238 music_play_btn->setVisible(! music_show_pause); 241 music_play_btn->setVisible(! music_show_pause);
239 childSetColor("music_icon", music_icon_color); 242 childSetColor("music_icon", music_icon_color);
240 if(! media_icon_id.isNull()) 243 if(!media_icon_name.empty())
241 { 244 {
242 media_icon->setImage(media_icon_id); 245 media_icon->setImage(media_icon_name);
243 } 246 }
244 247
245 media_play_btn->setEnabled(play_media_enabled); 248 media_play_btn->setEnabled(play_media_enabled);