INTERACT FORUM

Please login or register.

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

Author Topic: CMJAutomation from external programs - PLEASE!  (Read 4871 times)

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
CMJAutomation from external programs - PLEASE!
« on: November 30, 2002, 08:24:24 pm »

Hello. I was excited about using CMJAutomation until I learned that it cannot be instantiated from external programs, but only from plug-ins to MJ.   ?

Several posts to this newsgroup recommend creating a plug-in that communicates with my external program using any form of inter-process communication, but this is cumbersome.

What I want to do is talk to CMJAutomation from within Perl scripts launched by Girder. I do not think I can write a real plug-in .DLL in Perl, unless I plunk down $195 to buy "perlctrl" from ActiveState!!

Please, Please, Please, make it possible to use CMJAutomation from external programs.  This would save a _whole_lot_of_grief_.

Alternatively, can anyone offer suggestions, such as how to make a COM object in Perl without spending money, or using any other free language, for that matter.

Why do I want to use Perl?
1. Regular expressions.
2. Automatic memory management.
3. It is free.
4. M$ Visual C++ is expensive.
5. M$ Visual Basic is expensive.
6. Did I mention regular expressions?

Thanks a million!
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re: CMJAutomation from external programs - PLEASE!
« Reply #1 on: November 30, 2002, 11:43:53 pm »

As an idea off the top of my head why not install Web Remote and remote control that?

Since it accepts HTTP requests I would have thought that would be easy with Perl.


But if you told us exactly what you wanted to do then we could give better advice.
Logged

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: CMJAutomation from external programs - PLEASE!
« Reply #2 on: December 02, 2002, 05:49:18 pm »

Hello!

Thanks, RhinoBanga, for your very prompt reply. :) I considered using WebRemote plug-in, although I think it would be much more convenient to make calls to CMJAutomation directly. In particular, I would have to make enhancements to WebRemote, which requires purchasing Microsoft's compiler  :-/.

Here is what I want to do, to start out with:

Using Girder and the OSDmenu plug-in, I will present an on-screen display of various playlists.  Next to each playlist would be one of three things: Include, Exclude, or blank, which means "don't care".

The Perl script will build a search query string that will include all songs in the "Include" playlists, but exclude songs in the "Exclude" playlist.  I keep different types of playlist, such as "Celtic", "Big Band",  "Piano",
"Trumpet", "Bag Pipes", "Vocal", "Instrumental", "Full Orchestra", etc.

This type of thing would allow me to easily listen to all Celtic music, but exclude those that feature bag pipes, and exclude songs that have vocals, but do include all my Piano music whether it is Celtic or not.

Of course, I could make a smartlist for every possible permutation and use mjextman to launch the appropriate smartlist, but, as you can imagine, the number of possibilities grows exponentially, making that very non-scaleable.

What I am thinking of doing is to have the Perl script build the MJ query string, and call CMJAutomation.Search(), then iterate thru the results, copying them to Playing now.

I realize that I could do this by pumping keystrokes to MJ, but I don't really like the resulting screen flicker, and that has much less flexibility.

