/// <summary> /// Gets all playlists that are present in iTunes library. /// </summary> /// <remarks> /// The playlist will also be indexed in playlistLookupTable with IPlaylist as key and IITPlaylist as value for easy retrieval of iTunes COM objects. /// </remarks> /// <returns>An enumeration of all playlists in iTunes. </returns> protected IEnumerable<IPlaylist> GetPlaylists() { List<IPlaylist> playlists = new List<IPlaylist>(); IITSource library = app.Sources.ItemByName["Library"]; foreach (IITPlaylist item in library.Playlists) { IPlaylist pls = new Playlist(item.playlistID, item.Name, false, PlaylistKind.Playlist, new IITTrackEnumerator(item)); playlists.Add(pls); playlistLookupTable.Add(pls.GetSafeName(), item); } return playlists; }