From 96741727e0d1dbb743fe9dcfff68d52b12617136 Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Mon, 15 Jun 2009 03:00:48 -0700
Subject: Applied Dale Glass' patch for VWR-12655: Add support for displaying
the title of the song
---
linden/indra/llaudio/audioengine.h | 2 +
linden/indra/llmedia/llmediaimplgstreamer.cpp | 46 ++++++++++++++------
linden/indra/llmedia/llmediaimplgstreamer.h | 1 +
linden/indra/llmedia/llmediaobserver.h | 1 +
linden/indra/newview/app_settings/settings.xml | 11 +++++
linden/indra/newview/lloverlaybar.cpp | 49 ++++++++++++++++++++++
.../default/xui/en-us/panel_preferences_audio.xml | 6 ++-
7 files changed, 102 insertions(+), 14 deletions(-)
(limited to 'linden/indra')
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:
static void assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status);
friend class LLPipeline; // For debugging
+
+ LLMediaBase * getStreamMedia() { return mInternetStreamMedia; }
public:
F32 mMaxWindGain; // Hack. Public to set before fade in?
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index d1bab29..c0c2070 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -89,6 +89,7 @@ LLMediaImplGStreamer () :
mPump ( NULL ),
mPlaybin ( NULL ),
mVideoSink ( NULL ),
+ mLastTitle ( "" ),
mState( GST_STATE_NULL ),
mPlayThread ( NULL )
{
@@ -470,6 +471,8 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
case GST_STATE_PAUSED:
break;
case GST_STATE_PLAYING:
+ impl->mLastTitle = "";
+
LLMediaEvent event( impl, 100 );
impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event );
// emit an event to say that a media source was loaded
@@ -521,18 +524,35 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
}
case GST_MESSAGE_TAG:
{
- GstTagList *tag_list;
- gchar *title;
- gchar *artist;
- gst_message_parse_tag(message, &tag_list);
- gboolean hazTitle = gst_tag_list_get_string(tag_list,
- GST_TAG_TITLE, &title);
- gboolean hazArtist = gst_tag_list_get_string(tag_list,
- GST_TAG_ARTIST, &artist);
- if(hazTitle)
- LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL;
- if(hazArtist)
- LL_INFOS("MediaInfo") << "Artist: " << artist << LL_ENDL;
+ GstTagList *new_tags;
+
+ gst_message_parse_tag( message, &new_tags );
+
+ gchar *title;
+ gchar *artist;
+
+ if ( gst_tag_list_get_string(new_tags, GST_TAG_TITLE, &title) )
+ {
+ LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL;
+ std::string newtitle(title);
+
+ if ( newtitle != impl->mLastTitle && newtitle != "" )
+ {
+ impl->mLastTitle = newtitle;
+ LLMediaEvent event( impl, impl->mLastTitle );
+ impl->getEventEmitter().update( &LLMediaObserver::onMediaTitleChange, event );
+ }
+
+ g_free(title);
+ }
+
+ if (gst_tag_list_get_string(new_tags, GST_TAG_ARTIST, &artist))
+ {
+ LL_INFOS("MediaInfo") << "Artist: " << artist << LL_ENDL;
+ g_free(artist);
+ }
+
+ gst_tag_list_free(new_tags);
break;
}
case GST_MESSAGE_EOS:
@@ -551,10 +571,10 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
impl->addCommand(LLMediaBase::COMMAND_STOP);
}
break;
+ }
default:
/* unhandled message */
break;
- }
}
/* we want to be notified again the next time there is a message
* 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:
GMainLoop *mPump; // event pump for this media
GstElement *mPlaybin;
GstSLVideo *mVideoSink;
+ std::string mLastTitle;
GstState mState;
GstState getState() const { return mState; }
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
virtual void onMediaSizeChange( const EventType& event_in ) { }
virtual void onMediaContentsChange( const EventType& event_in ) { }
virtual void onMediaStatusTextChange( const EventType& event_in ) { }
+ virtual void onMediaTitleChange( const EventType &event_in ) { }
virtual void onNavigateBegin( const EventType& event_in ) { }
virtual void onNavigateComplete( const EventType& event_in ) { }
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 5c76185..7ab215a 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -7337,6 +7337,17 @@
Value
0
+ ShowStreamTitle
+
ShowTangentBasis