diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index da9bcba..6fa77c3 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -267,13 +267,23 @@ int LLAudioEngine::isInternetStreamPlaying() return 0; // Stopped } -// virtual + +// virtual //aw is this of any use ? void LLAudioEngine::getInternetStreamInfo(char* artist, char* title) { - artist[0] = 0; - title[0] = 0; +// artist[0] = 0; +// title[0] = 0; + } +// virtual +char* LLAudioEngine::getInternetStreamInfoTitle() +{ + + if(mInternetStreamMedia) + return mInternetStreamMedia->getMetaInfoTitle(); + return NULL; +} // virtual void LLAudioEngine::setInternetStreamGain(F32 vol) { diff --git a/linden/indra/llaudio/audioengine.h b/linden/indra/llaudio/audioengine.h index 15cb35f..897a73b 100644 --- a/linden/indra/llaudio/audioengine.h +++ b/linden/indra/llaudio/audioengine.h @@ -157,6 +157,7 @@ public: virtual void updateInternetStream(); virtual int isInternetStreamPlaying(); virtual void getInternetStreamInfo(char* artist, char* title); + virtual char* getInternetStreamInfoTitle(); // use a value from 0.0 to 1.0, inclusive virtual void setInternetStreamGain(F32 vol); virtual const std::string& getInternetStreamURL(); diff --git a/linden/indra/llmedia/llmediabase.h b/linden/indra/llmedia/llmediabase.h index dad02ca..e3256d4 100644 --- a/linden/indra/llmedia/llmediabase.h +++ b/linden/indra/llmedia/llmediabase.h @@ -135,6 +135,7 @@ class LLMediaBase virtual bool setVolume( float volume ) = 0; virtual float getVolume() const = 0; + virtual char* getMetaInfoTitle() = 0; //////////////////////////////////////////////////////////////////////////////// // transport control etc. diff --git a/linden/indra/llmedia/llmediaimplcommon.cpp b/linden/indra/llmedia/llmediaimplcommon.cpp index abb61e1..ef6ad98 100644 --- a/linden/indra/llmedia/llmediaimplcommon.cpp +++ b/linden/indra/llmedia/llmediaimplcommon.cpp @@ -66,6 +66,7 @@ LLMediaImplCommon::LLMediaImplCommon() : mCommand( LLMediaBase::COMMAND_NONE ), mStatus( LLMediaBase::STATUS_UNKNOWN ), mVolume( 0 ), + mMetaInfoTitle( 0 ), mLooping( false ) { } @@ -300,6 +301,13 @@ float LLMediaImplCommon::getVolume() const //////////////////////////////////////////////////////////////////////////////// // virtual (derives from LLMediaBase) + +char* LLMediaImplCommon::getMetaInfoTitle() +{ + return mMetaInfoTitle; +} +//////////////////////////////////////////////////////////////////////////////// +// virtual (derives from LLMediaBase) bool LLMediaImplCommon::addCommand( LLMediaBase::ECommand cmd ) { // eventually will be a std::queue so you can add multiple commands diff --git a/linden/indra/llmedia/llmediaimplcommon.h b/linden/indra/llmedia/llmediaimplcommon.h index aa6c4d5..7611de1 100644 --- a/linden/indra/llmedia/llmediaimplcommon.h +++ b/linden/indra/llmedia/llmediaimplcommon.h @@ -82,6 +82,7 @@ class LLMediaImplCommon : // audio virtual bool setVolume( float volume ); virtual float getVolume() const; + virtual char* getMetaInfoTitle(); // transport control virtual bool addCommand( ECommand cmd ); @@ -153,6 +154,7 @@ class LLMediaImplCommon : int mMediaRequestedWidth; int mMediaRequestedHeight; float mVolume; + char* mMetaInfoTitle; LLMediaBase::ECommand mCommand; LLMediaBase::EStatus mStatus; bool mLooping; diff --git a/linden/indra/llmedia/llmediaimplexample1.h b/linden/indra/llmedia/llmediaimplexample1.h index b78a887..31b6549 100644 --- a/linden/indra/llmedia/llmediaimplexample1.h +++ b/linden/indra/llmedia/llmediaimplexample1.h @@ -54,7 +54,6 @@ class LLMediaImplExample1 : /* virtual */ bool reset(); /* virtual */ bool mouseMove( int x_pos, int y_pos ); /* virtual */ bool setRequestedMediaSize( int width, int height ); - private: unsigned char* mMediaPixels; }; diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 4d82be0..85859ce 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -347,7 +347,8 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp gboolean hazArtist = llgst_tag_list_get_string(tag_list, GST_TAG_ARTIST, &artist); if(hazTitle) - LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; + //LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; + impl->mMetaInfoTitle = (char*)title; if(hazArtist) LL_INFOS("MediaInfo") << "Artist: " << artist << LL_ENDL; break; diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 80cac14..58dc085 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -44,6 +44,7 @@ #include "llfocusmgr.h" #include "llimview.h" #include "llmediaremotectrl.h" +#include "llnotify.h" #include "llpanelaudiovolume.h" #include "llparcel.h" #include "lltextbox.h" @@ -102,7 +103,8 @@ LLOverlayBar::LLOverlayBar() : LLPanel(), mMediaRemote(NULL), mVoiceRemote(NULL), - mMusicState(STOPPED) + mMusicState(STOPPED), + mInternetStreamInfoTitle (0) { setMouseOpaque(FALSE); setIsChrome(TRUE); @@ -275,7 +277,15 @@ void LLOverlayBar::refresh() { layoutButtons(); } - + if ( gAudiop->getInternetStreamInfoTitle() != mInternetStreamInfoTitle ) + { + mInternetStreamInfoTitle=gAudiop->getInternetStreamInfoTitle(); + std::string title=(std::string)mInternetStreamInfoTitle; + LLStringUtil::format_map_t args; + llinfos << "Now Playing: " << title << llendl; + args["[TITLE]"] = title; + LLNotifyBox::showXml("MetaInfoTitle", args); + } } //----------------------------------------------------------------------- diff --git a/linden/indra/newview/lloverlaybar.h b/linden/indra/newview/lloverlaybar.h index 73d0a43..cc55a6a 100644 --- a/linden/indra/newview/lloverlaybar.h +++ b/linden/indra/newview/lloverlaybar.h @@ -98,6 +98,7 @@ protected: bool mBuilt; // dialog constructed yet? enum { STOPPED=0, PLAYING=1, PAUSED=2 }; S32 mMusicState; + char* mInternetStreamInfoTitle; }; extern LLOverlayBar* gOverlayBar; diff --git a/linden/indra/newview/skins/default/xui/en-us/notify.xml b/linden/indra/newview/skins/default/xui/en-us/notify.xml index d207a74..02694d3 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notify.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notify.xml @@ -40,6 +40,11 @@ You cannot add yourself as a friend. + + + Now playing: [TITLE] + + Uploading in-world and web site snapshots...