+ #region Playback\r
+\r
+ /// <summary>\r
+ /// Play the video back in the QuickTime control\r
+ /// </summary>\r
+ private void play()\r
+ {\r
+ player = new Thread(OpenMovie) { IsBackground = true };\r
+ player.Start();\r
+ lbl_status.Visible = false;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Play the video back in an external VLC player\r
+ /// </summary>\r
+ private void playVLC()\r
+ {\r
+ // Launch VLC and play video.\r
+ if (currently_playing != "")\r
+ {\r
+ if (File.Exists(currently_playing))\r
+ {\r
+ if (File.Exists(Properties.Settings.Default.VLC_Path))\r
+ {\r
+ String args = "\"" + currently_playing + "\"";\r
+ ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);\r
+ Process.Start(vlc);\r
+ lbl_status.Text = "VLC will now launch.";\r
+ }\r
+ else\r
+ MessageBox.Show(this, "Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\") ", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
+ else\r
+ MessageBox.Show(this, "Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
+ lbl_status.Visible = false;\r
+ }\r
+\r
+ /// <summary>\r
+ /// QT control - Open the file\r
+ /// </summary>\r
+ [STAThread]\r
+ private void OpenMovie()\r
+ {\r
+ try\r
+ {\r
+ if (InvokeRequired)\r
+ {\r
+ BeginInvoke(new UpdateUIHandler(OpenMovie));\r
+ return;\r
+ }\r
+ QTControl.URL = currently_playing;\r
+ QTControl.SetSizing(QTSizingModeEnum.qtControlFitsMovie, true);\r
+ QTControl.URL = currently_playing;\r
+ QTControl.Show();\r
+\r
+ this.ClientSize = QTControl.Size;\r
+ this.Height += 25;\r
+ }\r
+ catch (COMException ex)\r
+ {\r
+ QTUtils qtu = new QTUtils();\r
+ MessageBox.Show(this, "Unable to open movie:\n\nError Code: " + ex.ErrorCode.ToString("X") + "\nQT Error code : " + qtu.QTErrorFromErrorCode(ex.ErrorCode), "QT", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ MessageBox.Show(this, "Unable to open movie:\n\n" + ex, "QT", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
+ }\r
+ #endregion\r