aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lloverlaybar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lloverlaybar.cpp')
-rw-r--r--linden/indra/newview/lloverlaybar.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index 12c001e..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"
@@ -73,6 +74,53 @@ LLOverlayBar *gOverlayBar = NULL;
73 74
74extern S32 MENU_BAR_HEIGHT; 75extern S32 MENU_BAR_HEIGHT;
75 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
76// 124//
77// Functions 125// Functions
78// 126//
@@ -429,6 +477,7 @@ void LLOverlayBar::toggleMusicPlay(void*)
429 // if ( gAudiop->isInternetStreamPlaying() == 0 ) 477 // if ( gAudiop->isInternetStreamPlaying() == 0 )
430 { 478 {
431 gAudiop->startInternetStream(parcel->getMusicURL()); 479 gAudiop->startInternetStream(parcel->getMusicURL());
480 sTitleObserver.init(parcel->getMusicURL());
432 } 481 }
433 } 482 }
434 } 483 }