}\r
}\r
\r
+ private int q_maxWidth;\r
+ /// <summary>\r
+ /// Returns an Int\r
+ /// The selected Width for the encoding.\r
+ /// </summary>\r
+ public int MaxWidth\r
+ {\r
+ get\r
+ {\r
+ return this.q_maxWidth;\r
+ }\r
+ }\r
+\r
+ private int q_maxHeight;\r
+ /// <summary>\r
+ /// Returns an Int\r
+ /// The selected Height for the encoding.\r
+ /// </summary>\r
+ public int MaxHeight\r
+ {\r
+ get\r
+ {\r
+ return this.q_maxHeight;\r
+ }\r
+ }\r
+\r
private string q_cropValues;\r
/// <summary>\r
/// Returns an String\r
//Picture Settings Tab\r
Match width = Regex.Match(input, @"-w ([0-9]*)");\r
Match height = Regex.Match(input, @"-l ([0-9]*)");\r
+ Match maxWidth = Regex.Match(input, @"-X ([0-9]*)");\r
+ Match maxHeight = Regex.Match(input, @"-Y ([0-9]*)");\r
Match deinterlace = Regex.Match(input, @"--deinterlace=\""([a-zA-Z]*)\""");\r
Match denoise = Regex.Match(input, @"--denoise=\""([a-zA-Z]*)\""");\r
Match deblock = Regex.Match(input, @"--deblock=([0-9]*)");\r
if (height.Success != false)\r
thisQuery.q_videoHeight = int.Parse(height.ToString().Replace("-l ", ""));\r
\r
+ if (maxWidth.Success != false)\r
+ thisQuery.q_maxWidth = int.Parse(maxWidth.ToString().Replace("-X ", ""));\r
+\r
+ if (maxHeight.Success != false)\r
+ thisQuery.q_maxHeight = int.Parse(maxHeight.ToString().Replace("-Y ", ""));\r
+\r
if (crop.Success != false)\r
{\r
thisQuery.q_cropValues = crop.ToString().Replace("--crop ", "");\r
thisQuery.q_drc1 = drcValue;\r
}\r
else\r
- thisQuery.q_drc1 = 0;\r
+ thisQuery.q_drc1 = 10;\r
\r
if (drc2.Success != false)\r
{\r
thisQuery.q_drc2 = drcValue;\r
}\r
else\r
- thisQuery.q_drc2 = 0;\r
+ thisQuery.q_drc2 = 10;\r
\r
if (drc3.Success != false)\r
{\r
thisQuery.q_drc3 = drcValue;\r
}\r
else\r
- thisQuery.q_drc3 = 0;\r
+ thisQuery.q_drc3 = 10;\r
\r
if (drc4.Success != false)\r
{\r
thisQuery.q_drc4 = drcValue;\r
}\r
else\r
- thisQuery.q_drc4 = 0;\r
+ thisQuery.q_drc4 = 10;\r
\r
\r
// Subtitle Stuff\r
private frmQueue queueWindow;\r
private delegate void updateStatusChanger();\r
private string lastAction = null;\r
+ public int maxWidth = 0;\r
+ public int maxHeight = 0;\r
\r
// Applicaiton Startup ************************************************\r
\r
//Source\r
private void btn_dvd_source_Click(object sender, EventArgs e)\r
{\r
+ // Enable the creation of chapter markers.\r
+ Check_ChapterMarkers.Enabled = true;\r
+\r
// Set the last action to scan. \r
// This is used for tracking which file to load in the activity window\r
lastAction = "scan";\r
MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source.\nYour Source may be copy protected, badly mastered or a format which HandBrake does not support. \nPlease refer to the Documentation and FAQ (see Help Menu).", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
\r
lbl_encode.Text = "";\r
+\r
+ // Enable the creation of chapter markers if the file is an image of a dvd.\r
+ if (filename.ToLower().Contains(".iso"))\r
+ Check_ChapterMarkers.Enabled = true;\r
+ else\r
+ {\r
+ Check_ChapterMarkers.Enabled = false;\r
+ data_chpt.Rows.Clear();\r
+ }\r
}\r
}\r
private void mnu_dvd_drive_Click(object sender, EventArgs e)\r
{\r
+ // Enable the creation of chapter markers.\r
+ Check_ChapterMarkers.Enabled = true;\r
+\r
// Set the last action to scan. \r
// This is used for tracking which file to load in the activity window\r
lastAction = "scan";\r
//Picture Tab\r
private void text_width_TextChanged(object sender, EventArgs e)\r
{\r
+ maxWidth = 0; // Reset max width so that it's not using the MaxWidth -X. Quick hack to allow -X for preset usage.\r
+\r
int width;\r
Boolean parsed = int.TryParse(text_width.Text, out width);\r
if (parsed != false)\r
}\r
private void text_height_TextChanged(object sender, EventArgs e)\r
{\r
+ maxHeight = 0; // Reset max height so that it's not using the MaxHeight -Y. Quick hack to allow -Y for preset usage.\r
+\r
int height;\r
Boolean parsed = int.TryParse(text_height.Text, out height);\r
if (parsed != false)\r
mainWindow.text_height.Text = "";\r
}\r
\r
+ // Set the public max width and max height varibles in frmMain\r
+ // These are used by the query generator to determine if it should use -X or -w / -Y or -h\r
+ if (presetQuery.MaxWidth != 0)\r
+ {\r
+ mainWindow.text_width.Text = presetQuery.MaxWidth.ToString();\r
+ mainWindow.maxWidth = presetQuery.MaxWidth;\r
+ }\r
+\r
+ if (presetQuery.MaxHeight != 0)\r
+ {\r
+ mainWindow.text_height.Text = presetQuery.MaxHeight.ToString();\r
+ mainWindow.maxHeight = presetQuery.MaxHeight;\r
+ }\r
+ \r
+\r
#endregion\r
\r
// Video Settings Tab\r
// Picture Settings Tab\r
#region Picture Settings Tab\r
\r
- if (mainWindow.text_width.Text != "")\r
- query += " -w " + mainWindow.text_width.Text;\r
+ // Use MaxWidth for built-in presets and width for user settings.\r
+ if (mainWindow.maxWidth == 0)\r
+ {\r
+\r
+ if (mainWindow.text_width.Text != "")\r
+ query += " -w " + mainWindow.text_width.Text;\r
+ }\r
+ else\r
+ {\r
+ if (mainWindow.text_width.Text != "")\r
+ query += " -X " + mainWindow.text_width.Text;\r
+ }\r
\r
- if (mainWindow.text_height.Text != "")\r
- query += " -l " + mainWindow.text_height.Text;\r
+ // Use MaxHeight for built-in presets and height for user settings.\r
+ if (mainWindow.maxHeight == 0)\r
+ {\r
+ if (mainWindow.text_height.Text != "")\r
+ query += " -l " + mainWindow.text_height.Text;\r
+ }\r
+ else\r
+ {\r
+ if (mainWindow.text_height.Text != "")\r
+ query += " -Y " + mainWindow.text_height.Text;\r
+ }\r
\r
string cropTop = mainWindow.text_top.Text;\r
string cropBottom = mainWindow.text_bottom.Text;\r