OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 6 Jul 2007 16:09:50 +0000 (16:09 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 6 Jul 2007 16:09:50 +0000 (16:09 +0000)
- Few changes to the way hbcli.exe is executed.

git-svn-id: svn://localhost/HandBrake/trunk@654 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/Handbrake/frmMain.vb
win/Handbrake/frmQueue.vb

index b68de8c..0ee9718 100644 (file)
@@ -502,6 +502,7 @@ Public Class frmMain
                 Dim params As String = query\r
                 Dim proc As New System.Diagnostics.Process\r
                 proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)\r
+\r
                 If My.Settings.Priority <> "Normal" Then\r
                     Dim level As String\r
                     level = My.Settings.Priority\r
@@ -518,8 +519,6 @@ Public Class frmMain
                         Case "Low"\r
                             proc.PriorityClass = ProcessPriorityClass.Idle\r
                     End Select\r
-\r
-\r
                 End If\r
 \r
                 MessageBox.Show("The Handbrake encoder (CLI) will now start and should be encoding your video.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)\r
@@ -534,6 +533,25 @@ Public Class frmMain
                 Dim params As String = query\r
                 Dim proc As New System.Diagnostics.Process\r
                 proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)\r
+\r
+                If My.Settings.Priority <> "Normal" Then\r
+                    Dim level As String\r
+                    level = My.Settings.Priority\r
+\r
+                    Select Case level\r
+                        Case "Realtime"\r
+                            proc.PriorityClass = ProcessPriorityClass.RealTime\r
+                        Case "High"\r
+                            proc.PriorityClass = ProcessPriorityClass.High\r
+                        Case "Above Normal"\r
+                            proc.PriorityClass = ProcessPriorityClass.AboveNormal\r
+                        Case "Below Normal"\r
+                            proc.PriorityClass = ProcessPriorityClass.BelowNormal\r
+                        Case "Low"\r
+                            proc.PriorityClass = ProcessPriorityClass.Idle\r
+                    End Select\r
+                End If\r
+\r
                 MessageBox.Show("The Handbrake encoder (CLI) will now start and should be encoding your video.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)\r
 \r
                 'Lets start the process monitor to keep an eye on things.\r
index b0786eb..a49b015 100644 (file)
@@ -31,7 +31,28 @@ Public Class frmQueue
 \r
         'Start the encode process\r
         Try\r
-            Shell("""" + ApplicationPath + "\hbcli.exe""" + list_queue.Items.Item(encodeItems))\r
+            Dim params As String = list_queue.Items.Item(encodeItems)\r
+            Dim proc As New System.Diagnostics.Process\r
+            proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)\r
+\r
+            If My.Settings.Priority <> "Normal" Then\r
+                Dim level As String\r
+                level = My.Settings.Priority\r
+\r
+                Select Case level\r
+                    Case "Realtime"\r
+                        proc.PriorityClass = ProcessPriorityClass.RealTime\r
+                    Case "High"\r
+                        proc.PriorityClass = ProcessPriorityClass.High\r
+                    Case "Above Normal"\r
+                        proc.PriorityClass = ProcessPriorityClass.AboveNormal\r
+                    Case "Below Normal"\r
+                        proc.PriorityClass = ProcessPriorityClass.BelowNormal\r
+                    Case "Low"\r
+                        proc.PriorityClass = ProcessPriorityClass.Idle\r
+                End Select\r
+            End If\r
+\r
         Catch ex As Exception\r
             MessageBox.Show("Unable to launch the encoder. Queue run failed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand)\r
             MessageBox.Show(ex.ToString)\r