X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmPreview.cs;h=f2356ae6057d1d9bcfd9be419135d307261c29d7;hb=b3d9b074e43038194d0936fa7cdb268145bba52e;hp=7ea4727726685efe4d9597c235a433bf697112e1;hpb=aec9720e178e3c71886a7f5c5e3a263671d9151b;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs index 7ea47277..f2356ae6 100644 --- a/win/C#/frmPreview.cs +++ b/win/C#/frmPreview.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Diagnostics; using System.Runtime.InteropServices; using System.IO; -using AxQTOControlLib; using Handbrake.EncodeQueue; using Handbrake.Functions; using QTOControlLib; @@ -20,7 +19,6 @@ namespace Handbrake private delegate void UpdateUIHandler(); String currently_playing = ""; readonly frmMain mainWindow; - private Process hbProc; private Thread player; private Boolean noQT; @@ -32,7 +30,7 @@ namespace Handbrake } catch (Exception exc) { - 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); + 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); btn_playQT.Enabled = false; noQT = true; } @@ -59,7 +57,7 @@ namespace Handbrake btn_playQT.Enabled = false; btn_playVLC.Enabled = false; lbl_status.Text = "Encoding Sample for (VLC) ..."; - String query = hb_common_func.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text); + String query = hb_common_func.generatePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text); ThreadPool.QueueUserWorkItem(procMonitor, query); } private void btn_playQT_Click(object sender, EventArgs e) @@ -79,19 +77,22 @@ namespace Handbrake btn_playQT.Enabled = false; btn_playVLC.Enabled = false; lbl_status.Text = "Encoding Sample for (QT) ..."; - String query = hb_common_func.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text); + String query = hb_common_func.generatePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text); ThreadPool.QueueUserWorkItem(procMonitor, query); } private void procMonitor(object state) { // Make sure we are not already encoding and if we are then display an error. - if (hbProc != null) + if (process.hbProcess != null) MessageBox.Show(this, "Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning); else { - hbProc = process.runCli((string)state).hbProcProcess; - hbProc.WaitForExit(); - hbProc = null; + process.runCli((string)state); + if (process.hbProcess != null) + { + process.hbProcess.WaitForExit(); + process.hbProcess = null; + } encodeCompleted(); } }