- /// Kill the CLI process\r
- /// </summary>\r
- public void Stop()\r
- {\r
- if (HbProcess != null)\r
- HbProcess.Kill();\r
-\r
- Process[] list = Process.GetProcessesByName("HandBrakeCLI");\r
- foreach (Process process in list)\r
- process.Kill();\r
-\r
- IsEncoding = false;\r
-\r
- if (EncodeEnded != null)\r
- EncodeEnded(this, new EventArgs());\r
- }\r
-\r
- /// <summary>\r
- /// Attempt to Safely kill a DirectRun() CLI\r
- /// NOTE: This will not work with a MinGW CLI\r
- /// Note: http://www.cygwin.com/ml/cygwin/2006-03/msg00330.html\r
- /// </summary>\r
- public void SafelyClose()\r
- {\r
- if ((int)ProcessHandle == 0)\r
- return;\r
-\r
- // Allow the CLI to exit cleanly\r
- Win32.SetForegroundWindow((int)ProcessHandle);\r
- SendKeys.Send("^C");\r
-\r
- // HbProcess.StandardInput.AutoFlush = true;\r
- // HbProcess.StandardInput.WriteLine("^C");\r
- }\r
-\r
- /// <summary>\r
- /// Recieve the Standard Error information and process it\r
- /// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private static void HbProcErrorDataReceived(object sender, DataReceivedEventArgs e)\r
- {\r
- // TODO: Recieve the Log data and process it\r
- throw new NotImplementedException();\r
- }\r
-\r
- /// <summary>\r
- /// Standard Input Data Recieved from the CLI\r
- /// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private static void HbProcOutputDataReceived(object sender, DataReceivedEventArgs e)\r
- {\r
- // TODO: Recieve the %, ETA, FPS etc and process it\r
- throw new NotImplementedException();\r
- }\r
-\r
- /// <summary>\r