aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lloverlaybar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-09-23 02:29:44 -0500
committerJacek Antonelli2009-09-23 02:29:44 -0500
commitcd2b97b3e6446449443700ae9a1521c402c93850 (patch)
tree0c45e5a05cdcb6956fb859c9fef834a5c5613a04 /linden/indra/newview/lloverlaybar.cpp
parentCommented out Linux tarball building. (diff)
parentDisplay selected avatars larger than normal, zoom in at a reasonable speed. I... (diff)
downloadmeta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.zip
meta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.tar.gz
meta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.tar.bz2
meta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.tar.xz
Merge remote branch 'mccabe/1.2.0-next' into next
Conflicts: linden/indra/newview/llfloaterchat.cpp linden/indra/newview/llfloatermap.cpp linden/indra/newview/llinventorybridge.cpp linden/indra/newview/llnetmap.cpp linden/indra/newview/llviewermessage.cpp linden/indra/newview/llviewerobjectlist.cpp
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lloverlaybar.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index 91ac440..c1a2354 100644
--- a/linden/indra/newview/lloverlaybar.cpp
+++ b/linden/indra/newview/lloverlaybar.cpp
@@ -41,6 +41,7 @@
41#include "llagent.h" 41#include "llagent.h"
42#include "llbutton.h" 42#include "llbutton.h"
43#include "llchatbar.h" 43#include "llchatbar.h"
44#include "llfloaterchat.h"
44#include "llfocusmgr.h" 45#include "llfocusmgr.h"
45#include "llimview.h" 46#include "llimview.h"
46#include "llmediaremotectrl.h" 47#include "llmediaremotectrl.h"
@@ -62,6 +63,7 @@
62#include "llvoavatar.h" 63#include "llvoavatar.h"
63#include "llvoiceremotectrl.h" 64#include "llvoiceremotectrl.h"
64#include "llwebbrowserctrl.h" 65#include "llwebbrowserctrl.h"
66#include "llwindlightremotectrl.h"
65#include "llselectmgr.h" 67#include "llselectmgr.h"
66 68
67// 69//
@@ -72,6 +74,53 @@ LLOverlayBar *gOverlayBar = NULL;
72 74
73extern S32 MENU_BAR_HEIGHT; 75extern S32 MENU_BAR_HEIGHT;
74 76
77
78class LLTitleObserver
79 : public LLMediaObserver
80{
81public:
82 void init(std::string url);
83 /*virtual*/ void onMediaTitleChange(const EventType& event_in);
84private:
85 LLMediaBase* mMediaSource;
86};
87
88static LLTitleObserver sTitleObserver;
89
90static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote");
91
92void LLTitleObserver::init(std::string url)
93{
94
95 if (!gAudiop)
96 {
97 return;
98 }
99
100 mMediaSource = gAudiop->getStreamMedia(); // LLViewerMedia::getSource();
101
102 if ( mMediaSource )
103 {
104 mMediaSource->addObserver(this);
105 }
106}
107
108//virtual
109void LLTitleObserver::onMediaTitleChange(const EventType& event_in)
110{
111 if ( !gSavedSettings.getBOOL("ShowStreamTitle") )
112 {
113 return;
114 }
115
116 LLChat chat;
117 //TODO: set this in XUI
118 std::string playing_msg = "Playing: " + event_in.getStringValue();
119 chat.mText = playing_msg;
120 LLFloaterChat::addChat(chat, FALSE, FALSE);
121}
122
123
75// 124//
76// Functions 125// Functions
77// 126//
@@ -92,6 +141,13 @@ void* LLOverlayBar::createVoiceRemote(void* userdata)
92 return self->mVoiceRemote; 141 return self->mVoiceRemote;
93} 142}
94 143
144void* LLOverlayBar::createWindlightRemote(void* userdata)
145{
146 LLOverlayBar *self = (LLOverlayBar*)userdata;
147 self->mWindlightRemote = new LLWindlightRemoteCtrl();
148 return self->mWindlightRemote;
149}
150
95void* LLOverlayBar::createChatBar(void* userdata) 151void* LLOverlayBar::createChatBar(void* userdata)
96{ 152{
97 gChatBar = new LLChatBar(); 153 gChatBar = new LLChatBar();
@@ -102,6 +158,7 @@ LLOverlayBar::LLOverlayBar()
102 : LLPanel(), 158 : LLPanel(),
103 mMediaRemote(NULL), 159 mMediaRemote(NULL),
104 mVoiceRemote(NULL), 160 mVoiceRemote(NULL),
161 mWindlightRemote(NULL),
105 mMusicState(STOPPED), 162 mMusicState(STOPPED),
106 mOriginalIMLabel("") 163 mOriginalIMLabel("")
107{ 164{
@@ -113,6 +170,7 @@ LLOverlayBar::LLOverlayBar()
113 LLCallbackMap::map_t factory_map; 170 LLCallbackMap::map_t factory_map;
114 factory_map["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this); 171 factory_map["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this);
115 factory_map["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); 172 factory_map["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this);
173 factory_map["windlight_remote"] = LLCallbackMap(LLOverlayBar::createWindlightRemote, this);
116 factory_map["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this); 174 factory_map["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this);
117 175
118 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map); 176 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map);
@@ -272,6 +330,7 @@ void LLOverlayBar::refresh()
272 } 330 }
273 331
274 332
333 moveChildToBackOfTabGroup(mWindlightRemote);
275 moveChildToBackOfTabGroup(mMediaRemote); 334 moveChildToBackOfTabGroup(mMediaRemote);
276 moveChildToBackOfTabGroup(mVoiceRemote); 335 moveChildToBackOfTabGroup(mVoiceRemote);
277 336
@@ -280,6 +339,7 @@ void LLOverlayBar::refresh()
280 { 339 {
281 childSetVisible("media_remote_container", FALSE); 340 childSetVisible("media_remote_container", FALSE);
282 childSetVisible("voice_remote_container", FALSE); 341 childSetVisible("voice_remote_container", FALSE);
342 childSetVisible("windlight_remote_container", FALSE);
283 childSetVisible("state_buttons", FALSE); 343 childSetVisible("state_buttons", FALSE);
284 } 344 }
285 else 345 else
@@ -287,6 +347,7 @@ void LLOverlayBar::refresh()
287 // update "remotes" 347 // update "remotes"
288 childSetVisible("media_remote_container", TRUE); 348 childSetVisible("media_remote_container", TRUE);
289 childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); 349 childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled());
350 childSetVisible("windlight_remote_container", gSavedSettings.getBOOL("EnableWindlightRemote"));
290 childSetVisible("state_buttons", TRUE); 351 childSetVisible("state_buttons", TRUE);
291 } 352 }
292 353
@@ -416,6 +477,7 @@ void LLOverlayBar::toggleMusicPlay(void*)
416 // if ( gAudiop->isInternetStreamPlaying() == 0 ) 477 // if ( gAudiop->isInternetStreamPlaying() == 0 )
417 { 478 {
418 gAudiop->startInternetStream(parcel->getMusicURL()); 479 gAudiop->startInternetStream(parcel->getMusicURL());
480 sTitleObserver.init(parcel->getMusicURL());
419 } 481 }
420 } 482 }
421 } 483 }