Mediamonkey Events C#

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

Pater
Posts: 15
Joined: Fri Jun 03, 2011 12:45 pm

Mediamonkey Events C#

Post by Pater »

Hi

I try to get events working with MM4 and C#... the code i use does not give any errors, however the events aren't firing:

Code: Select all

private static void registerEvents()
{
     SDB.OnPlay += new SongsDB.ISDBApplicationEvents_OnPlayEventHandler(SDB_OnPlay);
}

/// <summary>
/// MediaMonkey Event Handelers
/// </summary>

static void SDB_OnPlay() {
   var r = new Response { Type = ResponseType.UIUpdate, Data="onPlay" };
   Broadcast(JsonConvert.SerializeObject(r));
   Console.WriteLine("test");
}
Can anyone tell me how to implement the events the right way???
Pater
Posts: 15
Joined: Fri Jun 03, 2011 12:45 pm

Re: Mediamonkey Events C#

Post by Pater »

Never mind: the code above is correct. However: i tested it by pausing and resuming, which are obviously other event ;)
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Mediamonkey Events C#

Post by trixmoto »

Yes, the OnPlay event is fired when a new track is added to the player (when it first starts to play) but not when resuming from pause. I'm not sure if there is an event for that.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Post Reply