Apple ITunes SDK supports C#


“Apple’s SDK enables Windows developers to write code to control iTunes from other applications. These tools require iTunes 4.5 or later and support several languages, including C++, C# and JavaScript.”


News Source: http://www.macnewsworld.com/story/34235.html
SDK Link: http://developer.apple.com/SDK/#iTunesCOM


Sweet!


 

Comments (15)

  1. Neil Cowburn says:

    C# is supported via COM Interop. There’s no managed interfaces (as you would expect from Apple) and its slow to enumerate the collections 🙁

  2. Matt says:

    I think they were just refering to the musical note, not the computer language. I think they are contractually obligated by the RIAA to support all standard notes and chords. Sure, most musicians avoid using B-flat but you still gotta have it for backward compatibility.

  3. Apple ITunes SDK supports C#

  4. bobby says:

    how would i in C# make it show the current songs its ploaying….?

  5. Joe says:

    How would i rerad theitunes db and then populate a listbox with these songs?

  6. danielfe says:

    Check out Dan Crevier’s post that shows how to work with iTunes using C#

    http://blogs.msdn.com/dancre/archive/2004/05/08/128645.aspx

  7. joe says:

    ok, i can now populate the listbox, now i just cant figure out how to get i tunes to play the selected one… any ideas

  8. danielfe says:

    It may not be the best way since I haven’t played with the API, but here’s an easy way:

    static void Main(string[] args)

    {

    string filename = args[0];

    System.Diagnostics.Process p = new System.Diagnostics.Process();

    p.StartInfo.FileName "c:\program files\itunes\itunes.exe";

    //pass in filename like c:foo.mp3

    p.StartInfo.Arguments = filename;

    p.Start();

    }

    Hope this helps and upload your code so that others can benefit when you’re done 🙂

    -Dan

  9. C#_help says:

    so is there a way to read the itunesdb in \ipod_control\itunes\itunesdb to get all the songs name. i think i need to read that b/c reading tags i cant read .m4a. So if any body know how to do this. Please help

    thanks

  10. Joe says:

    So i heard there was a way to use the SDK and C# to get songs album art….Do you know how . Do you know of any exapmles?

  11. Sol Young says:

    How about adding tracks to the iTunes main Library or to an iPod? The SDK doesn’t seem to allow that, even with casting of the IITPlaylist to an IITUserPlaylist or IITLibraryPlaylist… iTunes throws an exception.

    Did Apple intentionally block the ability to add tracks to those playlists?

  12. Arie Leeuwesteijn says:

    Hi,

    Wrote an application in C# with .Net framework 2.0 using this API. The application keeps syncs the tracks (and their information) in my MediaPlayer and iTunes database. Tracks that are in MediaPlayer but not in iTunes are automatically added and converted with the artwork for the album. Track information of existing tracks that has been modified in iTunes or MediaPlayer is synced as well.

    Both the MediaPlayer and iTunes SDK have their quircks that I’ve tried to solve in a wrapper library for both. As far as possible the programming model for both is more consistent.

    Somethings to be aware of:

    -When adding a track to iTunes it may be pretty hard to get a reference to that track in order to do things like setting the artwork.

    -In my wrapper classes I’ve implemented the Dispose pattern. When loading many tracks the garbage collector may need some help with so many COM-interopped instances (reduce memory requirements by 75% in my case)

    -When your app is running, DON’T even think about doing anything in the iTunes application that pops up. It will certainly crach the app.

    Have fun, (I did)

    Cheers,

    Arie (aleeuwesteyn@hotmail.com)

  13. slim says:

    I have written a library for parsing the iTunes db in C#, if you use it, please give me some feedback or any problems you had.  Here’s the link.

    http://www.itunessdk.com/blog/itunesdb-library/

  14. Mustafa Umut Sarac says:

    I want to make a program for apple products which extracts the midi of the mp3 or cd  and harmonize it like jaco pastorius and than play with itunes or quicktime midi synthesizer which i added my fretless fender jazz bass samples.

    How can I do it ?

    Whenever you play a sweet jazz song , jaco will accompany it.

    Mustafa Umut Sarac

    mustafaumutsarac@gmail.com