Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        // 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);
        }