I'm trying to read all playlists and the music file in each playlist.
Here is my code in C#:
iTunesAppClass iTunesAppClass = new iTunesAppClass();
IITSourceCollection sources = iTunesAppClass.Sources;
foreach (IITSource src in sources)
{
if (src.Name == "Library")
{
IITPlaylistCollection pls = src.Playlists;
foreach (IITPlaylist p in pls)
if (p.Kind == ITPlaylistKind.ITPlaylistKindUser)
{
var pname = p.Name;
IITTrackCollection tracks = p.Tracks;
foreach (IITTrack track in tracks)
{
var name = track.Name;
string filename = "???"; // How to get the file name of the mp3 file?
}
}
}
}
So, in the last line, I get Track.Name which seems to be the Title of the song.
How can I get the full path and file name of the track?