diff options
Diffstat (limited to 'linden/indra/newview/lloverlaybar.cpp')
-rw-r--r-- | linden/indra/newview/lloverlaybar.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 91a7375..e1aeeca 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" |
@@ -72,6 +73,53 @@ LLOverlayBar *gOverlayBar = NULL; | |||
72 | 73 | ||
73 | extern S32 MENU_BAR_HEIGHT; | 74 | extern S32 MENU_BAR_HEIGHT; |
74 | 75 | ||
76 | |||
77 | class LLTitleObserver | ||
78 | : public LLMediaObserver | ||
79 | { | ||
80 | public: | ||
81 | void init(std::string url); | ||
82 | /*virtual*/ void onMediaTitleChange(const EventType& event_in); | ||
83 | private: | ||
84 | LLMediaBase* mMediaSource; | ||
85 | }; | ||
86 | |||
87 | static LLTitleObserver sTitleObserver; | ||
88 | |||
89 | static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote"); | ||
90 | |||
91 | void LLTitleObserver::init(std::string url) | ||
92 | { | ||
93 | |||
94 | if (!gAudiop) | ||
95 | { | ||
96 | return; | ||
97 | } | ||
98 | |||
99 | mMediaSource = gAudiop->getStreamMedia(); // LLViewerMedia::getSource(); | ||
100 | |||
101 | if ( mMediaSource ) | ||
102 | { | ||
103 | mMediaSource->addObserver(this); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | //virtual | ||
108 | void LLTitleObserver::onMediaTitleChange(const EventType& event_in) | ||
109 | { | ||
110 | if ( !gSavedSettings.getBOOL("ShowStreamTitle") ) | ||
111 | { | ||
112 | return; | ||
113 | } | ||
114 | |||
115 | LLChat chat; | ||
116 | //TODO: set this in XUI | ||
117 | std::string playing_msg = "Playing: " + event_in.getStringValue(); | ||
118 | chat.mText = playing_msg; | ||
119 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
120 | } | ||
121 | |||
122 | |||
75 | // | 123 | // |
76 | // Functions | 124 | // Functions |
77 | // | 125 | // |
@@ -406,6 +454,7 @@ void LLOverlayBar::toggleMusicPlay(void*) | |||
406 | // if ( gAudiop->isInternetStreamPlaying() == 0 ) | 454 | // if ( gAudiop->isInternetStreamPlaying() == 0 ) |
407 | { | 455 | { |
408 | gAudiop->startInternetStream(parcel->getMusicURL()); | 456 | gAudiop->startInternetStream(parcel->getMusicURL()); |
457 | sTitleObserver.init(parcel->getMusicURL()); | ||
409 | } | 458 | } |
410 | } | 459 | } |
411 | } | 460 | } |