diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lloverlaybar.cpp | 60 |
1 files changed, 5 insertions, 55 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 14ae3ff..1b60eee 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp | |||
@@ -38,12 +38,12 @@ | |||
38 | #include "lloverlaybar.h" | 38 | #include "lloverlaybar.h" |
39 | 39 | ||
40 | #include "aoremotectrl.h" | 40 | #include "aoremotectrl.h" |
41 | #include "audioengine.h" | 41 | #include "llaudioengine.h" |
42 | #include "llrender.h" | 42 | #include "llrender.h" |
43 | #include "llagent.h" | 43 | #include "llagent.h" |
44 | #include "llbutton.h" | 44 | #include "llbutton.h" |
45 | #include "llchatbar.h" | 45 | #include "llchatbar.h" |
46 | #include "llfloaterchat.h" | 46 | //#include "llfloaterchat.h" |
47 | #include "llfocusmgr.h" | 47 | #include "llfocusmgr.h" |
48 | #include "llimview.h" | 48 | #include "llimview.h" |
49 | #include "llmediaremotectrl.h" | 49 | #include "llmediaremotectrl.h" |
@@ -63,7 +63,7 @@ | |||
63 | #include "llvoiceclient.h" | 63 | #include "llvoiceclient.h" |
64 | #include "llvoavatar.h" | 64 | #include "llvoavatar.h" |
65 | #include "llvoiceremotectrl.h" | 65 | #include "llvoiceremotectrl.h" |
66 | #include "llwebbrowserctrl.h" | 66 | #include "llmediactrl.h" |
67 | #include "llwindlightremotectrl.h" | 67 | #include "llwindlightremotectrl.h" |
68 | #include "llselectmgr.h" | 68 | #include "llselectmgr.h" |
69 | 69 | ||
@@ -75,59 +75,10 @@ LLOverlayBar *gOverlayBar = NULL; | |||
75 | 75 | ||
76 | extern S32 MENU_BAR_HEIGHT; | 76 | extern S32 MENU_BAR_HEIGHT; |
77 | 77 | ||
78 | |||
79 | class LLTitleObserver | ||
80 | : public LLMediaObserver | ||
81 | { | ||
82 | public: | ||
83 | void init(std::string url); | ||
84 | /*virtual*/ void onMediaTitleChange(const EventType& event_in); | ||
85 | private: | ||
86 | LLMediaBase* mMediaSource; | ||
87 | }; | ||
88 | |||
89 | static LLTitleObserver sTitleObserver; | ||
90 | |||
91 | static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote"); | ||
92 | |||
93 | void LLTitleObserver::init(std::string url) | ||
94 | { | ||
95 | |||
96 | if (!gAudiop) | ||
97 | { | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | mMediaSource = gAudiop->getStreamMedia(); // LLViewerMedia::getSource(); | ||
102 | |||
103 | if ( mMediaSource ) | ||
104 | { | ||
105 | mMediaSource->addObserver(this); | ||
106 | } | ||
107 | } | ||
108 | |||
109 | //virtual | ||
110 | void LLTitleObserver::onMediaTitleChange(const EventType& event_in) | ||
111 | { | ||
112 | if ( !gSavedSettings.getBOOL("ShowStreamTitle") ) | ||
113 | { | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | LLChat chat; | ||
118 | //TODO: set this in XUI | ||
119 | std::string playing_msg = "Playing: " + event_in.getStringValue(); | ||
120 | chat.mText = playing_msg; | ||
121 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
122 | } | ||
123 | |||
124 | |||
125 | // | 78 | // |
126 | // Functions | 79 | // Functions |
127 | // | 80 | // |
128 | 81 | ||
129 | |||
130 | |||
131 | void* LLOverlayBar::createMediaRemote(void* userdata) | 82 | void* LLOverlayBar::createMediaRemote(void* userdata) |
132 | { | 83 | { |
133 | LLOverlayBar *self = (LLOverlayBar*)userdata; | 84 | LLOverlayBar *self = (LLOverlayBar*)userdata; |
@@ -448,11 +399,11 @@ void LLOverlayBar::toggleMediaPlay(void*) | |||
448 | } | 399 | } |
449 | 400 | ||
450 | 401 | ||
451 | if (LLViewerMedia::isMediaPaused()) | 402 | if (LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PAUSED) |
452 | { | 403 | { |
453 | LLViewerParcelMedia::start(); | 404 | LLViewerParcelMedia::start(); |
454 | } | 405 | } |
455 | else if(LLViewerMedia::isMediaPlaying()) | 406 | else if(LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PLAYING) |
456 | { | 407 | { |
457 | LLViewerParcelMedia::pause(); | 408 | LLViewerParcelMedia::pause(); |
458 | } | 409 | } |
@@ -493,7 +444,6 @@ void LLOverlayBar::toggleMusicPlay(void*) | |||
493 | // if ( gAudiop->isInternetStreamPlaying() == 0 ) | 444 | // if ( gAudiop->isInternetStreamPlaying() == 0 ) |
494 | { | 445 | { |
495 | gAudiop->startInternetStream(parcel->getMusicURL()); | 446 | gAudiop->startInternetStream(parcel->getMusicURL()); |
496 | sTitleObserver.init(parcel->getMusicURL()); | ||
497 | } | 447 | } |
498 | } | 448 | } |
499 | } | 449 | } |