For example, I want to enhance my Perl script to do some intelligent "pseudo-sorting" upon the search results to give priority to favorite songs and not-recently-played songs while preserving some randomness in the playback order (i.e. don't sort strictly).

Another desire is to be able modify the Custom1 and Custom2 fields via scripts launched by Girder. I use Custom1 to store a string that encodes the song's rating separately for each member of my family.

Any thoughts?
Thanks!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: CMJAutomation from external programs - PLEASE!
« Reply #3 on: December 03, 2002, 12:07:25 pm »

To the best of my knowledge, there's no simple way to export automation across process boundaries.

However, MC 9 may have a beefed-up Web Remote built-in for remote access... basically automation via. HTTP and XML.

It may be worth talking to either the Glissando or the Net Remote authors. (they're doing similar things)

Let us know what you decide.
Logged
Matt Ashland, JRiver Media Center

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: CMJAutomation from external programs - PLEASE!
« Reply #4 on: December 03, 2002, 01:03:35 pm »

Quote
To the best of my knowledge, there's no simple way to export automation across process boundaries.


Hello, Matt.  I apologize if my understanding is still simplistic - I am just now studying up on COM and Automation.  However, all the examples I have seen of user programs using Automation objects involve the script creating an instance of the Automation object using something like:

set myShObj = Wscript.CreateObject("Wscript.Shell")


Usually, the examples are for manipulating MS Office Apps.

Anyway, it seems that there are plenty of other COM Automation servers that can be called from external scripts, implying that it can be done. I sure wish MJ could support it!

Quote
However, MC 9 may have a beefed-up Web Remote built-in for remote access... basically automation via. HTTP and XML.


I greatly look forward to this, especially HTTP control. I hope it is as full featured as CMJAutomation, or even more so!

Quote
It may be worth talking to either the Glissando or the Net Remote authors. (they're doing similar things)


Good idea.  I will try this.  I have not checked out Net Remote yet.  Sounds interesting.

Thanks!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: CMJAutomation from external programs - PLEASE!
« Reply #5 on: December 05, 2002, 05:14:58 am »

Quote
Anyway, it seems that there are plenty of other COM Automation servers that can be called from external scripts, implying that it can be done. I sure wish MJ could support it!


I think you always get a new instance of the program, instead of the running one.  The new instance could then somehow communicate with the old one, but that's a little hairy.  Again, there may be more to this than I know...

Still, the HTTP design is cooler anyway because it allows MJ to be anywhere and the plugin to be anywhere else.  Now we just need to get it built in  ;D
Logged
Matt Ashland, JRiver Media Center

Renegade

  • Regular Member
  • Recent member
  • *
  • Posts: 18
  • nothing more to say...
Re: CMJAutomation from external programs - PLEASE!
« Reply #6 on: December 13, 2002, 05:30:32 pm »

I by no means have looked at it long, but isn't there already a Girder Plugin for MJ and MC?

That sure sounds like what you are looking for, and it's already done.  Unless there's some problem with the plugin that I don't know about.
Logged

JHC

  • Regular Member
  • Recent member
  • *
  • Posts: 48
Re: CMJAutomation from external programs - PLEASE!
« Reply #7 on: December 17, 2002, 07:12:47 pm »

Soundman and others,

I too found it a little curious that with such a well-developped OLE Automation interface, it couldn't be called from out-of-process.

So I have developped an out-of-process OLE server that communicates with a plugin installed in Media Center.

Bottom line, you can access to the IMJAutomation object (and thus all others) from any COM-enabled client. My OLE server provides any client that asks, an IMJAutomation object. All properties and method parameters are marshalled properly etc. In fact there is no reason why this wouldn't work across a lan.

If anyone is interested in testing this, please let me know.

Thanks,

Jonathan
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re: CMJAutomation from external programs - PLEASE!
« Reply #8 on: December 17, 2002, 10:23:28 pm »

I'll have a go at it.

I'll see if I can get AlbumView working as a stand-alone EXE without all the limitations placed on it by MJ.

My email address is: jamie@jdnet.co.uk
Logged

JHC

  • Regular Member
  • Recent member
  • *
  • Posts: 48
Re: CMJAutomation from external programs - PLEASE!
« Reply #9 on: December 18, 2002, 05:44:04 pm »

RhinoBanga,

I sent you a package -- let me know how you make out.

Jonathan
Logged

Renegade

  • Regular Member
  • Recent member
  • *
  • Posts: 18
  • nothing more to say...
Re: CMJAutomation from external programs - PLEASE!
« Reply #10 on: December 24, 2002, 07:10:11 pm »

Not sure if I'll get a chance to do anything with it soon... but I'd be interested as well.

You can send it to: jriver@the-last-domain.org

Thanx in advance...
Logged

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: CMJAutomation from external programs - PLEASE!
« Reply #11 on: December 30, 2002, 07:21:28 pm »

Quote
So I have developped an out-of-process OLE server that communicates with a plugin installed in Media Center.

If anyone is interested in testing this, please let me know.


Wow, am I ever interested!  This is exactly what I want. Please send it to me for testing. I just sent you a private message with an email address.  I would love to see the source code, too.

Thanks,
Soundman
Logged

JHC

  • Regular Member
  • Recent member
  • *
  • Posts: 48
Re: CMJAutomation from external programs - PLEASE!
« Reply #12 on: December 31, 2002, 05:04:06 am »

Hi Soundman,

I've sent you the package -- let me know how you make out.

Jon



Logged

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: CMJAutomation from external programs - PLEASE!
« Reply #13 on: January 09, 2003, 11:57:25 am »

Jon,

Thanks, Thanks, You are a Hero!

I have been studying up on COM for the purpose of doing this myself, but now I don't have to.

I am curious, though: does your code have to have a priori knowledge of all the MediaCenter automation interfaces, or can it simply marshall everything across without having compile-time knowledge of the methods and properties in MediaCenter's automation objects?

Will your plug-in have to be modified when JRiver expands the SDK?

BTW, I got it to work with MediaJukebox 8.  I just had to register your plugin myself, since MJ8 uses a different registry path to store info about interface plug-ins.
Logged

JHC

  • Regular Member
  • Recent member
  • *
  • Posts: 48
Re: CMJAutomation from external programs - PLEASE!
« Reply #14 on: January 09, 2003, 05:40:43 pm »

Hi Soundman,

Thanks for letting me know that  you got everything working -- it's good to know.

No, my code doesn't really have to know about the entire API -- I simply export the entire Media Center automation interface as a whole.

But yes, if the API expands or changes significantly, I may have  to issue an update as well... depending on what changes and how.

Thanks again,

Jonathan
Logged

shauge

  • Regular Member
  • Member
  • *
  • Posts: 4
Re: CMJAutomation from external programs - PLEASE!
« Reply #15 on: May 12, 2003, 09:56:42 am »

Jon,

I am also interested in trying out this plugin. This will make the automation interface really useful.

I have sent my email address in a private message. Please send me a sample.

Thanks in advance.

Ståle
Logged

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: CMJAutomation from external programs - PLEASE!
« Reply #16 on: May 14, 2003, 03:42:36 am »

Hello.

I think Jonathan's plug-in allowing out-of-process MJAutomation access to MediaCenter is TERRIFIC.  I hope that you will post it for all to download.

Thanks!
Howard
Logged

dmets

  • Regular Member
  • Recent member
  • *
  • Posts: 17
  • nothing more to say...
Re: CMJAutomation from external programs - PLEASE!
« Reply #17 on: May 15, 2003, 07:22:13 am »

As per the Girder plugin question - there are two things that Girder does:

1) IR processing  - so that a certain remote control code can be used to corespond to a certain action on the PC.  

2) UI enhancement - Many people use Girder's functionality in OSD and output options to customize the way a PC is presented and controlled.  

for example using one of the many OSD Plugins, you can automate certain functions on the PC and access them with a Remote Control.  

My interest is in controling MC via a remote control with the menu appearing on my LCD Screen.   Girder would allow me to do this, as would several other programs - if I could access the controls/menus of MC via http or com or any other process...  
Logged

bkreamer

  • Regular Member
  • Recent member
  • *
  • Posts: 11
  • nothing more to say...
Re: CMJAutomation from external programs - PLEASE!
« Reply #18 on: May 16, 2003, 06:15:22 am »

?...Can you help a non-programmer? I have MJ8, love it.

Problem 1. I run a float center (opening June 1 - yay!). I need to let my customers control PC or CD-player sound (volume, next, pause, etc.). Speakers are transducers on the outside tank wall. I'm PC literate, can build a system, but otherwise green.

Can I get or customize a remote, to be used from within the closed float tank? RF remote? What components or software do I need? Remote controlled self-powered speaker system from Creative, or... ?

Problem 2. Can I control the float tank pump / power strip from the PC (maybe through x10?)? How? Specific software, components, etc., please! See next related question.

Problem 3. Can I execute a pre-written timed sequence of x10 commands? What software do I need?

Problem 4. Can I access the float center PC from home to execute the timed sequence before I leave for work? What software do I need for that?

Thank you, thank you, thank you...  -Bill
Logged

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: CMJAutomation from external programs - PLEASE!
« Reply #19 on: May 19, 2003, 07:49:41 pm »

Hi, Bill.

First of all, what is a Float Center? Sounds interesting.

Quote
Can you help a non-programmer? I have MJ8, love it.


I'll try.  I am a programmer by profession, but some of these things stump me too.

Quote
Problem 1. I run a float center (opening June 1 - yay!). I need to let my customers control PC or CD-player sound (volume, next, pause, etc.). Speakers are transducers on the outside tank wall. I'm PC literate, can build a system, but otherwise green.

Can I get or customize a remote, to be used from within the closed float tank? RF remote? What components or software do I need? Remote controlled self-powered speaker system from Creative, or... ?


There are many kinds of remote controls useable on a PC.  The simplest to thing to do is get a wireless keyboard and/or mouse.  Logitech and many others make these.  The ones made today are almost always RF.

However, if you want to control it more like you would a home theater component, then use an RF remote control such as ATI's Remote Wonder (I have one of these that came with my ATI All In Wonder Radeon, and I may be interested in selling it - send me a private message if interested).

The X10 universal remotes are also typically RF.  These have the benefit of interfacing equally well with your PC and with X10 switches.  For this, I recommend an X10 starter kit from homeautomation.com or x10.com.  The starter kits typically come with a serial port interface to allow the computer to send/receive X10 commands over power line, an RF remote control (which also sends out IR so you can control normal IR components), several lamp or appliance switches, and the software product "ActiveHome".

I bought such a kit for about $50, minus a coupon, making it $35.  Quite a deal, if you ask me.  'Only problem is that I haven't found time to fool with it yet!

Quote
Problem 2. Can I control the float tank pump / power strip from the PC (maybe through x10?)? How? Specific software, components, etc., please! See next related question.


Yes. Get the starter kit I described above, and plug your power strip into an appliance module, which the computer can turn on/off.  The X10 remote can also turn it on/off without the aid of the computer.  Be sure to watch the ampere rating of the appliance module.

Quote
Problem 3. Can I execute a pre-written timed sequence of x10 commands? What software do I need?


The ActiveHome software that typically comes with a starter kit has these features.  There are many other softwares, too, some of which may be better.  Two others that come to mind are Girder, HouseBot.

Quote
Problem 4. Can I access the float center PC from home to execute the timed sequence before I leave for work? What software do I need for that?  


As long as you get network connectivity between the two locations, you can.  Use any number of remote control solutions to cause the float center PC's desktop to appear on your home PC, then you can control it just like you are there!  I have evaluated just about every method of doing this, and Windows Remote Desktop wins, hands down.  So, be sure the float center's PC has Windows XP Professional (Home edition does not have remote desktop  ?)

Other forms of remote control are TightVNC (free, stable, but slow), pcAnywhere  (OK on slow links, lousy performance on a fast LAN).  RemoteAdmin, Laplink, and a few others I have long forgotten.  Nothing beats Windows XP Pro Remote Desktop.  It even lets you transport audio, which none of the others allow!

Finally, if all you want to do is kick off an event from home without having to take over the whole computer, then you may experiment with using Girder server/client plug-ins to transmit an event across the network that fires an event.  Or, run a SSH server at work and log into it to launch your event.  Or, if it happens at the same time every day, just schedule it and don't remote control at all.

I hope these tips help get you started.
Logged

bkreamer

  • Regular Member
  • Recent member
  • *
  • Posts: 11
  • nothing more to say...
Re: CMJAutomation from external programs - PLEASE!
« Reply #20 on: May 20, 2003, 07:57:04 am »

Thanks Junior Woodchuck for your interest and help.

Quote
First of all, what is a Float Center? Sounds interesting.

My "float tank" is a 9' long, 4.5' wide, 4.5" high, eurostyle egg-shaped tank, filled with body temp, saturated epsom salt water, 10" deep.  You float in peace and solitude, maybe listening to a soothing CD, or meditating and generally grooving. Do a search for "Dr. John Lilly", or "+Samahdi +float".

Quote
The simplest to thing to do is get a wireless keyboard and/or mouse.

Since the tank water is so salty, and the tank is covered to exclude light, noise, etc., the remote sound controls need to be moisture resistant and electrically isolated, and mechanical, or perhaps RF. I have electrically isolated piezo-type switches I can use (momentary, or latching for 30 seconds). This can control a 12v signal, which I can use to switch a latching 110v relay, or run a "remote button pusher" solenoid, etc. I'm a mechanical designer, and can work on this...(really, only the volume control is absolutely needed).

Quote
However, if you want to control it more like you would a home theater component, then use an RF remote control such as ATI's Remote Wonder

Will send you a private message on that, thanks.

Quote
I recommend an X10 starter kit from homeautomation.com or x10.com.

Thanks, got any ideas on protecting the ATI or X10 remote from salt water?

Quote
Question was: Can I control the float tank pump / power strip from the PC (maybe through x10?)? Answer: Yes. Get the starter kit I described above, and plug your power strip into an appliance module, which the computer can turn on/off.  The X10 remote can also turn it on/off without the aid of the computer.  Be sure to watch the ampere rating of the appliance module.

I'll have1500-1600 watts on the strip.

Quote
Question was: Can I execute a pre-written timed sequence of x10 commands? What software do I need? Answer: The ActiveHome software that typically comes with a starter kit has these features.  There are many other softwares, too, some of which may be better.  Two others that come to mind are Girder, HouseBot.

Can you explain/describe Girder a little? Its uses, etc.?

Quote
Question was: Can I access the float center PC from home to execute the timed sequence before I leave for work? What software do I need for that?  Answer: As long as you get network connectivity between the two locations, you can.  Use any number of remote control solutions to cause the float center PC's desktop to appear on your home PC,...

My home PC is P4-667/W98, office will be a new PC.  They are in towns twenty miles apart; both will be on cable modems. What constitutes a "lan" where these two cable modem PCs are concerned? I've heard of PCAnywhere; do I need it to use Windows Remote Desktop? Should I upgrade the W98 system to XP Pro? From what you're saying, Windows Remote Desktop has capabilities I could exploit down the road.

On a related note, can I transfer applications and data files to the Office computer with Windows Remote Desktop. Should I cable the PCs together at home to start off (get LapLink?) I might be great If I could take my work home every night, carrying a USB hot plug hard drive. Thoughts?

Whew, sorry for all the info demand.
Logged

bkreamer

  • Regular Member
  • Recent member
  • *
  • Posts: 11
  • nothing more to say...
Re: CMJAutomation from external programs - PLEASE!
« Reply #21 on: May 20, 2003, 07:59:53 am »

Whoops, make that thanks to Soundman, of course.
Logged

JHC

  • Regular Member
  • Recent member
  • *
  • Posts: 48
Re: CMJAutomation from external programs - PLEASE!
« Reply #22 on: May 22, 2003, 08:13:50 pm »

Hi everyone,

Sorry, I've been busy and haven't visited this board for awhile. It's nice to see a few people wanting to try my in/out of process plugin.

I'm going to get the stuff packaged up and out to whoever wants it this weekend.

If you'd like to get a copy, then please PM me with your email address.

Jonathan
Logged
Pages: [1]   Go Up