diff options
author | sr55 <[email protected]> | 2007-07-06 16:09:50 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-07-06 16:09:50 +0000 |
commit | ea517880e60df50976cfaeb53a6c7bf95d69fc5f (patch) | |
tree | 3bed60def099a7bab68e93fa24c07db67be3eaa5 | |
parent | 799ff89a9d58c2ce527054cb55ed276e2c34974e (diff) |
WinGui:
- Few changes to the way hbcli.exe is executed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@654 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/Handbrake/frmMain.vb | 22 | ||||
-rw-r--r-- | win/Handbrake/frmQueue.vb | 23 |
2 files changed, 42 insertions, 3 deletions
diff --git a/win/Handbrake/frmMain.vb b/win/Handbrake/frmMain.vb index b68de8c8b..0ee971851 100644 --- a/win/Handbrake/frmMain.vb +++ b/win/Handbrake/frmMain.vb @@ -502,6 +502,7 @@ Public Class frmMain Dim params As String = query
Dim proc As New System.Diagnostics.Process
proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)
+
If My.Settings.Priority <> "Normal" Then
Dim level As String
level = My.Settings.Priority
@@ -518,8 +519,6 @@ Public Class frmMain Case "Low"
proc.PriorityClass = ProcessPriorityClass.Idle
End Select
-
-
End If
MessageBox.Show("The Handbrake encoder (CLI) will now start and should be encoding your video.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
@@ -534,6 +533,25 @@ Public Class frmMain Dim params As String = query
Dim proc As New System.Diagnostics.Process
proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)
+
+ If My.Settings.Priority <> "Normal" Then
+ Dim level As String
+ level = My.Settings.Priority
+
+ Select Case level
+ Case "Realtime"
+ proc.PriorityClass = ProcessPriorityClass.RealTime
+ Case "High"
+ proc.PriorityClass = ProcessPriorityClass.High
+ Case "Above Normal"
+ proc.PriorityClass = ProcessPriorityClass.AboveNormal
+ Case "Below Normal"
+ proc.PriorityClass = ProcessPriorityClass.BelowNormal
+ Case "Low"
+ proc.PriorityClass = ProcessPriorityClass.Idle
+ End Select
+ End If
+
MessageBox.Show("The Handbrake encoder (CLI) will now start and should be encoding your video.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
'Lets start the process monitor to keep an eye on things.
diff --git a/win/Handbrake/frmQueue.vb b/win/Handbrake/frmQueue.vb index b0786eb98..a49b015bc 100644 --- a/win/Handbrake/frmQueue.vb +++ b/win/Handbrake/frmQueue.vb @@ -31,7 +31,28 @@ Public Class frmQueue 'Start the encode process
Try
- Shell("""" + ApplicationPath + "\hbcli.exe""" + list_queue.Items.Item(encodeItems))
+ Dim params As String = list_queue.Items.Item(encodeItems)
+ Dim proc As New System.Diagnostics.Process
+ proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)
+
+ If My.Settings.Priority <> "Normal" Then
+ Dim level As String
+ level = My.Settings.Priority
+
+ Select Case level
+ Case "Realtime"
+ proc.PriorityClass = ProcessPriorityClass.RealTime
+ Case "High"
+ proc.PriorityClass = ProcessPriorityClass.High
+ Case "Above Normal"
+ proc.PriorityClass = ProcessPriorityClass.AboveNormal
+ Case "Below Normal"
+ proc.PriorityClass = ProcessPriorityClass.BelowNormal
+ Case "Low"
+ proc.PriorityClass = ProcessPriorityClass.Idle
+ End Select
+ End If
+
Catch ex As Exception
MessageBox.Show("Unable to launch the encoder. Queue run failed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand)
MessageBox.Show(ex.ToString)
|