2 using System.Collections.Generic;
\r
3 using System.Threading;
\r
4 using System.Diagnostics;
\r
5 using System.Windows.Forms;
\r
8 namespace Handbrake.Functions
\r
12 Process hbProc = new Process();
\r
14 public Process runCli(object s, string query, bool stderr, bool stdout, bool useShellExec, bool noWindow)
\r
16 hbProc.StartInfo.FileName = "hbcli.exe";
\r
17 hbProc.StartInfo.Arguments = query;
\r
18 hbProc.StartInfo.RedirectStandardOutput = stdout;
\r
19 hbProc.StartInfo.RedirectStandardError = stderr;
\r
20 hbProc.StartInfo.UseShellExecute = useShellExec;
\r
21 hbProc.StartInfo.CreateNoWindow = noWindow;
\r
24 // Set the process Priority
\r
25 switch (Properties.Settings.Default.processPriority)
\r
28 hbProc.PriorityClass = ProcessPriorityClass.RealTime;
\r
31 hbProc.PriorityClass = ProcessPriorityClass.High;
\r
33 case "Above Normal":
\r
34 hbProc.PriorityClass = ProcessPriorityClass.AboveNormal;
\r
37 hbProc.PriorityClass = ProcessPriorityClass.Normal;
\r
40 hbProc.PriorityClass = ProcessPriorityClass.Idle;
\r
43 hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;
\r
49 public void killCLI()
\r
57 // No need to do anything. Chances are the process was already dead.
\r
61 public void closeCLI()
\r