INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: vb control example  (Read 4398 times)

indygreg

  • Regular Member
  • Recent member
  • *
  • Posts: 9
  • nothing more to say...
vb control example
« 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
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:vb control example
« Reply #1 on: January 02, 2004, 12:03:52 am »

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.
Logged

Zoner

  • Regular Member
  • World Citizen
  • ***
  • Posts: 198
  • nothing more to say...
Re:vb control example
« Reply #2 on: January 02, 2004, 06:45:20 am »

Why is that?  I thought half the point of using COM was that you could then use DCOM to call a component remotely?
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:vb control example
« Reply #3 on: January 03, 2004, 01:01:41 am »

Quote
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.
Logged

indygreg

  • Regular Member
  • Recent member
  • *
  • Posts: 9
  • nothing more to say...
Re:vb control example
« Reply #4 on: January 03, 2004, 10:51:31 pm »

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
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:vb control example
« Reply #5 on: January 04, 2004, 01:22:46 am »

Have you tried Hairstyle?
Logged

rrsavage

  • Regular Member
  • Recent member
  • *
  • Posts: 8
Re:vb control example
« Reply #6 on: April 10, 2004, 12:26:15 pm »

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
Logged

jwilson56

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 52
  • Change this by choosing profile
Re:vb control example
« Reply #7 on: April 23, 2004, 07:01:00 am »

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
Logged
Now Playing skin creator - NetRemote 2.0 / 6 Zone whole house audio delivering 1580 watts RMS total

Visit My Nowplaying Blog

rrsavage

  • Regular Member
  • Recent member
  • *
  • Posts: 8
Re:vb control example
« Reply #8 on: April 23, 2004, 09:52:20 am »

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




Logged

jwilson56

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 52
  • Change this by choosing profile
Re:vb control example
« Reply #9 on: April 23, 2004, 12:49:40 pm »

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
Logged
Now Playing skin creator - NetRemote 2.0 / 6 Zone whole house audio delivering 1580 watts RMS total

Visit My Nowplaying Blog

rrsavage

  • Regular Member
  • Recent member
  • *
  • Posts: 8
Re:vb control example
« Reply #10 on: April 23, 2004, 01:25:56 pm »

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.


Code: [Select]
'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

Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:vb control example
« Reply #11 on: April 23, 2004, 02:03:48 pm »

Be aware though that out of process usage of MC from VB is very slow
Logged

jwilson56

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 52
  • Change this by choosing profile
Re:vb control example
« Reply #12 on: April 23, 2004, 03:04:08 pm »

Well without an OCX file I am out of luck anyways. Oh well....

John
Logged
Now Playing skin creator - NetRemote 2.0 / 6 Zone whole house audio delivering 1580 watts RMS total

Visit My Nowplaying Blog

rrsavage

  • Regular Member
  • Recent member
  • *
  • Posts: 8
Re:vb control example
« Reply #13 on: April 23, 2004, 03:10:01 pm »

What language ?  You could always write a simple OCX wrapper in VB that  exports the functionality you need.

Logged

Rob L

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 469
Re:vb control example
« Reply #14 on: April 23, 2004, 03:49:35 pm »

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.
Logged

jwilson56

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 52
  • Change this by choosing profile
Re:vb control example
« Reply #15 on: April 23, 2004, 10:19:06 pm »

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
Logged
Now Playing skin creator - NetRemote 2.0 / 6 Zone whole house audio delivering 1580 watts RMS total

Visit My Nowplaying Blog
Pages: [1]   Go Up