private void FFmpeg_Completed(object sender, ProcessCompletedEventArgs e)
 {
     Dispatcher.Invoke(() => {
         ProcessWorker Proc = sender as ProcessWorker;
         if (e.Status == CompletionStatus.Failed && !Proc.WorkProcess.StartInfo.FileName.EndsWith("avs2pipemod.exe"))
         {
             FFmpegErrorWindow.Instance(Owner, Proc);
         }
         if (autoClose)
         {
             this.Close();
         }
     });
 }
 public void DisplayTask(IProcessWorker taskArg)
 {
     Dispatcher.Invoke(() => {
         if (taskArg.Options.IsMainTask)
         {
             host       = taskArg;
             hostFFmpeg = host as IProcessWorkerEncoder;
             if (hostFFmpeg != null)
             {
                 hostFFmpeg.FileInfoUpdated  += FFmpeg_InfoUpdated;
                 hostFFmpeg.ProgressReceived += FFmpeg_StatusUpdated;
             }
             host.ProcessCompleted += FFmpeg_Completed;
             PercentText.Text       = 0.ToString("p1");
             SetPageTitle(PercentText.Text);
         }
         else
         {
             task = taskArg;
             TaskStatusText.Text    = task.Options.Title;
             task.ProcessCompleted += (sender, e) => {
                 ProcessWorker Proc = (ProcessWorker)sender;
                 Dispatcher.Invoke(() => {
                     if (e.Status == CompletionStatus.Failed && !Proc.WorkProcess.StartInfo.FileName.EndsWith("avs2pipemod.exe"))
                     {
                         FFmpegErrorWindow.Instance(Owner, Proc);
                     }
                     TaskStatusText.Text = "";
                     task = null;
                     if (autoClose)
                     {
                         this.Close();
                     }
                 });
             };
         }
     });
 }
Пример #3
0
 public override void DisplayError(IProcessWorker host)
 {
     Application.Current.Dispatcher.Invoke(() => FFmpegErrorWindow.Instance(parent, host));
 }