diff options
author | sr55 <[email protected]> | 2007-12-01 16:07:22 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-12-01 16:07:22 +0000 |
commit | a21eb422126ab935ffe7a6e34f5f50e9f54bfd7b (patch) | |
tree | f4a55873b992e651f85a64c168ef978dda1fbcd4 /win | |
parent | eff4cb31ca2a39852235357cd4a287a1e2eb2085 (diff) |
WinGui:
- Fixed HandBrake CLI process priority level not getting set correctly.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1092 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/Functions/CLI.cs | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/win/C#/Functions/CLI.cs b/win/C#/Functions/CLI.cs index 548148517..259a98c3a 100644 --- a/win/C#/Functions/CLI.cs +++ b/win/C#/Functions/CLI.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Diagnostics;
using System.Windows.Forms;
using System.Globalization;
-
+
namespace Handbrake.Functions
{
@@ -14,10 +14,10 @@ namespace Handbrake.Functions /// CLI output is based on en-US locale,
/// we use this CultureInfo as IFormatProvider to *.Parse() calls
/// </summary>
- static readonly public CultureInfo Culture = new CultureInfo("en-US", false);
+ static readonly public CultureInfo Culture = new CultureInfo("en-US", false);
Process hbProc = new Process();
-
+
public Process runCli(object s, string query, bool stderr, bool stdout, bool useShellExec, bool noWindow)
{
try
@@ -29,7 +29,30 @@ namespace Handbrake.Functions hbProc.StartInfo.RedirectStandardError = stderr;
hbProc.StartInfo.UseShellExecute = useShellExec;
hbProc.StartInfo.CreateNoWindow = noWindow;
- hbProc.Start();
+ hbProc.Start();
+
+ // Set the process Priority
+ switch (Properties.Settings.Default.processPriority)
+ {
+ case "Realtime":
+ hbProc.PriorityClass = ProcessPriorityClass.RealTime;
+ break;
+ case "High":
+ hbProc.PriorityClass = ProcessPriorityClass.High;
+ break;
+ case "Above Normal":
+ hbProc.PriorityClass = ProcessPriorityClass.AboveNormal;
+ break;
+ case "Normal":
+ hbProc.PriorityClass = ProcessPriorityClass.Normal;
+ break;
+ case "Low":
+ hbProc.PriorityClass = ProcessPriorityClass.Idle;
+ break;
+ default:
+ hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;
+ break;
+ }
}
catch
{
@@ -59,6 +82,6 @@ namespace Handbrake.Functions public void setNull()
{
hbProc = new Process();
- }
+ }
}
}
|