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
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
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
\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