public static void Instance(Window parent, IProcessWorker 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(); }
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(); } }); }; } }); }
public override void DisplayError(IProcessWorker host) { Application.Current.Dispatcher.Invoke(() => FFmpegErrorWindow.Instance(parent, host)); }