Esempio n. 1
0
        private void graphicalButton2_Click(object sender, EventArgs e)
        {
            lblPercent.Visible = true;
            lblPercent.Text    = "0 %";

            lblStatus.Visible = true;
            lblStatus.Text    = "Scanning...";

            pbStatus.Value   = 0;
            pbStatus.Visible = true;

            gScanner      = new DigitalMediaScanner();
            gScanner.Path = @"c:\music";

            gScanner.MediaOut = new MediaUpdate(MediaManager.SaveMediaToLibrary);
            gScanner.SupportedFormats.Add("MP3");
            gScanner.MediaUpdateSize      = 1000;
            gScanner.ScanProgressChanged += new ProgressDelegate(ProgressChanged);
            gScanner.FinishScaning       += new FinishHandler(FinishScaning);

            MediaManager.ClearMediaLibrary();

            gScanner.StartScan();
            btnStartScan.Text = "Building...";
        }
Esempio n. 2
0
        public void ScanMedia(bool pFullScan)
        {
            if (pFullScan)
            {
                AppMain.MediaManager.ClearMediaLibrary();
            }
            var scanner = new DigitalMediaScanner();

            scanner.Path = AppMain.Settings.MusicPath;
            scanner.SupportedFormats.Add("MP3");
            scanner.MediaOut       += AppMain.MediaManager.SaveMediaToLibrary;
            scanner.MediaUpdateSize = 100;
            scanner.FullScan        = pFullScan;
            scanner.StartScan();
            scanner.ProgressChanged += (s, e) => DebugHandler.DebugPrint("Media Scan: " + e.Percent + " percent " + e.Status);
            scanner.Finish          += (s, e) =>
            {
                DebugHandler.DebugPrint("Finished with " + e.TotalCount + " total items " + e.TotalTime.TotalSeconds + " total seconds");
                new MediaGroupCreater().ReCreateArtistAlbumGroupCreation();
                var artScanner = new AlbumArtScanner();
                _runningTasks.Add(artScanner);
                artScanner.StartScan();
            };
            _runningTasks.Add(scanner);
        }