My Music\artist\album\song.mp3
This has worked fine so far because I can create playlists that group music independent of where it lives in the filesystem. iTunes can create a flat MP3 CD of a playlist, but that’s not ideal. What I’d like is to have a directory for each playlist on the CD, with the files from that playlist in them.
Luckily, iTunes keeps your playlists in an XML file. I hacked up something in C# to parse the XML and enumerate my playlists. Then I mucked around all afternoon trying to figure out the best way to tell the CD burner what to do with that list.
After toying with mkisofs and XP’s IMAPI CD burning interface, I figured out I can just copy the files to XP’s CD staging area. So I rewrote my program to create directories for each playlist in the staging area, then copy the files from those playlists into the directories. Once that’s done, XP’s wizard takes care of the burning. Tada!
This is the first thing I’ve written in C# beyond “Hello World!”, so if you look at it, please be gentle :P
CDSetup.cs

SHGetFolderPathisSystem.Environment.GetFolderPath. However, that method takes aSystem.SpecialFolderenumeration argument, and while there is aSpecialFolder.MyMusicvalue, I do not see a value for the CD Burning folder.You could always try using a cast
Environment.GetFolderPath((SpecialFolder)CSIDL_CDBURN_AREA), but if the method checks the argument for a valid value before calling the system it will likely throw anArgumentException.