예제 #1
0
 public void DisplayTask(FFmpegProcess taskArg)
 {
     Dispatcher.Invoke(() => {
         if (taskArg.Options.IsMainTask)
         {
             host                = taskArg;
             host.InfoUpdated   += FFmpeg_InfoUpdated;
             host.StatusUpdated += FFmpeg_StatusUpdated;
             host.Completed     += FFmpeg_Completed;
             PercentText.Text    = 0.ToString("p1");
             SetPageTitle(PercentText.Text);
         }
         else
         {
             task = taskArg;
             TaskStatusText.Text = task.Options.Title;
             task.Completed     += (sender, e) => {
                 FFmpegProcess Proc = (FFmpegProcess)sender;
                 Dispatcher.Invoke(() => {
                     if (e.Status == CompletionStatus.Error && !Proc.WorkProcess.StartInfo.FileName.EndsWith("avs2yuv.exe"))
                     {
                         FFmpegErrorWindow.Instance(Owner, Proc);
                     }
                     TaskStatusText.Text = "";
                     task = null;
                     if (autoClose)
                     {
                         this.Close();
                     }
                 });
             };
         }
     });
 }
예제 #2
0
        public static void Instance(Window parent, IProcessManager host)
        {
            FFmpegErrorWindow F = new FFmpegErrorWindow();

            F.Owner           = parent;
            F.Title           = (host.LastCompletionStatus == CompletionStatus.Timeout ? "Timeout: " : "Failed: ") + host.Options.Title;
            F.OutputText.Text = host.CommandWithArgs + Environment.NewLine + Environment.NewLine + host.Output;
            F.Show();
        }
예제 #3
0
 private void FFmpeg_Completed(object sender, FFmpeg.CompletedEventArgs e)
 {
     Dispatcher.Invoke(() => {
         FFmpegProcess Proc = sender as FFmpegProcess;
         if (e.Status == CompletionStatus.Error && !Proc.WorkProcess.StartInfo.FileName.EndsWith("avs2yuv.exe"))
         {
             FFmpegErrorWindow.Instance(Owner, Proc);
         }
         if (autoClose)
         {
             this.Close();
         }
     });
 }
 public override void DisplayError(FFmpegProcess host)
 {
     Application.Current.Dispatcher.Invoke(() => FFmpegErrorWindow.Instance(parent, host));
 }