home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
ProcessPlugin - which song is playing in MyMusic?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="samuel337" data-source="post: 6893" data-attributes="member: 10347"><p>I just finished programming the Party Shuffle function a few weeks ago, so I can give you some code to help you along:</p><p></p><p>Firstly, as you did, register yourself for the event notifications like so:</p><p>[code]</p><p>GUIWindowManager.Receivers += new SendMessageHandler(this.OnThreadMessage);[/code]</p><p></p><p>Now write some code to handle that event notification (note that if you change the name of this method, you will have to change the above code as well to this.thenewname) :</p><p>[code]</p><p> void OnThreadMessage(GUIMessage message)</p><p> {</p><p> switch (message.Message)</p><p> {</p><p> case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED:</p><p> PlayList pl = PlayListPlayer.GetPlaylist(PlayListPlayer.CurrentPlaylist);</p><p> /*Now using pl[PlayListPlayer.CurrentSong] you can get the Description, Duration and FileName of the current song so you can pass it off to your VFD etc. If you want to get the song's album or artist information, you'll have to look it up from the database, using the filename as the search string. */</p><p> } </p><p> break;</p><p> }</p><p> }</p><p>[/code]</p><p></p><p>Hope this helps - reply to this topic if you don't get some of the code, I think I know the playlist/music system fairly well...if not, there's always frodo to ask ;-)</p><p></p><p>Sam</p></blockquote><p></p>
[QUOTE="samuel337, post: 6893, member: 10347"] I just finished programming the Party Shuffle function a few weeks ago, so I can give you some code to help you along: Firstly, as you did, register yourself for the event notifications like so: [code] GUIWindowManager.Receivers += new SendMessageHandler(this.OnThreadMessage);[/code] Now write some code to handle that event notification (note that if you change the name of this method, you will have to change the above code as well to this.thenewname) : [code] void OnThreadMessage(GUIMessage message) { switch (message.Message) { case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: PlayList pl = PlayListPlayer.GetPlaylist(PlayListPlayer.CurrentPlaylist); /*Now using pl[PlayListPlayer.CurrentSong] you can get the Description, Duration and FileName of the current song so you can pass it off to your VFD etc. If you want to get the song's album or artist information, you'll have to look it up from the database, using the filename as the search string. */ } break; } } [/code] Hope this helps - reply to this topic if you don't get some of the code, I think I know the playlist/music system fairly well...if not, there's always frodo to ask ;-) Sam [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
ProcessPlugin - which song is playing in MyMusic?
Contact us
RSS
Top
Bottom