2 using System.Collections.Generic;
\r
3 using System.Threading;
\r
4 using System.Diagnostics;
\r
5 using System.Windows.Forms;
\r
6 using System.Globalization;
\r
9 namespace Handbrake.Functions
\r
14 /// CLI output is based on en-US locale,
\r
15 /// we use this CultureInfo as IFormatProvider to *.Parse() calls
\r
17 static readonly public CultureInfo Culture = new CultureInfo("en-US", false);
\r
19 Process hbProc = new Process();
\r
21 public Process runCli(object s, string query, bool stderr, bool stdout, bool useShellExec, bool noWindow)
\r
25 hbProc = new Process();
\r
26 hbProc.StartInfo.FileName = "HandBrakeCLI.exe";
\r
27 hbProc.StartInfo.Arguments = query;
\r
28 hbProc.StartInfo.RedirectStandardOutput = stdout;
\r
29 hbProc.StartInfo.RedirectStandardError = stderr;
\r
30 hbProc.StartInfo.UseShellExecute = useShellExec;
\r
31 hbProc.StartInfo.CreateNoWindow = noWindow;
\r
34 // Set the process Priority
\r
35 switch (Properties.Settings.Default.processPriority)
\r
38 hbProc.PriorityClass = ProcessPriorityClass.RealTime;
\r
41 hbProc.PriorityClass = ProcessPriorityClass.High;
\r
43 case "Above Normal":
\r
44 hbProc.PriorityClass = ProcessPriorityClass.AboveNormal;
\r
47 hbProc.PriorityClass = ProcessPriorityClass.Normal;
\r
50 hbProc.PriorityClass = ProcessPriorityClass.Idle;
\r
53 hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;
\r
59 MessageBox.Show("Internal Software Error. Please Restart the Program");
\r
64 public void killCLI()
\r
72 // No need to do anything. Chances are the process was already dead.
\r
76 public void closeCLI()
\r
82 public void setNull()
\r
84 hbProc = new Process();
\r