Ejemplo n.º 1
0
 public void KillRip()
 {
     this.ripProcess.Kill();
     this.ripProcess.WaitForExit();
     this.ripProcess.Close();
     MP4AudioRipEventArgs args = new MP4AudioRipEventArgs("Rip terminated.");
     this.OutputReceived(this, args);
     this.RipInProgress = false;
 }
Ejemplo n.º 2
0
        public void Rip(string sourcePath, string destinationPath)
        {
            try {
                this.processStartInfo.Arguments = ARGS.Replace("{source}", sourcePath).Replace("{destination}", destinationPath);
                this.logger.LogEvent(string.Format("Arguments: {0}", this.processStartInfo.Arguments), EventType.Info);

                this.ripProcess = Process.Start(this.processStartInfo);
                this.RipInProgress = true;

                this.ripProcess.Exited += P_Exited;
                this.ripProcess.ErrorDataReceived += P_ErrorDataReceived;
                this.ripProcess.OutputDataReceived += P_OutputDataReceived;

                this.ripProcess.BeginOutputReadLine();
                this.ripProcess.BeginErrorReadLine();
            } catch (Exception ex) {
                this.RipInProgress = false;
                this.logger.LogEvent(ex.ToString(), EventType.Error);
                MP4AudioRipEventArgs args = new MP4AudioRipEventArgs(string.Format("Oops, there was an issue.  Have a look:\r\r{0}", ex.ToString()));
                this.ErrorReceived(this, args);
            }
        }
Ejemplo n.º 3
0
 private void P_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     MP4AudioRipEventArgs args = new MP4AudioRipEventArgs(e.Data);
     this.OutputReceived(sender, args);
 }
Ejemplo n.º 4
0
 private void P_Exited(object sender, EventArgs e)
 {
     MP4AudioRipEventArgs args = new MP4AudioRipEventArgs(e.ToString());
     this.ExitReceived(sender, args);
 }
Ejemplo n.º 5
0
 private void P_ErrorDataReceived(object sender, DataReceivedEventArgs e)
 {
     MP4AudioRipEventArgs args = new MP4AudioRipEventArgs(e.Data);
     this.ErrorReceived(sender, args);
 }
Ejemplo n.º 6
0
        private void OutputReceived(object sender, MP4AudioRipEventArgs args)
        {
            EventHandler<MP4AudioRipEventArgs> handler = OnOutput;

            if (handler != null) {
                handler(this, args);
            }
        }