using System.Diagnostics;\r
using System.Runtime.InteropServices;\r
using System.IO;\r
-using AxQTOControlLib;\r
using Handbrake.EncodeQueue;\r
using Handbrake.Functions;\r
using QTOControlLib;\r
private delegate void UpdateUIHandler();\r
String currently_playing = "";\r
readonly frmMain mainWindow;\r
- private Process hbProc;\r
private Thread player;\r
private Boolean noQT;\r
\r
}\r
catch (Exception exc)\r
{\r
- MessageBox.Show(mw, "It would appear QuickTime 7 is not installed. QuickTime preview functionality will be disabled! \n\n Debug Info:\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ MessageBox.Show(mw, "It would appear QuickTime 7 is not installed or not accessible. QuickTime preview functionality will be disabled! \n\n Debug Info:\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
btn_playQT.Enabled = false;\r
noQT = true;\r
}\r
btn_playQT.Enabled = false;\r
btn_playVLC.Enabled = false;\r
lbl_status.Text = "Encoding Sample for (VLC) ...";\r
- String query = hb_common_func.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);\r
+ String query = hb_common_func.generatePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);\r
ThreadPool.QueueUserWorkItem(procMonitor, query);\r
}\r
private void btn_playQT_Click(object sender, EventArgs e)\r
btn_playQT.Enabled = false;\r
btn_playVLC.Enabled = false;\r
lbl_status.Text = "Encoding Sample for (QT) ...";\r
- String query = hb_common_func.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);\r
+ String query = hb_common_func.generatePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);\r
ThreadPool.QueueUserWorkItem(procMonitor, query);\r
}\r
private void procMonitor(object state)\r
{\r
// Make sure we are not already encoding and if we are then display an error.\r
- if (hbProc != null)\r
+ if (process.hbProcess != null)\r
MessageBox.Show(this, "Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
else\r
{\r
- hbProc = process.runCli((string)state).hbProcProcess;\r
- hbProc.WaitForExit();\r
- hbProc = null;\r
+ process.runCli((string)state);\r
+ if (process.hbProcess != null)\r
+ {\r
+ process.hbProcess.WaitForExit();\r
+ process.hbProcess = null;\r
+ }\r
encodeCompleted();\r
}\r
}\r