]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Fri, 6 Jul 2007 16:09:50 +0000 (16:09 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 6 Jul 2007 16:09:50 +0000 (16:09 +0000)
- Few changes to the way hbcli.exe is executed.

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

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

index b68de8c8b11d0c292312c58a33af3a51cc86271f..0ee971851cdd484430b78138f5c0a45682e372af 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 b0786eb986e491dc884a8b9395eaa9fead3b4fb3..a49b015bc7a8eab45e590fce188d12f724d92d90 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