private static void getLibrary() { iTunesApp app = new iTunesApp(); app.ForceToForegroundOnDialog = true; IITTrackCollection tc = app.LibraryPlaylist.Tracks; Controller.ShowMessage(tc.Count.ToString() + " tracks found..."); List <string> tracks = new List <string>(); foreach (IITTrack t in tc) { if (Cancel) { break; } if (t.Kind == ITTrackKind.ITTrackKindFile) { string l = (t as IITFileOrCDTrack).Location; Controller.ShowMessage(t.Name); tracks.Add(l); } } if (!Cancel) { FileAdder.AddItemsToLibrary(tracks, String.Empty, true, Controller.GetInstance().RefreshAll); } }
// File Adding public static void AddFolder(Callback Callback) { string DirectoryPath = Lib.GetUserSelectedFolder(Application.ProductName + " will add all the music files at or below this folder:", String.Empty, false); if (String.IsNullOrEmpty(DirectoryPath) || !Directory.Exists(DirectoryPath)) { return; } FileAdder.AddItemsToLibrary(new string[] { DirectoryPath }, String.Empty, true, Callback); }