I have often thought that iTunes for windows could be better. I've been developing a program which used the iTunes COM interface for a while now, called iRank. For the most part, iTunes has been fairly good to me, and any inneficiencies I have managed to work around. But in recent testing, I was confronted with a rather alarming error message which iTunes sent my application (pictured on the right).
Catastrophic: (adj) Causing ruin or destruction.
Now, I'm not normally one to panic, but this did not look like a good thing. iTunes has handed me a few null-reference errors in the past which weren't too scary, but this one seemed like a pretty big deal. I do not normally consider my computer as a place for ruin or destruction, and being told otherwise was a bit of a shock to me.
Oddly enough, I couldn't actually spot anything out of place after this error occured. I tried to recreate it, but it seemed to be shy, and I couldn't reproduce it.
This afternoon however, it struck again. But this time, I figured out why:
For every Playlist in iTunes, there is a function called PlayFirstTrack(), which does exactly what you might imagine. However, if there are no tracks in said playlist, what is iTunes to do?
Personally, I would have said that it might raise some sort of Empty Playlist error, or maybe Track Not Found.
The iTunes programmers, it seems, disagree. For this is the exact circumstance which raises the previously mentioned Catastrophic Failure error message. I know iTunes dearly loves to play music, but is it really that much of a catastrophe if it has no tracks to play?







