diff options
Diffstat (limited to 'linden/indra/newview/lloverlaybar.cpp')
-rw-r--r-- | linden/indra/newview/lloverlaybar.cpp | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 91a7375..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 | ||
73 | extern S32 MENU_BAR_HEIGHT; | 75 | extern S32 MENU_BAR_HEIGHT; |
74 | 76 | ||
77 | |||
78 | class LLTitleObserver | ||
79 | : public LLMediaObserver | ||
80 | { | ||
81 | public: | ||
82 | void init(std::string url); | ||
83 | /*virtual*/ void onMediaTitleChange(const EventType& event_in); | ||
84 | private: | ||
85 | LLMediaBase* mMediaSource; | ||
86 | }; | ||
87 | |||
88 | static LLTitleObserver sTitleObserver; | ||
89 | |||
90 | static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote"); | ||
91 | |||
92 | void 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 | ||
109 | void 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 | ||
144 | void* LLOverlayBar::createWindlightRemote(void* userdata) | ||
145 | { | ||
146 | LLOverlayBar *self = (LLOverlayBar*)userdata; | ||
147 | self->mWindlightRemote = new LLWindlightRemoteCtrl(); | ||
148 | return self->mWindlightRemote; | ||
149 | } | ||
150 | |||
95 | void* LLOverlayBar::createChatBar(void* userdata) | 151 | void* 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); |
@@ -256,7 +314,10 @@ void LLOverlayBar::refresh() | |||
256 | BOOL sitting = FALSE; | 314 | BOOL sitting = FALSE; |
257 | if (gAgent.getAvatarObject()) | 315 | if (gAgent.getAvatarObject()) |
258 | { | 316 | { |
259 | sitting = gAgent.getAvatarObject()->mIsSitting; | 317 | // sitting = gAgent.getAvatarObject()->mIsSitting; |
318 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
319 | sitting = gAgent.getAvatarObject()->mIsSitting && !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); | ||
320 | // [/RLVa:KB] | ||
260 | } | 321 | } |
261 | button = getChild<LLButton>("Stand Up"); | 322 | button = getChild<LLButton>("Stand Up"); |
262 | 323 | ||
@@ -269,6 +330,7 @@ void LLOverlayBar::refresh() | |||
269 | } | 330 | } |
270 | 331 | ||
271 | 332 | ||
333 | moveChildToBackOfTabGroup(mWindlightRemote); | ||
272 | moveChildToBackOfTabGroup(mMediaRemote); | 334 | moveChildToBackOfTabGroup(mMediaRemote); |
273 | moveChildToBackOfTabGroup(mVoiceRemote); | 335 | moveChildToBackOfTabGroup(mVoiceRemote); |
274 | 336 | ||
@@ -277,6 +339,7 @@ void LLOverlayBar::refresh() | |||
277 | { | 339 | { |
278 | childSetVisible("media_remote_container", FALSE); | 340 | childSetVisible("media_remote_container", FALSE); |
279 | childSetVisible("voice_remote_container", FALSE); | 341 | childSetVisible("voice_remote_container", FALSE); |
342 | childSetVisible("windlight_remote_container", FALSE); | ||
280 | childSetVisible("state_buttons", FALSE); | 343 | childSetVisible("state_buttons", FALSE); |
281 | } | 344 | } |
282 | else | 345 | else |
@@ -284,6 +347,7 @@ void LLOverlayBar::refresh() | |||
284 | // update "remotes" | 347 | // update "remotes" |
285 | childSetVisible("media_remote_container", TRUE); | 348 | childSetVisible("media_remote_container", TRUE); |
286 | childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); | 349 | childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); |
350 | childSetVisible("windlight_remote_container", gSavedSettings.getBOOL("EnableWindlightRemote")); | ||
287 | childSetVisible("state_buttons", TRUE); | 351 | childSetVisible("state_buttons", TRUE); |
288 | } | 352 | } |
289 | 353 | ||
@@ -336,6 +400,13 @@ void LLOverlayBar::onClickMouselook(void*) | |||
336 | //static | 400 | //static |
337 | void LLOverlayBar::onClickStandUp(void*) | 401 | void LLOverlayBar::onClickStandUp(void*) |
338 | { | 402 | { |
403 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
404 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting) ) | ||
405 | { | ||
406 | return; | ||
407 | } | ||
408 | // [/RLVa:KB] | ||
409 | |||
339 | LLSelectMgr::getInstance()->deselectAllForStandingUp(); | 410 | LLSelectMgr::getInstance()->deselectAllForStandingUp(); |
340 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 411 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
341 | } | 412 | } |
@@ -406,6 +477,7 @@ void LLOverlayBar::toggleMusicPlay(void*) | |||
406 | // if ( gAudiop->isInternetStreamPlaying() == 0 ) | 477 | // if ( gAudiop->isInternetStreamPlaying() == 0 ) |
407 | { | 478 | { |
408 | gAudiop->startInternetStream(parcel->getMusicURL()); | 479 | gAudiop->startInternetStream(parcel->getMusicURL()); |
480 | sTitleObserver.init(parcel->getMusicURL()); | ||
409 | } | 481 | } |
410 | } | 482 | } |
411 | } | 483 | } |