Пример #1
0
		public void SetStatus(object sender, CUEToolsProgressEventArgs e)
		{
			this.BeginInvoke((MethodInvoker)delegate()
			{
				if (e.percent == 0)
				{
					_startedAt = DateTime.Now;
					Text = e.status;
				}
				else if (e.percent > 0.02)
				{
					TimeSpan span = DateTime.Now - _startedAt;
					TimeSpan eta = new TimeSpan ((long) (span.Ticks/e.percent));
					Text = String.Format("{0}, ETA {1}:{2:00}.", e.status, (int)eta.TotalMinutes, eta.Seconds);
				} else
					Text = e.status;
				//progressBar1.Value = Math.Max(0,Math.Min(100,(int)(e.percentTrck*100)));
				progressBar2.Value = Math.Max(0,Math.Min(100,(int)(e.percent*100)));
				string inputSuffix = e.output != null ? "=>" : "";
				if (e.input == null)
					txtInputFile.Text = inputSuffix;
				else 
					txtInputFile.Text = ShortenString(e.input, 120) + " " + inputSuffix;
				if (e.output == null)
					txtOutputFile.Text = "";
				else
					txtOutputFile.Text = ShortenString(e.output, 120);
			});
		}
Пример #2
0
 public void Close()
 {
     if (_progress != null)
     {
         _progress.cueSheet = null;
         _progress = null;
     }
     if (_archive != null)
         _archive.Close();
     _archive = null;
     if (_ripper != null)
     {
         //_ripper.ReadProgress -= new EventHandler<ReadProgressArgs>(CDReadProgress);
         _ripper.Close();
     }
     _ripper = null;
 }
Пример #3
0
 public CUESheet(CUEConfig config)
 {
     _config = config;
     _progress = new CUEToolsProgressEventArgs();
     _progress.cueSheet = this;
     _attributes = new List<CUELine>();
     _tracks = new List<TrackInfo>();
     _trackFilenames = new List<string>();
     _toc = new CDImageLayout();
     _sources = new List<SourceInfo>();
     _sourcePaths = new List<string>();
     _stop = false;
     _pause = false;
     _outputPath = null;
     _paddedToFrame = false;
     _truncated4608 = false;
     _usePregapForFirstTrackInSingleFile = false;
     _action = CUEAction.Encode;
     _appliedWriteOffset = false;
     _minDataTrackLength = null;
     hdcdDecoder = null;
     _hasEmbeddedCUESheet = false;
     _isArchive = false;
     _isCD = false;
     _useLocalDB = false;
     proxy = _config.GetProxy();
 }
Пример #4
0
        public void SetStatus(object sender, CUEToolsProgressEventArgs e)
        {
            if (e.percent == 0)
                _startedAt = DateTime.Now;
            this.BeginInvoke((MethodInvoker)delegate()
            {
                if (e.percent == 0)
                {
                    toolStripStatusLabelProcessed.Visible = false;
                    toolStripProgressBar2.ToolTipText = "";
                }
                else if (e.percent > 0.02)
                {
                    TimeSpan span = DateTime.Now - _startedAt;
                    TimeSpan eta = new TimeSpan((long)(span.Ticks / e.percent));
                    string speedStr = "";
                    if (span.TotalSeconds > 0 && e.offset > 0)
                    {
                        double speed = e.offset / span.TotalSeconds / 44100;
                        speedStr = String.Format("{0:00.00}x", speed);
                    }
                    toolStripProgressBar2.ToolTipText = String.Format("{0}:{1:00}/{2}:{3:00}", (int)span.TotalMinutes, span.Seconds, (int)eta.TotalMinutes, eta.Seconds);
                    toolStripStatusLabelProcessed.Text = String.Format("{0}@{1}", toolStripProgressBar2.ToolTipText, speedStr);
                    toolStripStatusLabelProcessed.Visible = true;
                }
                toolStripStatusLabel1.Text = e.status.Replace("&", "&&");
                toolStripProgressBar2.Value = Math.Max(0, Math.Min(100, (int)(e.percent * 100)));

                toolStripStatusLabelAR.Enabled = e.cueSheet != null && e.cueSheet.ArVerify != null && e.cueSheet.ArVerify.ARStatus == null;
                toolStripStatusLabelAR.Text = e.cueSheet != null && e.cueSheet.ArVerify != null && e.cueSheet.ArVerify.ExceptionStatus == WebExceptionStatus.Success ? e.cueSheet.ArVerify.WorstTotal().ToString() : "";
                toolStripStatusLabelAR.ToolTipText = e.cueSheet != null && e.cueSheet.ArVerify != null ? "AccurateRip: " + (e.cueSheet.ArVerify.ARStatus ?? "found") + "." : "";
                toolStripStatusLabelCTDB.Enabled = e.cueSheet != null && e.cueSheet.CTDB != null && e.cueSheet.CTDB.DBStatus == null;
                toolStripStatusLabelCTDB.Text = e.cueSheet != null && e.cueSheet.CTDB != null && e.cueSheet.CTDB.DBStatus == null ? e.cueSheet.CTDB.Total.ToString() : "";
                toolStripStatusLabelCTDB.ToolTipText = e.cueSheet != null && e.cueSheet.CTDB != null ? "CUETools DB: " + (e.cueSheet.CTDB.DBStatus ?? "found") + "." : "";
            });
        }