I downloaded a zipped archive from Apple that consists of a C++ header file and source. Included in this was a help file. For some reason 开发者_StackOverflowthis help file opens but I cannot read the content. Is there any other documentation outside of a help file for this? For c++ or c#?
If you are on Windows, you probably are looking for the "iTunes COM for Windows SDK".
Get a free ADC login here if you haven't done so already. Once you have done that, you can go to http://connect.apple.com and log in.
Click on "Developer Tools", and somewhere in the massive list of results is "iTunes COM for Windows SDK". Download that, it's just an ordinary zip file, and somewhere in there is a directory named iTunesCOMWindowsSDK. In that directory, there is a iTunesCOM.chm file that contains all the reference material you need.
If this is the help file you already have, you could consider decompiling the chm file using the hh.exe tool that comes with Windows.
It seems the only source for the iTunes COM documentation is now archived on github by https://stackoverflow.com/users/188792/joshkunz
The nice web page is here
http://www.joshkunz.com/iTunesControl/
And the github project is here
https://github.com/Joshkunz/iTunesControl
Solved.. The problem was a Windows Security feature was blocking the compiled help file from opening. I found the solution here:
http://weblog.helpware.net/?p=36
Note: this is not relevant but it feels like this code complements the question nicely - I would have put this in comments but comments don't seem to allow code formatting (d'uh).
Anyway, here is a C# example of how to dump all songs in the library:
dynamic iTunesApplication = Activator.CreateInstance(Type.GetTypeFromProgID("iTunes.Application"));
dynamic mainPlaylist = iTunesApplication.LibraryPlaylist;
for (int i = 1; i <= mainPlaylist.Tracks.Count; i++)
{
dynamic track = mainPlaylist.Tracks.Item(i);
Console.WriteLine(track.Location);
}
Thanks to Hogan for the great pointer to the documentation!
精彩评论