diff options
author | McCabe Maxsted | 2009-09-17 00:52:17 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-17 00:52:17 -0700 |
commit | f4c717d32135460f0fe07a77643f974dcc4f143d (patch) | |
tree | c49d4d68be0fa815589a0e2ed4c07466c638cce4 /linden/indra | |
parent | Applied patch by Aleric Inglewood for VWR-13996 - avatars using 1.22 complete... (diff) | |
parent | Fixed stream info not updating (diff) | |
download | meta-impy-f4c717d32135460f0fe07a77643f974dcc4f143d.zip meta-impy-f4c717d32135460f0fe07a77643f974dcc4f143d.tar.gz meta-impy-f4c717d32135460f0fe07a77643f974dcc4f143d.tar.bz2 meta-impy-f4c717d32135460f0fe07a77643f974dcc4f143d.tar.xz |
Merge branch '1.2.0-streaminfo' into 1.2.0-next
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/llaudio/audioengine.h | 2 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 39 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 1 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaobserver.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/lloverlaybar.cpp | 49 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml | 6 |
7 files changed, 95 insertions, 14 deletions
diff --git a/linden/indra/llaudio/audioengine.h b/linden/indra/llaudio/audioengine.h index d289ba5..579f58f 100644 --- a/linden/indra/llaudio/audioengine.h +++ b/linden/indra/llaudio/audioengine.h | |||
@@ -182,6 +182,8 @@ public: | |||
182 | static void assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status); | 182 | static void assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status); |
183 | 183 | ||
184 | friend class LLPipeline; // For debugging | 184 | friend class LLPipeline; // For debugging |
185 | |||
186 | LLMediaBase * getStreamMedia() { return mInternetStreamMedia; } | ||
185 | public: | 187 | public: |
186 | F32 mMaxWindGain; // Hack. Public to set before fade in? | 188 | F32 mMaxWindGain; // Hack. Public to set before fade in? |
187 | 189 | ||
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index d1bab29..a9e0004 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -89,6 +89,7 @@ LLMediaImplGStreamer () : | |||
89 | mPump ( NULL ), | 89 | mPump ( NULL ), |
90 | mPlaybin ( NULL ), | 90 | mPlaybin ( NULL ), |
91 | mVideoSink ( NULL ), | 91 | mVideoSink ( NULL ), |
92 | mLastTitle ( "" ), | ||
92 | mState( GST_STATE_NULL ), | 93 | mState( GST_STATE_NULL ), |
93 | mPlayThread ( NULL ) | 94 | mPlayThread ( NULL ) |
94 | { | 95 | { |
@@ -470,6 +471,8 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
470 | case GST_STATE_PAUSED: | 471 | case GST_STATE_PAUSED: |
471 | break; | 472 | break; |
472 | case GST_STATE_PLAYING: | 473 | case GST_STATE_PLAYING: |
474 | //impl->mLastTitle = ""; | ||
475 | |||
473 | LLMediaEvent event( impl, 100 ); | 476 | LLMediaEvent event( impl, 100 ); |
474 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | 477 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); |
475 | // emit an event to say that a media source was loaded | 478 | // emit an event to say that a media source was loaded |
@@ -521,18 +524,28 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
521 | } | 524 | } |
522 | case GST_MESSAGE_TAG: | 525 | case GST_MESSAGE_TAG: |
523 | { | 526 | { |
524 | GstTagList *tag_list; | 527 | GstTagList *new_tags; |
525 | gchar *title; | 528 | |
526 | gchar *artist; | 529 | gst_message_parse_tag( message, &new_tags ); |
527 | gst_message_parse_tag(message, &tag_list); | 530 | |
528 | gboolean hazTitle = gst_tag_list_get_string(tag_list, | 531 | gchar *title; |
529 | GST_TAG_TITLE, &title); | 532 | |
530 | gboolean hazArtist = gst_tag_list_get_string(tag_list, | 533 | if ( gst_tag_list_get_string(new_tags, GST_TAG_TITLE, &title) ) |
531 | GST_TAG_ARTIST, &artist); | 534 | { |
532 | if(hazTitle) | 535 | LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; |
533 | LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; | 536 | std::string newtitle(title); |
534 | if(hazArtist) | 537 | gst_tag_list_free(new_tags); |
535 | LL_INFOS("MediaInfo") << "Artist: " << artist << LL_ENDL; | 538 | |
539 | if ( newtitle != impl->mLastTitle && newtitle != "" ) | ||
540 | { | ||
541 | impl->mLastTitle = newtitle; | ||
542 | LLMediaEvent event( impl, impl->mLastTitle ); | ||
543 | impl->getEventEmitter().update( &LLMediaObserver::onMediaTitleChange, event ); | ||
544 | } | ||
545 | |||
546 | g_free(title); | ||
547 | } | ||
548 | |||
536 | break; | 549 | break; |
537 | } | 550 | } |
538 | case GST_MESSAGE_EOS: | 551 | case GST_MESSAGE_EOS: |
@@ -551,10 +564,10 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
551 | impl->addCommand(LLMediaBase::COMMAND_STOP); | 564 | impl->addCommand(LLMediaBase::COMMAND_STOP); |
552 | } | 565 | } |
553 | break; | 566 | break; |
567 | } | ||
554 | default: | 568 | default: |
555 | /* unhandled message */ | 569 | /* unhandled message */ |
556 | break; | 570 | break; |
557 | } | ||
558 | } | 571 | } |
559 | /* we want to be notified again the next time there is a message | 572 | /* we want to be notified again the next time there is a message |
560 | * on the bus, so return true (false means we want to stop watching | 573 | * on the bus, so return true (false means we want to stop watching |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index baefdaf..51a8c37 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -127,6 +127,7 @@ class LLMediaImplGStreamer: | |||
127 | GMainLoop *mPump; // event pump for this media | 127 | GMainLoop *mPump; // event pump for this media |
128 | GstElement *mPlaybin; | 128 | GstElement *mPlaybin; |
129 | GstSLVideo *mVideoSink; | 129 | GstSLVideo *mVideoSink; |
130 | std::string mLastTitle; | ||
130 | GstState mState; | 131 | GstState mState; |
131 | GstState getState() const { return mState; } | 132 | GstState getState() const { return mState; } |
132 | 133 | ||
diff --git a/linden/indra/llmedia/llmediaobserver.h b/linden/indra/llmedia/llmediaobserver.h index e6da4f6..97fed5f 100644 --- a/linden/indra/llmedia/llmediaobserver.h +++ b/linden/indra/llmedia/llmediaobserver.h | |||
@@ -102,6 +102,7 @@ class LLMediaObserver | |||
102 | virtual void onMediaSizeChange( const EventType& event_in ) { } | 102 | virtual void onMediaSizeChange( const EventType& event_in ) { } |
103 | virtual void onMediaContentsChange( const EventType& event_in ) { } | 103 | virtual void onMediaContentsChange( const EventType& event_in ) { } |
104 | virtual void onMediaStatusTextChange( const EventType& event_in ) { } | 104 | virtual void onMediaStatusTextChange( const EventType& event_in ) { } |
105 | virtual void onMediaTitleChange( const EventType &event_in ) { } | ||
105 | virtual void onNavigateBegin( const EventType& event_in ) { } | 106 | virtual void onNavigateBegin( const EventType& event_in ) { } |
106 | virtual void onNavigateComplete( const EventType& event_in ) { } | 107 | virtual void onNavigateComplete( const EventType& event_in ) { } |
107 | virtual void onUpdateProgress( const EventType& event_in ) { } | 108 | virtual void onUpdateProgress( const EventType& event_in ) { } |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 6d2f0c5..f92b47f 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -7524,6 +7524,17 @@ | |||
7524 | <key>Value</key> | 7524 | <key>Value</key> |
7525 | <integer>0</integer> | 7525 | <integer>0</integer> |
7526 | </map> | 7526 | </map> |
7527 | <key>ShowStreamTitle</key> | ||
7528 | <map> | ||
7529 | <key>Comment</key> | ||
7530 | <string>Show the title of the song playing on the parcel's stream</string> | ||
7531 | <key>Persist</key> | ||
7532 | <integer>1</integer> | ||
7533 | <key>Type</key> | ||
7534 | <string>Boolean</string> | ||
7535 | <key>Value</key> | ||
7536 | <integer>1</integer> | ||
7537 | </map> | ||
7527 | <key>ShowTangentBasis</key> | 7538 | <key>ShowTangentBasis</key> |
7528 | <map> | 7539 | <map> |
7529 | <key>Comment</key> | 7540 | <key>Comment</key> |
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 | ||
74 | extern S32 MENU_BAR_HEIGHT; | 75 | extern S32 MENU_BAR_HEIGHT; |
75 | 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 | |||
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 | } |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml index 92978ab..c960d36 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml | |||
@@ -15,7 +15,7 @@ | |||
15 | Streaming Preferences: | 15 | Streaming Preferences: |
16 | </text> | 16 | </text> |
17 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 17 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
18 | bottom="-280" drop_shadow_visible="true" enabled="true" follows="left|top" | 18 | bottom="-300" drop_shadow_visible="true" enabled="true" follows="left|top" |
19 | font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" | 19 | font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" |
20 | mouse_opaque="true" name="audio_prefs_text" v_pad="0" width="128"> | 20 | mouse_opaque="true" name="audio_prefs_text" v_pad="0" width="128"> |
21 | Audio Preferences: | 21 | Audio Preferences: |
@@ -28,6 +28,10 @@ | |||
28 | label="Play Streaming Music When Available (uses more bandwidth)" | 28 | label="Play Streaming Music When Available (uses more bandwidth)" |
29 | left="142" mouse_opaque="true" name="streaming_music" radio_style="false" | 29 | left="142" mouse_opaque="true" name="streaming_music" radio_style="false" |
30 | width="339" /> | 30 | width="339" /> |
31 | <check_box bottom_delta="-20" control_name="ShowStreamTitle" enabled="true" | ||
32 | follows="left|top" font="SansSerifSmall" height="16" initial_value="true" | ||
33 | label="Show stream info in chat" left="162" mouse_opaque="true" | ||
34 | name="show_stream_title" radio_style="false" width="338" /> | ||
31 | <check_box bottom_delta="-20" control_name="AudioStreamingVideo" enabled="true" | 35 | <check_box bottom_delta="-20" control_name="AudioStreamingVideo" enabled="true" |
32 | follows="left|top" font="SansSerifSmall" height="16" initial_value="true" | 36 | follows="left|top" font="SansSerifSmall" height="16" initial_value="true" |
33 | label="Play Streaming Media When Available (uses more bandwidth)" | 37 | label="Play Streaming Media When Available (uses more bandwidth)" |