summaryrefslogtreecommitdiffstats
path: root/win/C#
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-05-11 12:49:29 +0000
committersr55 <[email protected]>2009-05-11 12:49:29 +0000
commit1eb2b7d6ddca6483b56c709b6690833170d80c4b (patch)
tree1f70a02d43be7b51faacd0b915acea3ea01e3e0b /win/C#
parent7dc573fdd16e755123456f03b48b4c13c78a7d84 (diff)
# Changed
- Initial work for multi-instance support. All CLI processes controled by their process ID, not Name. This prevents a scan from 1 instance killing a CLI encode from another. # Fixed - Disable angle dropdown when not using Libdvdnav - Fixed issue with angle dropdown where first item is not selected. This caused the generate query to break due to "--angle" with no value. - Fixed issue with the dropdown menu setup on the audio tab not working correctly due to updated encoder names and DTS support. - Fixed an exception conditon on cancel scan. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2412 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r--win/C#/Functions/Encode.cs68
-rw-r--r--win/C#/Functions/QueryGenerator.cs5
-rw-r--r--win/C#/Presets/PresetsHandler.cs5
-rw-r--r--win/C#/frmMain.Designer.cs136
-rw-r--r--win/C#/frmMain.cs105
5 files changed, 180 insertions, 139 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs
index 870c24a90..044fad359 100644
--- a/win/C#/Functions/Encode.cs
+++ b/win/C#/Functions/Encode.cs
@@ -41,6 +41,7 @@ namespace Handbrake.Functions
if (Properties.Settings.Default.cli_minimized == "Checked")
cliStart.WindowStyle = ProcessWindowStyle.Minimized;
hbProc = Process.Start(cliStart);
+ processID = hbProc.Id;
isEncoding = true;
currentQuery = query;
@@ -137,40 +138,36 @@ namespace Handbrake.Functions
/// <param name="destination"></param>
public void copyLog(string destination)
{
- // The user may wish to do something with the log.
- if (Properties.Settings.Default.saveLogToSpecifiedPath == "Checked")
+ try
{
- try
- {
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- string tempLogFile = Path.Combine(logDir, "last_encode_log.txt");
-
- string encodeDestinationPath = Path.GetDirectoryName(destination);
- String[] destName = destination.Split('\\');
- string destinationFile = destName[destName.Length - 1];
- string encodeLogFile = DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + " " + destinationFile + ".txt";
-
- // Make sure the log directory exists.
- if (!Directory.Exists(logDir))
- Directory.CreateDirectory(logDir);
-
- // Copy the Log to HandBrakes log folder in the users applciation data folder.
- File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
-
- // Save a copy of the log file in the same location as the enocde.
- if (Properties.Settings.Default.saveLogWithVideo == "Checked")
- File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
-
- // Save a copy of the log file to a user specified location
- if (Directory.Exists(Properties.Settings.Default.saveLogPath))
- if (Properties.Settings.Default.saveLogPath != String.Empty && Properties.Settings.Default.saveLogToSpecifiedPath == "Checked")
- File.Copy(tempLogFile, Path.Combine(Properties.Settings.Default.saveLogPath, encodeLogFile));
- }
- catch (Exception exc)
- {
- MessageBox.Show("Something went a bit wrong trying to copy your log file.\nError Information:\n\n" + exc, "Error",
- MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ string tempLogFile = Path.Combine(logDir, "last_encode_log.txt");
+
+ string encodeDestinationPath = Path.GetDirectoryName(destination);
+ String[] destName = destination.Split('\\');
+ string destinationFile = destName[destName.Length - 1];
+ string encodeLogFile = DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + " " + destinationFile + ".txt";
+
+ // Make sure the log directory exists.
+ if (!Directory.Exists(logDir))
+ Directory.CreateDirectory(logDir);
+
+ // Copy the Log to HandBrakes log folder in the users applciation data folder.
+ File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
+
+ // Save a copy of the log file in the same location as the enocde.
+ if (Properties.Settings.Default.saveLogWithVideo == "Checked")
+ File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
+
+ // Save a copy of the log file to a user specified location
+ if (Directory.Exists(Properties.Settings.Default.saveLogPath))
+ if (Properties.Settings.Default.saveLogPath != String.Empty && Properties.Settings.Default.saveLogToSpecifiedPath == "Checked")
+ File.Copy(tempLogFile, Path.Combine(Properties.Settings.Default.saveLogPath, encodeLogFile));
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Something went a bit wrong trying to copy your log file.\nError Information:\n\n" + exc, "Error",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -184,5 +181,10 @@ namespace Handbrake.Functions
/// </summary>
public String currentQuery { get; set; }
+ /// <summary>
+ /// Get the process ID of the current encode.
+ /// </summary>
+ public int processID { get; set; }
+
}
}
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index f2a083afe..e043d85fc 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -34,8 +34,9 @@ namespace Handbrake.Functions
query += " -t " + titleInfo[0];
}
- if (mainWindow.drop_angle.SelectedIndex != 0)
- query += " --angle " + mainWindow.drop_angle.SelectedItem;
+ if (Properties.Settings.Default.dvdnav == "Checked")
+ if (mainWindow.drop_angle.Items.Count != 0)
+ query += " --angle " + mainWindow.drop_angle.SelectedItem;
if (mainWindow.drop_chapterFinish.Text == mainWindow.drop_chapterStart.Text && mainWindow.drop_chapterStart.Text != "Auto")
query += " -c " + mainWindow.drop_chapterStart.Text;
diff --git a/win/C#/Presets/PresetsHandler.cs b/win/C#/Presets/PresetsHandler.cs
index 2ba6acc37..413294538 100644
--- a/win/C#/Presets/PresetsHandler.cs
+++ b/win/C#/Presets/PresetsHandler.cs
@@ -384,6 +384,11 @@ namespace Handbrake.Presets
return false;
}
+ /// <summary>
+ /// Check if the built in presets stored are not out of date.
+ /// Update them if they are.
+ /// </summary>
+ /// <returns></returns>
public Boolean checkIfPresetsAreOutOfDate()
{
loadPresetData();
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs
index 6cab7baba..a732cf275 100644
--- a/win/C#/frmMain.Designer.cs
+++ b/win/C#/frmMain.Designer.cs
@@ -110,7 +110,7 @@ namespace Handbrake
this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnu_qptest = new System.Windows.Forms.ToolStripMenuItem();
this.gb_source = new System.Windows.Forms.GroupBox();
- this.label4 = new System.Windows.Forms.Label();
+ this.lbl_angle = new System.Windows.Forms.Label();
this.Label13 = new System.Windows.Forms.Label();
this.Label17 = new System.Windows.Forms.Label();
this.Label9 = new System.Windows.Forms.Label();
@@ -183,14 +183,9 @@ namespace Handbrake
this.Check_ChapterMarkers = new System.Windows.Forms.CheckBox();
this.tabs_panel = new System.Windows.Forms.TabControl();
this.tab_Filters = new System.Windows.Forms.TabPage();
- this.ctl_deinterlace = new Handbrake.Deinterlace();
- this.ctl_denoise = new Handbrake.Denoise();
- this.ctl_decomb = new Handbrake.Decomb();
- this.ctl_detelecine = new Handbrake.Detelecine();
this.tab_chapters = new System.Windows.Forms.TabPage();
this.label31 = new System.Windows.Forms.Label();
this.h264Tab = new System.Windows.Forms.TabPage();
- this.x264Panel = new Handbrake.Controls.x264Panel();
this.tab_query = new System.Windows.Forms.TabPage();
this.btn_clear = new System.Windows.Forms.Button();
this.label34 = new System.Windows.Forms.Label();
@@ -225,6 +220,11 @@ namespace Handbrake
this.StatusStrip = new System.Windows.Forms.StatusStrip();
this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();
this.hbproc = new System.Diagnostics.Process();
+ this.ctl_deinterlace = new Handbrake.Deinterlace();
+ this.ctl_denoise = new Handbrake.Denoise();
+ this.ctl_decomb = new Handbrake.Decomb();
+ this.ctl_detelecine = new Handbrake.Detelecine();
+ this.x264Panel = new Handbrake.Controls.x264Panel();
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
notifyIconMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();
@@ -716,13 +716,13 @@ namespace Handbrake
//
// drop_angle
//
+ this.drop_angle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.drop_angle.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.drop_angle.FormattingEnabled = true;
this.drop_angle.Location = new System.Drawing.Point(250, 52);
this.drop_angle.Name = "drop_angle";
this.drop_angle.Size = new System.Drawing.Size(45, 21);
this.drop_angle.TabIndex = 45;
- this.drop_angle.Text = "1";
this.ToolTip.SetToolTip(this.drop_angle, "Select the chapter range you would like to enocde. (default: All Chapters)");
//
// lbl_src_res
@@ -998,7 +998,7 @@ namespace Handbrake
// gb_source
//
this.gb_source.Controls.Add(this.drop_angle);
- this.gb_source.Controls.Add(this.label4);
+ this.gb_source.Controls.Add(this.lbl_angle);
this.gb_source.Controls.Add(this.lbl_duration);
this.gb_source.Controls.Add(this.label_duration);
this.gb_source.Controls.Add(this.Label13);
@@ -1018,16 +1018,16 @@ namespace Handbrake
this.gb_source.TabStop = false;
this.gb_source.Text = "Source";
//
- // label4
+ // lbl_angle
//
- this.label4.AutoSize = true;
- this.label4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label4.ForeColor = System.Drawing.Color.Black;
- this.label4.Location = new System.Drawing.Point(200, 55);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(44, 13);
- this.label4.TabIndex = 44;
- this.label4.Text = "Angle:";
+ this.lbl_angle.AutoSize = true;
+ this.lbl_angle.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_angle.ForeColor = System.Drawing.Color.Black;
+ this.lbl_angle.Location = new System.Drawing.Point(200, 55);
+ this.lbl_angle.Name = "lbl_angle";
+ this.lbl_angle.Size = new System.Drawing.Size(44, 13);
+ this.lbl_angle.TabIndex = 44;
+ this.lbl_angle.Text = "Angle:";
//
// Label13
//
@@ -1877,48 +1877,6 @@ namespace Handbrake
this.tab_Filters.Text = "Video Filters";
this.tab_Filters.UseVisualStyleBackColor = true;
//
- // ctl_deinterlace
- //
- this.ctl_deinterlace.AutoSize = true;
- this.ctl_deinterlace.Location = new System.Drawing.Point(19, 95);
- this.ctl_deinterlace.Margin = new System.Windows.Forms.Padding(0);
- this.ctl_deinterlace.MaximumSize = new System.Drawing.Size(400, 30);
- this.ctl_deinterlace.Name = "ctl_deinterlace";
- this.ctl_deinterlace.Size = new System.Drawing.Size(275, 28);
- this.ctl_deinterlace.TabIndex = 41;
- this.ctl_deinterlace.onChange += new System.EventHandler(this.ctl_deinterlace_changed);
- //
- // ctl_denoise
- //
- this.ctl_denoise.AutoSize = true;
- this.ctl_denoise.Location = new System.Drawing.Point(19, 123);
- this.ctl_denoise.Margin = new System.Windows.Forms.Padding(0);
- this.ctl_denoise.MaximumSize = new System.Drawing.Size(400, 30);
- this.ctl_denoise.Name = "ctl_denoise";
- this.ctl_denoise.Size = new System.Drawing.Size(275, 28);
- this.ctl_denoise.TabIndex = 40;
- //
- // ctl_decomb
- //
- this.ctl_decomb.AutoSize = true;
- this.ctl_decomb.Location = new System.Drawing.Point(19, 66);
- this.ctl_decomb.Margin = new System.Windows.Forms.Padding(0);
- this.ctl_decomb.MaximumSize = new System.Drawing.Size(400, 30);
- this.ctl_decomb.Name = "ctl_decomb";
- this.ctl_decomb.Size = new System.Drawing.Size(275, 28);
- this.ctl_decomb.TabIndex = 39;
- this.ctl_decomb.onChange += new System.EventHandler(this.ctl_decomb_changed);
- //
- // ctl_detelecine
- //
- this.ctl_detelecine.AutoSize = true;
- this.ctl_detelecine.Location = new System.Drawing.Point(19, 38);
- this.ctl_detelecine.Margin = new System.Windows.Forms.Padding(0);
- this.ctl_detelecine.MaximumSize = new System.Drawing.Size(400, 30);
- this.ctl_detelecine.Name = "ctl_detelecine";
- this.ctl_detelecine.Size = new System.Drawing.Size(275, 28);
- this.ctl_detelecine.TabIndex = 38;
- //
// tab_chapters
//
this.tab_chapters.BackColor = System.Drawing.Color.Transparent;
@@ -1956,14 +1914,6 @@ namespace Handbrake
this.h264Tab.Text = "Advanced";
this.h264Tab.UseVisualStyleBackColor = true;
//
- // x264Panel
- //
- this.x264Panel.Location = new System.Drawing.Point(0, 0);
- this.x264Panel.Name = "x264Panel";
- this.x264Panel.Size = new System.Drawing.Size(720, 306);
- this.x264Panel.TabIndex = 0;
- this.x264Panel.x264Query = "";
- //
// tab_query
//
this.tab_query.Controls.Add(this.btn_clear);
@@ -2323,6 +2273,56 @@ namespace Handbrake
this.hbproc.StartInfo.UserName = "";
this.hbproc.SynchronizingObject = this;
//
+ // ctl_deinterlace
+ //
+ this.ctl_deinterlace.AutoSize = true;
+ this.ctl_deinterlace.Location = new System.Drawing.Point(19, 95);
+ this.ctl_deinterlace.Margin = new System.Windows.Forms.Padding(0);
+ this.ctl_deinterlace.MaximumSize = new System.Drawing.Size(400, 30);
+ this.ctl_deinterlace.Name = "ctl_deinterlace";
+ this.ctl_deinterlace.Size = new System.Drawing.Size(275, 28);
+ this.ctl_deinterlace.TabIndex = 41;
+ this.ctl_deinterlace.onChange += new System.EventHandler(this.ctl_deinterlace_changed);
+ //
+ // ctl_denoise
+ //
+ this.ctl_denoise.AutoSize = true;
+ this.ctl_denoise.Location = new System.Drawing.Point(19, 123);
+ this.ctl_denoise.Margin = new System.Windows.Forms.Padding(0);
+ this.ctl_denoise.MaximumSize = new System.Drawing.Size(400, 30);
+ this.ctl_denoise.Name = "ctl_denoise";
+ this.ctl_denoise.Size = new System.Drawing.Size(275, 28);
+ this.ctl_denoise.TabIndex = 40;
+ //
+ // ctl_decomb
+ //
+ this.ctl_decomb.AutoSize = true;
+ this.ctl_decomb.Location = new System.Drawing.Point(19, 66);
+ this.ctl_decomb.Margin = new System.Windows.Forms.Padding(0);
+ this.ctl_decomb.MaximumSize = new System.Drawing.Size(400, 30);
+ this.ctl_decomb.Name = "ctl_decomb";
+ this.ctl_decomb.Size = new System.Drawing.Size(275, 28);
+ this.ctl_decomb.TabIndex = 39;
+ this.ctl_decomb.onChange += new System.EventHandler(this.ctl_decomb_changed);
+ //
+ // ctl_detelecine
+ //
+ this.ctl_detelecine.AutoSize = true;
+ this.ctl_detelecine.Location = new System.Drawing.Point(19, 38);
+ this.ctl_detelecine.Margin = new System.Windows.Forms.Padding(0);
+ this.ctl_detelecine.MaximumSize = new System.Drawing.Size(400, 30);
+ this.ctl_detelecine.Name = "ctl_detelecine";
+ this.ctl_detelecine.Size = new System.Drawing.Size(275, 28);
+ this.ctl_detelecine.TabIndex = 38;
+ //
+ // x264Panel
+ //
+ this.x264Panel.Location = new System.Drawing.Point(0, 0);
+ this.x264Panel.Name = "x264Panel";
+ this.x264Panel.Size = new System.Drawing.Size(720, 306);
+ this.x264Panel.TabIndex = 0;
+ this.x264Panel.x264Query = "";
+ //
// frmMain
//
this.AllowDrop = true;
@@ -2574,7 +2574,7 @@ namespace Handbrake
internal TextBox text_source;
private System.Diagnostics.Process hbproc;
internal ComboBox drop_angle;
- internal Label label4;
+ internal Label lbl_angle;
}
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index a8c7a8a7a..edea6c54f 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -36,7 +36,7 @@ namespace Handbrake
// Delegates
private delegate void UpdateWindowHandler();
- private delegate void updateStatusChanger();
+ private delegate void UpdateStatusChanger();
// Applicaiton Startup ************************************************
@@ -133,7 +133,7 @@ namespace Handbrake
{
if (InvokeRequired)
{
- BeginInvoke(new updateStatusChanger(startupUpdateCheck));
+ BeginInvoke(new UpdateStatusChanger(startupUpdateCheck));
return;
}
@@ -230,7 +230,7 @@ namespace Handbrake
#region File Menu
private void mnu_killCLI_Click(object sender, EventArgs e)
{
- killCLI();
+ killScan();
}
private void mnu_exit_Click(object sender, EventArgs e)
{
@@ -847,7 +847,19 @@ namespace Handbrake
// Populate the Angles dropdown
drop_angle.Items.Clear();
- drop_angle.Items.AddRange(selectedTitle.Angles.ToArray());
+ if (Properties.Settings.Default.dvdnav == "Checked")
+ {
+ drop_angle.Visible = true;
+ lbl_angle.Visible = true;
+ drop_angle.Items.AddRange(selectedTitle.Angles.ToArray());
+ if (drop_angle.Items.Count != 0)
+ drop_angle.SelectedIndex = 0;
+ }
+ else
+ {
+ drop_angle.Visible = false;
+ lbl_angle.Visible = false;
+ }
// Populate the Start chapter Dropdown
drop_chapterStart.Items.Clear();
@@ -1363,7 +1375,7 @@ namespace Handbrake
}
private void drp_audenc_1_SelectedIndexChanged(object sender, EventArgs e)
{
- if (drp_audenc_1.Text == "AC3" || drp_audenc_1.Text == "DTS")
+ if (drp_audenc_1.Text.Contains("AC3") || drp_audenc_1.Text.Contains("DTS"))
{
drp_audmix_1.Enabled = false;
drp_audbit_1.Enabled = false;
@@ -1384,7 +1396,7 @@ namespace Handbrake
drp_audsr_1.Text = "Auto";
}
- if (drp_audenc_1.Text == "AAC")
+ if (drp_audenc_1.Text.Contains("AAC"))
{
setMixDownAllOptions(drp_audmix_1);
setBitrateSelections160(drp_audbit_1);
@@ -1404,9 +1416,9 @@ namespace Handbrake
}
private void drp_audmix_1_SelectedIndexChanged(object sender, EventArgs e)
{
- if ((drp_audenc_1.Text == "AAC") && (drp_audmix_1.Text == "6 Channel Discrete"))
+ if ((drp_audenc_1.Text.Contains("AAC")) && (drp_audmix_1.Text == "6 Channel Discrete"))
setBitrateSelections384(drp_audbit_1);
- else if ((drp_audenc_1.Text == "AAC") && (drp_audmix_1.Text != "6 Channel Discrete"))
+ else if ((drp_audenc_1.Text.Contains("AAC")) && (drp_audmix_1.Text != "6 Channel Discrete"))
setBitrateSelections160(drp_audbit_1); drp_audbit_1.Text = "160";
// Update an item in the Audio list if required.
@@ -1430,7 +1442,7 @@ namespace Handbrake
// Update an item in the Audio list if required.
if (lv_audioList.Items.Count != 0 && lv_audioList.SelectedIndices.Count != 0)
{
- if (drp_audenc_1.Text == "AC3")
+ if (drp_audenc_1.Text.Contains("AC3"))
drp_audbit_1.Text = "Auto";
lv_audioList.Items[lv_audioList.SelectedIndices[0]].SubItems[4].Text = drp_audbit_1.Text;
lv_audioList.Select();
@@ -1598,6 +1610,7 @@ namespace Handbrake
// MainWindow Components, Actions and Functions ***********************
#region Source Scan
+ private static int scanProcessID { get; set; }
private void setupGUIforScan(String filename)
{
text_source.Text = filename;
@@ -1650,24 +1663,33 @@ namespace Handbrake
ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine) { WindowStyle = ProcessWindowStyle.Hidden };
+ Boolean cleanExit = true;
using (hbproc = Process.Start(hbParseDvd))
{
+ scanProcessID = hbproc.Id;
hbproc.WaitForExit();
+ if (hbproc.ExitCode != 0)
+ cleanExit = false;
}
- if (!File.Exists(dvdInfoPath))
+ if (cleanExit) // If 0 exit code, CLI exited cleanly.
{
- throw new Exception("Unable to retrieve the DVD Info. last_scan_log.txt is missing. \nExpected location of last_scan_log.txt: \n" + dvdInfoPath);
- }
+ if (!File.Exists(dvdInfoPath))
+ {
+ throw new Exception(
+ "Unable to retrieve the DVD Info. last_scan_log.txt is missing. \nExpected location of last_scan_log.txt: \n" +
+ dvdInfoPath);
+ }
- using (StreamReader sr = new StreamReader(dvdInfoPath))
- {
- thisDVD = DVD.Parse(sr);
- sr.Close();
- sr.Dispose();
- }
+ using (StreamReader sr = new StreamReader(dvdInfoPath))
+ {
+ thisDVD = DVD.Parse(sr);
+ sr.Close();
+ sr.Dispose();
+ }
- updateUIafterScan();
+ updateUIafterScan();
+ }
}
catch (Exception exc)
{
@@ -1725,9 +1747,7 @@ namespace Handbrake
try
{
if (InvokeRequired)
- {
- BeginInvoke(new UpdateWindowHandler(updateUIafterScan));
- }
+ BeginInvoke(new UpdateWindowHandler(enableGUI));
lbl_encode.Text = "Scan Completed";
gb_source.Text = "Source";
foreach (Control ctrl in Controls)
@@ -1741,27 +1761,24 @@ namespace Handbrake
}
catch (Exception exc)
{
- MessageBox.Show("frmMain.cs - enableGUI " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("frmMain.cs - enableGUI() " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
- private static void killCLI()
+ private void killScan()
{
- // This may seem like a long way of killing HandBrakeCLI, but for whatever reason,
- // hbproc.kill/close just won't do the trick.
try
{
- string AppName = "HandBrakeCLI";
-
- AppName = AppName.ToUpper();
-
+ enableGUI();
+ resetGUI();
+
Process[] prs = Process.GetProcesses();
- foreach (Process proces in prs)
+ foreach (Process process in prs)
{
- if (proces.ProcessName.ToUpper() == AppName)
+ if (process.Id == scanProcessID)
{
- proces.Refresh();
- if (!proces.HasExited)
- proces.Kill();
+ process.Refresh();
+ if (!process.HasExited)
+ process.Kill();
}
}
}
@@ -1770,6 +1787,22 @@ namespace Handbrake
MessageBox.Show("Unable to kill HandBrakeCLI.exe \nYou may need to manually kill HandBrakeCLI.exe using the Windows Task Manager if it does not close automatically within the next few minutes. \n\nError Information: \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
+ private void resetGUI()
+ {
+ drp_dvdtitle.Items.Clear();
+ drp_dvdtitle.Text = "Automatic";
+ drop_chapterStart.Items.Clear();
+ drop_chapterStart.Text = "Auto";
+ drop_chapterFinish.Items.Clear();
+ drop_chapterFinish.Text = "Auto";
+ lbl_duration.Text = "Select a Title";
+ lbl_src_res.Text = "Select a Title";
+ lbl_Aspect.Text = "Select a Title";
+ text_source.Text = "Click 'Source' to continue";
+ text_destination.Text = "";
+ thisDVD = null;
+ selectedTitle = null;
+ }
#endregion
#region GUI
@@ -1876,7 +1909,7 @@ namespace Handbrake
drp_audenc_1.Items.Clear();
drp_audenc_1.Items.Add("AAC (faac)");
drp_audenc_1.Items.Add("AC3 Passthru");
- if ((oldval != "AAC") && (oldval != "AC3"))
+ if ((oldval != "AAC (faac)") && (oldval != "AC3 Passthru"))
drp_audenc_1.SelectedIndex = 0;
}