Home AMX User Forum AMXForums Archive Threads AMX Applications and Solutions

iTunes Control

Is there any way for me to control a palylist from the Netlinx master to a computer with iTunes player? The computer is running Windows XP. I am looking codes that would open the iTunes and then play a playlist.

Thank you
«1

Comments

  • mpullinmpullin Posts: 949
    At Cedia this year Rich Green (of Rich Green Ink in CA) mentioned a side door his company discovered that allowed them to control a session of Itunes. Maybe he'll sell you the secret.

    Otherwise, it's very difficult. This generation of Apple products don't play well with others.
  • vincenvincen Posts: 526
    The only way to control iTunes from network is by using the DAAP protocol but it's confidential, but reverse engineered versions are avalaible on Internet but it's a pretty complex protocol to implement in NetLinx !!

    An other way you can use if computer is running Linux or Mac OSX, is SlimServer that allows you full access at all playlists, podcasts, music tracks of iTunes remotely through network, and you can distribute it in numerous places. The software is Open-Source and it exists a module for control of it that works really well, with display of cover art in Modero ;) Have a look here for more details in english: http://www.domedia.net/?page=slimserver&title=PRODUCTS and you can also download a cut sheet http://www.domedia.net/include_pages/Cut-Sheet_SlimServer-EN.pdf

    Vinc
  • HedbergHedberg Posts: 671
    iTunes, apparently, can be controlled in a Windows XP environment with jscript. Wouldn't it be possible to access a Windows XP machine via Telent and thereby control iTunes with scripts? I also think that it's possible to run iTunes from the Windows command line with online switches, but I've not been able to find any documentation as to what the switches and their syntax are. But, it appears that something like "itunes sometune.mp3" will start itunes with that file playing.

    Coming up with scripts to accomplish particular functions is probably a nontrivial task (at least it would be for me), but couldn't it be done if someone had the motivation?

    Apple has an SDK for the Windows XP environment with a couple sample scripts included and there are some available via web search which appear to work ok.
  • vincenvincen Posts: 526
    Hedberg wrote:
    iTunes, apparently, can be controlled in a Windows XP environment with jscript. Wouldn't it be possible to access a Windows XP machine via Telent and thereby control iTunes with scripts? I also think that it's possible to run iTunes from the Windows command line with online switches, but I've not been able to find any documentation as to what the switches and their syntax are. But, it appears that something like "itunes sometune.mp3" will start itunes with that file playing.

    Coming up with scripts to accomplish particular functions is probably a nontrivial task (at least it would be for me), but couldn't it be done if someone had the motivation?

    Apple has an SDK for the Windows XP environment with a couple sample scripts included and there are some available via web search which appear to work ok.

    Don't forget that if u succeed to control iTunes from scripts you'll probably get none or nearly none feedback so it's not really cool to control jukebox with blindeyes :(

    Vinc
  • kennyannkennyann Posts: 113
    Thank you guys for some of the insight. I have been looking at the code that Apple posted - I will test it out and see what I can find out. I will let you all know how to do it.
  • iTunes COM inteface

    I have created a couple files that use the script object to control iTunes. They have full documentation of there COM interface it would be very easy to write an application to control/inteface with iTunes. I created a couple .js files to new nextTrack and previousTrack and attached them to the external buttons on my laptop, that way I don't need to give the iTunes application focus or even look at the screen to skip tracks. I also wrote an HTML application to control iTunes, but designed my own UI, its very simple, but it was just a "see if I can" type thing. I will attache the COM interface that apple gives out. I realize this isn't a complete solution but is a direction to head.

    I also noticed that they have quite a few events you can capture so you know what is going on with the application so it should be easy to write an application that keeps track of any application changes. I realize its not done for you vincen but it is definately a viable solution. Doing it this way would also let you decide how to inteface it with NetLinx, I would assume that IP would be the best way, but you have the option to do it over 232 if necessary.

    It also looks like it may be possible to retrieve artwork, if that is true using dynamic images you could show album artwork on our panels, I guess poop-tron won't be doing that . . .
  • vincenvincen Posts: 526
    I created a couple .js files to new nextTrack and previousTrack and attached them to the external buttons on my laptop, that way I don't need to give the iTunes application focus or even look at the screen to skip tracks.

    Funny to hear you need to do all that to control iTunes under Windows when all these functions are native under OSX ;)
    I also noticed that they have quite a few events you can capture so you know what is going on with the application so it should be easy to write an application that keeps track of any application changes. I realize its not done for you vincen but it is definately a viable solution. Doing it this way would also let you decide how to inteface it with NetLinx, I would assume that IP would be the best way, but you have the option to do it over 232 if necessary.

    Thanks for all these infos, but in fact when I need to control iTunes I do it under Mac OSX so control is pretty easy to do with AppleScript interface ;) or I use SlimServer so I can distribute all audio files of iTunes in multiples rooms with full control and it's very enjoyable :D

    Nevertheless it can be really interesting for people that need iTunes control under Windows and not afraid of poor stability of that OS :D

    Vinc
  • Its funny that Windows has such a bad rap when it comes to stability with XP I've never seen a crash, including when I ran prerelease versions, in my experience once its set up and configured for your hardware it stays up. However I've seen macs that need to be reimaged every 6 months to keep them up. I think that the stability thing was a thing of the past (95 and 98). That being said it still makes more sense to use a Mac mini for an iTunes server than a windows box, of course you would think that apple would have absolutely flawless products considering they control the hardware and software.

    How is interfacing with iTunes on a mac using applescript different than using javascript on a pc? You make it sound as if its much more complex. From the API document they are very similar, you use the same interfaces.
  • HedbergHedberg Posts: 671
    So, if I understand what's been said so far, if iTunes is available either with a
    Windows XP server or a Mac server, it can be controlled via scripting either with jscript (Windows) or with applescript (Mac). With the XP (and I suspect with the Mac also), the scripts could be accessed and executed from a terminal session using telnet. The scripts could output information from iTunes to the terminal which could be read and interpreted by the Netlinx master (telnet client) and used for feedback/display.
  • Chip MoodyChip Moody Posts: 727
    Haven't played with the XP side, but on the Mac side if you enable Telnet in the OS, you can execute Applescript commands through the Telnet interface. The bad news is that it's REALLY SLOW.

    The best answer is to have an application running on the Mac as a TCP/IP server of sorts, with the express purpose of controlling iTunes. A client (such as a NetLinx processor) would connect using TCP/IP and control it through commands that the server supports.

    Anyone that wants to seriously persue this should pay a visit to the Cre$tron Yahoo group - there is a participant there that has written such an app - I don't think he's gotten it out of a beta level yet, but it does exist.

    - Chip
  • bobbob Posts: 296
    I have created a couple files that use the script object to control iTunes.
    I have seen the windows DCOM interface for iTunes and figured out how to do basic transport stuff also sending out track information but have never managed to change a playlist using that COM interface, although it should be possible. Can you please provide an example?

    Thanks,
    Bob.
  • vincenvincen Posts: 526
    Chip Moody wrote:
    Anyone that wants to seriously persue this should pay a visit to the Cre$tron Yahoo group - there is a participant there that has written such an app - I don't think he's gotten it out of a beta level yet, but it does exist.

    Do u have an url for that group on Yahoo as a research with Cre$tron word (with an s instead of $) gave none result :(

    Thanks

    Vince
  • Chip MoodyChip Moody Posts: 727
    Assuming I don't get in trouble for this, yes - it's http://groups.yahoo.com/group/cre$tron/

    And no, I wouldn't go directly clicking on that link. Copy, paste & fix the naughty word that our hosts won't let us utter, then hit "go".

    - Chip
  • vincenvincen Posts: 526
    Chip Moody wrote:
    Assuming I don't get in trouble for this, yes - it's http://groups.yahoo.com/group/cre$tron/

    Thanks got it :)

    Vinc
  • vincenvincen Posts: 526
    But I'm unable to find on that newsgroup any piece of code concerning control of iTunes :(

    Vinc
  • frthomasfrthomas Posts: 176
    I can find a reference to some "Lake Shore iTunes Server" thingy that got a couple lines at Digital Connect but not much more. Maybe you need to be registered with the group to access the files section containing the bounty?

    Fred
  • vincenvincen Posts: 526
    frthomas wrote:
    I can find a reference to some "Lake Shore iTunes Server" thingy that got a couple lines at Digital Connect but not much more. Maybe you need to be registered with the group to access the files section containing the bounty?

    I got registered in the group but I was not able to find more :( Maybe Chip will be able to tell me where to find expected files ??

    Vince
  • Chip MoodyChip Moody Posts: 727
    Sorry - I just read the message I posted a while ago, which I won't say was misleading, but certainly could have been read the wrong way.

    There are no files in existence on that Yahoo! group. What I was trying to say was that there was a participant in that forum that had been discussing an application he had been working on. Being in beta, he hadn't released it to the public, but may be interested in beta testers if he is contacted directly. I contacted him and got a very early version of the software some time ago, but I haven't gotten around to setting up a Mac here to test it with...

    So I would suggest searching through the message forums and contacting the individual directly.

    - Chip
  • vincenvincen Posts: 526
    Chip Moody wrote:
    There are no files in existence on that Yahoo! group. What I was trying to say was that there was a participant in that forum that had been discussing an application he had been working on. Being in beta, he hadn't released it to the public, but may be interested in beta testers if he is contacted directly. I contacted him and got a very early version of the software some time ago, but I haven't gotten around to setting up a Mac here to test it with...

    Thanks Chip for the explanation, I'll look for that guy on the newsgroup ;)

    Vinc
  • Chip MoodyChip Moody Posts: 727
    Good luck with that, and sorry again for the confusion!

    - Chip
  • joelwjoelw Posts: 175
    kennyann wrote:
    Is there any way for me to control a palylist from the Netlinx master to a computer with iTunes player? The computer is running Windows XP. I am looking codes that would open the iTunes and then play a playlist.

    Thank you

    I posted method for interconnecting Netlinx and PC in this thread:
    http://amxforums.com/showthread.php?t=1544

    In conjunction with the iTunes Windows SDK it is realtively simple to do what you ask.
  • viningvining Posts: 4,368
    Roku SoundBridge

    You can control iTunes through the Roku SoundBridge. Full search capabilties, add and remove and add songs from queue etc. I'm currently working on this project on the side and it shows a lot of promise. You can access and control WM10 as well as a number of other possibilites.

    Youn can connect via IP to the sound bridge which has open source RCP documentation. With my programming skill I can only can so far but if anyone is interested I can share what I have. It is however in the rough stage and is a work in progress but it does connect to iTunes and give you full access to the library and search by text or through lists by genre, artist, album, composer, songs, playlists, etc.
  • joelwjoelw Posts: 175
    vining wrote:
    You can control iTunes through the Roku SoundBridge. Full search capabilties, add and remove and add songs from queue etc. I'm currently working on this project on the side and it shows a lot of promise. You can access and control WM10 as well as a number of other possibilites.

    Youn can connect via IP to the sound bridge which has open source RCP documentation. With my programming skill I can only can so far but if anyone is interested I can share what I have. It is however in the rough stage and is a work in progress but it does connect to iTunes and give you full access to the library and search by text or through lists by genre, artist, album, composer, songs, playlists, etc.

    What is your connection scheme? How is the Netlinx controller involved?

    What does the Roku SoundBridge offer over a Netlinx short of the line output stage?

    What iTunes features are you interested in controlling from Netlinx?
  • viningvining Posts: 4,368
    iTunes/Roku

    Netlinx connects to Roku via TCP/IP.

    Roku provides a bridge to iTunes, Windows Media connect, Internet Radio etc.where the files stream is output from the Roku by either digital or anolog connection to you AV equipment.

    With Netlinx through the Roku you can retrieve all your iTunes (and other stuff too) library items, album lists, song lists, playlist, etc. You can also do text searches after setting a searching filter of either, artist, album, composer, song or all and display on your TP. You can retrieve all the list data at once or in segments equal to your TP's ability to list them. 5 at time, 10 at a time so you don't have bombard your input buffer with more stuff than you're ready to handle.

    You basically have full functional control of searching and playing of the servers you're accessing through the Roku.

    Once you've found what you what you add it to or erase and create a new playing queue. And once you have a playing queue you can add to it through additional searches or scroll through the queue and remove songs you don't want in it.

    You can also retrieve all song info (bitrate, sample rate, song length, artist, album, year relesed, etc) of the currently playing song or of a song you want details on while search for music.

    So far the only thing you can't do is actually create or change your librarys in iTunes or what ever itself .

    The Roku sends and recieves acsi string commands and data on a dynamic or static ip address on port 4444 or 5555. Same for Telnet.
  • joelwjoelw Posts: 175
    vining wrote:
    Netlinx connects to Roku via TCP/IP.

    Roku provides a bridge to iTunes, Windows Media connect, Internet Radio etc.where the files stream is output from the Roku by either digital or anolog connection to you AV equipment.

    I'm not so sure I like this connection model. I prefer a client-server model from iTunes to Netlinx. I'm taking the perspective of a code implementation that would reach the biggest possible audience.

    So the concept would be to use iTunes interface as "music database" for all potential player devices that access iTunes library. Pull meta-data from "music database", and play from generic player. This would make driver to player much simpler, and prevent redundant driver code. How about a public SNAPI definition for a generic "music database"?
  • viningvining Posts: 4,368
    iTunes/Roku

    It's always better to go staight to the source but when you can't you do what you can.

    The Roku is around $150.00-$200.00 bucks and allows full access to music files and although the communications and programming is between Netlinx and Roku; the Roku is assentially transparent to the process. It actually is nice to be able to put the Roku at the AV equipment and attached to the network, you can then connect to any PC w/ iTunes, WM10, SlimServer, etc, as long as permissions are set to allow these connections (and the host PC is on). So with multiple PC for multiple users running iTunes they are all accessable by scrolling throught the List of servers available as displayed on the TP and selecting the one you wish to use.

    For how much it costs and the ease in programing and connecting to it, it's really hard to beat. And for those who don't want a $5k+++ dedicated server and want their iTunes and iPod, it's worth the effort.

    The main reason for my working on this is because the iPod interface and functionality is such crap. No search capabilties to speak of, extremely slow responses, etc. The iPod Module is better than nothing but doesn't come close to what you can do with the Roku and at TCP/IP speeds. The Roku isn't perfect though, there are some bugs that I've noticed, but I'm also running the Beta firmware.
  • joelwjoelw Posts: 175
    Keep in mind if you want multiple zones of Roku device's, this model would require complete code block for each unit. Let us know how things work out, sounds interesting.

    Back to "iTunes Control".
  • viningvining Posts: 4,368
    iTunes/Roku

    That's ok. At least I won't have to worry about running out of physical ports to connect multiples to the master!

    I also just installed a FireFly server applications that works with Apples Bonjour pointed it to my CD's folder on a network drive and it work just like iTunes again with all the searching capabilities and the iRadio station work great on the TP as well. With out any configuration I can search/select/display 92 internet radio stations.

    The FireFly actually shows up as two servers in the list, 1 which runs the Apple DAAP protocol and a 2nd that uses the Roku Server Protocol (RSP) it works about ten times faster than the DAAP.
  • joelwjoelw Posts: 175
    vining wrote:
    I also just installed a FireFly server applications that works with Apples Bonjour pointed it to my CD's folder on a network drive and it work just like iTunes again with all the searching capabilities and the iRadio station work great on the TP as well. With out any configuration I can search/select/display 92 internet radio stations.

    This behaves as an iTunes/Media Connect bridge: http://www.allegrosoft.com/ams.html
    Roku is a client of Allegrosoft.
  • I've written a few JScripts for basic transport control of iTunes that work fine. The issue I'm having is how do I get feedback from a JScript to the master?
Sign In or Register to comment.