コード例 #1
0
        public async Task Scan(IFileData[] fileDatas, ReplayGainMode mode)
        {
            using (var task = new ScanTask(this, fileDatas, mode))
            {
                task.InitializeComponent(this.Core);
                this.OnBackgroundTask(task);
                await task.Run().ConfigureAwait(false);

                this.OnReport(fileDatas, task.ScannerItems);
            }
        }
コード例 #2
0
        private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            Process  proc = new Process();
            ScanTask scan = new ScanTask();

            scan.Precision           = Settings.Get <Settings>().Read(Settings.SCANNER, Settings.CALIBRATIONPRECISION, 5);
            scan.UseTexture          = false;
            scan.UseCorrectionMatrix = false;
            scan.FileName            = QuickFileName;
            ScanData data = scan.Run(null, this, sender == null ? null : BackgroundWorker, e, UpdateScanEvent);

            if (sender != null)
            {
                BackgroundWorker.ReportProgress(100, data);
            }
            else
            {
                ProcessScanData(data);
            }
        }