INTERACT FORUM
Windows => Plug-in Development => Topic started by: indygreg on December 28, 2003, 01:25:58 pm
-
i am sure this has been answered but i cannot turn it up in a search. i want to control mj from a vb client running on another computer. are there any examples of remotely controlling MJ from vb? what is the simplest protocol for this?
thanks,
greg
-
You'd have to write an interface plugin for the server machine running MC that listens for commands on an open port from your client VB applications, then exexutes the proper commands.
You can't use the SDK to connect to a remote MC and control it directly from a client computer.
Scott.
-
Why is that? I thought half the point of using COM was that you could then use DCOM to call a component remotely?
-
Why is that? I thought half the point of using COM was that you could then use DCOM to call a component remotely?
Um, OK. I really don't know anything about DCOM (or that much about COM for that matter).
I'm just teaching myself this stuff as I need it, but if you could give me the lowdown on DCOM and how it works it would be greatly appreciated, especially if I could use it with MC!
Scott.
-
i was hoping that i wasn't the first person to try this. surely someone has built a touchscreen interface to mj using vb? com is a steep learning curve just to retrieve a list and invoke a few transport commands.
greg
-
Have you tried Hairstyle?
-
Building a simple IP Socket based client & server app in VB for this task is simple.
You would first create a VB Server program to run on the same machine as "Media Center". The VB Server would used the COM Automation interfaces to control "Media Center". The VB Server would also need to load up a TCP or UDP Winsock server to allow remote clients a method to connect to the server and send instruction commands. The VB Client would also use a Winsock control to connect to the server. This is a much easier method then dealing with all the issues in DCOM.
I can provide and example if you are still interested in this project.
Thanks,
Robert
-
This is exactly what I would like to do but with another programming language (which does support ActiveX - OCX).
What do I need to install (SDK?) to control and communicate with Media Center using ActiveX? Where could I find generic examples to look at.
I would like to play, pause, next, prev, ect. Also I would like to get the playlist and other useful info. I would like to write a server app that sits on the same machine as MC and interface with 'client' apps on other systems simular to what you described.
John
-
John,
Here is the documentation on the build in COM interface:
http://www.musicex.com/mediacenter/DevZone/MJAutomation.html
Here is a VB sample of using the COM Automation interface:
http://www.musicex.com/mediacenter/DevZone/interface_sdk.zip
Good Luck !!
Robert
-
I downloaded and played with the Busybox example. I can see this is an example of a 'plugin' to be used within MC. Am I to assume that you cannot control MC from outside using ActiveX calls? The language I program with can use OCX's and I have controlled Windows Media Player fine. I do not see an interface OCX file that I can use. Am I missing something or do I have to write a 'plugin' that would give me external control of MC in order to talk to MC?
John
-
The MediaCenter Jukebox Automation COM Interface is fully exposed. You program does not need to be a plugin.
There is not an OCX file to reference, but rather you can reference the TylpeLib file which exposes the available properties and methods of the MediaCenter automation interface:
"C:\Program Files\J River\Media Center\Media Jukebox.tlb"
In VB you would simply create the automation interface like this.
'declare
Dim MediaCenterApplication as Object
'(Note: if you reference the type lib, you can declare this
' object with the proper type instead of using the
' generic Object identifier)
'attempt to create instance to existing running application
Set MediaCenterApplication = GetObject( ,"MediaJukebox Application")
'if an existing running instnace was not found, then we will create our own
If Err.Number = 429 Then
'create new instance
Set MediaCenterApplication = CreateObject("MediaJukebox Application")
End If
-
Be aware though that out of process usage of MC from VB is very slow
-
Well without an OCX file I am out of luck anyways. Oh well....
John
-
What language ? You could always write a simple OCX wrapper in VB that exports the functionality you need.
-
Of course, you could always cheat.... run the webserver bit of MC (Tools->Options->Startup, "Run Remote Server on port xxx")
and then use http from your client application to send the necessary strings (i.e. URLs) to MC to control it that way, parsing the resulting output.
-
The language I am using for this project is Labview. I am not a VB programmer so writing a wrapper for me is out. Its too bad someone hasn't written a wrapper yet. Kinda was hoping it would support it out of the box.
Might have to look at another player.
John