Catching MediaMonkey events in C#. Again.

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

Moderator: Gurus

VolkerK
Posts: 1
Joined: Tue Jan 12, 2010 6:23 pm

Catching MediaMonkey events in C#. Again.

Post by VolkerK » Tue Jan 12, 2010 6:50 pm

Hello all,

surfed this forum, but only found non-working examples (a lot) or confusing ones, which I cannot use to put my thing to work. I want to write a C# application and catch the events in media monkey, for example by code like this:

Code: Select all

    public partial class frmMain : Window
    {
        public SongsDB.SDBApplication mmapp;

        public frmMain()
        {
            InitializeComponent();

            mmapp = new SongsDB.SDBApplication();
            mmapp.ShutdownAfterDisconnect = false;

            mmapp.OnChangedSelection += new SongsDB.ISDBApplicationEvents_OnChangedSelectionEventHandler(mmapp_OnChangedSelection);
            mmapp.OnPlay += new SongsDB.ISDBApplicationEvents_OnPlayEventHandler(mmapp_OnPlay);
        }

        void mmapp_OnPlay()
        {
                // do something
        }

        void mmapp_OnChangedSelection()
        {
                // do something
        }
It works like this with other COM/ActiveX enabled applications I'm working with (e.g. Skype), but not in MM. What am I doing wrong? And questions to the MediaMonkey developers: what did they do differently that it is so easy in scripting host but so confusing in .NET? Could somebody rewrite me my example in a way which will work? Tested? (Or do I need the Gold version... :-) )

Regards
Volker

Melloware
Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US
Contact:

Re: Catching MediaMonkey events in C#. Again.

Post by Melloware » Wed Jan 13, 2010 1:15 pm

The only way I have seen it solved is in .NET by using a COM object and registering that COM object of your out of process app in MM itself.

See this thread:http://www.mediamonkey.com/forum/viewto ... nts#p69933

You can download and look at the MonkeyToys source code for a working example....

http://www.stax76.bplaced.net/index.php?slab=monkeytoys
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Post Reply