INTERACT FORUM

Windows => Plug-in Development => Topic started by: Craig on July 28, 2006, 09:05:18 am

Title: Plugins and Delphi
Post by: Craig on July 28, 2006, 09:05:18 am
Hi,

Is it possible to write a plugin using delphi? and if so is there any guide anywhere?

Thanks
Craig
Title: Re: Plugins and Delphi
Post by: Mr ChriZ on July 29, 2006, 03:02:42 pm
Hi,

Is it possible to write a plugin using delphi? and if so is there any guide anywhere?

Thanks
Craig

I think theoretically yes, because Delphi can work with the COM,
I don't think anyones written a guide as such for Delphi yet..
I'm only going from memory tho, may be worth having a search around.

I think a few people have tried it before and got it working,
but no write ups.
If you do crack it let us know, and even better tell us what you've done, and
how you did it! =)

I've written a couple of tutorials on how to get up and
running using .NET.
JRiver SDK shows some VB6 stuff,
and theres also a C++ Tutorial floating around.
As far as I can see Delphi's not been covered yet.
Title: Re: Plugins and Delphi
Post by: Craig on July 31, 2006, 04:11:02 am
Thanks,

I'll let you know if i come up with anything.

Craig
Title: Re: Plugins and Delphi
Post by: tommer on August 10, 2006, 01:49:58 am
Yes, Delphi works perfectly towards MediaCenter :)

You add MediaCenter COM object as a Type Library, and off you go...
Title: Re: Plugins and Delphi
Post by: Craig on August 10, 2006, 02:41:14 am
Thanks Tommer,

I'll have a dabble

Craig
Title: Re: Plugins and Delphi
Post by: Craig on August 11, 2006, 03:03:31 am
Tommer,
Do you have anymore info on getting the basics up and running?

I've imported Media Center.tlb but after that I'm stuck.

This is all new ground for me.

Thanks in advance
Craig
Title: Re: Plugins and Delphi
Post by: KingSparta on August 11, 2006, 05:18:06 am
if writing for MC12 you will need to use "media center 12.tlb"
Title: Re: Plugins and Delphi
Post by: Craig on August 11, 2006, 11:56:05 pm
Thanks King,

I've got a bunch of components on my pallette now but am stuggling on how to use them.
I'm wanting to capture when the current playing song changes. At the moment all I can get is  'MCC: NOTIFY_PLAYLIST_PROPERTIES_CHANGED' events but they only seem to occur when the Playing Now list  changes completely not when the current song moves.

Any pointers would be welcome.

Craig
Title: Re: Plugins and Delphi
Post by: Craig on August 12, 2006, 01:59:23 am
Ok, I've got as far as being able to get the current song file and other info but how do I set up an event to tell me that this has changed or do I just need to keep polling it?

Thanks

Craig
Title: Re: Plugins and Delphi
Post by: scthom on August 12, 2006, 09:22:19 am
Only the newest version (MC12) has events.  At least that's what we're told.  And the documentation is sketchy since it's still a Beta version.
Title: Re: Plugins and Delphi
Post by: Craig on August 12, 2006, 04:42:16 pm
Thanks Scott,

I've got the basics working now but obviously polling MC's not the best way to go about things.

Could you point me towards the documentation however sketchy please?

Thanks
Craig
Title: Re: Plugins and Delphi
Post by: scthom on August 12, 2006, 06:53:10 pm
When I said "sketchy" what I meant (in a nice way) is that there is none yet.
Title: Re: Plugins and Delphi
Post by: Craig on August 13, 2006, 02:40:09 am
And I was expecting a Pdf of scans of beer mats ;D

Are there any docs that would explain how to make my program into a MC service?

Thanks
Craig
Title: Re: Plugins and Delphi
Post by: scthom on August 13, 2006, 09:49:39 am
One of the registry settings when you set up the COM interface (PluginMode) is to tell MC that the plugin should run all the time.  0= only when shown, 1 = all the time.

Is that what you're asking?
Title: Re: Plugins and Delphi
Post by: Craig on August 13, 2006, 12:09:38 pm
No it's a bit more than that. Because I have no experience with plugins and couldn't find any info relating to Delphi, my program (A link between MC and Squeezebox's) has ended up as an exe that needs to be run alongside MC. I was meaning what is involved in getting it to run inside MC?

Craig
Title: Re: Plugins and Delphi
Post by: scthom on August 13, 2006, 05:35:16 pm
I have no experience making exe's run alongside MC.  Somebody with more experience would have to help.

It would be far easier if you could turn the exe into a dll.  Then the dll just has to register as a COM interface to MC and set the PluginMode setting (as I mentioned).  Then MC handles it automatically.

Sorry I can't be of any further help.
Title: Re: Plugins and Delphi
Post by: Craig on August 14, 2006, 02:28:53 am
Thanks Scott,

I'll keep developing it as an exe for now then I'll be asking questions about converting it to a dll later ;-)

Craig
Title: Re: Plugins and Delphi
Post by: tommer on August 21, 2006, 02:01:44 am
Craig

I'm also using an exe which interfaces towards the MC com object.

What I've done is to make my own touchscreen application, but letting MC handle all the music, zones etc...
Title: Re: Plugins and Delphi
Post by: dlone on September 01, 2006, 05:46:25 pm
Instead of creating an application - try an activex form (not sure if that's the right name - but it's there somewhere)
I tried it a long time ago and it worked fine
You'll need to have delphi7 or lower as it was removed in the later versions
Title: Re: Plugins and Delphi
Post by: tommer on September 13, 2006, 04:30:41 pm
Well, I'm quite happy about my app which throug automation uses MediaCenter as a back end  ;D