// lbl_max\r
// \r
this.lbl_max.AutoSize = true;\r
- this.lbl_max.Location = new System.Drawing.Point(273, 80);\r
+ this.lbl_max.Location = new System.Drawing.Point(279, 61);\r
this.lbl_max.Name = "lbl_max";\r
this.lbl_max.Size = new System.Drawing.Size(34, 13);\r
this.lbl_max.TabIndex = 47;\r
this.label6.AutoSize = true;\r
this.label6.BackColor = System.Drawing.Color.Transparent;\r
this.label6.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.label6.Location = new System.Drawing.Point(13, 91);\r
+ this.label6.Location = new System.Drawing.Point(14, 120);\r
this.label6.Name = "label6";\r
this.label6.Size = new System.Drawing.Size(80, 13);\r
this.label6.TabIndex = 45;\r
"Strict",\r
"Loose",\r
"Custom"});\r
- this.drp_anamorphic.Location = new System.Drawing.Point(109, 88);\r
+ this.drp_anamorphic.Location = new System.Drawing.Point(110, 117);\r
this.drp_anamorphic.Name = "drp_anamorphic";\r
this.drp_anamorphic.Size = new System.Drawing.Size(110, 21);\r
this.drp_anamorphic.TabIndex = 46;\r
this.lbl_modulus.AutoSize = true;\r
this.lbl_modulus.BackColor = System.Drawing.Color.Transparent;\r
this.lbl_modulus.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.lbl_modulus.Location = new System.Drawing.Point(13, 118);\r
+ this.lbl_modulus.Location = new System.Drawing.Point(14, 147);\r
this.lbl_modulus.Name = "lbl_modulus";\r
this.lbl_modulus.Size = new System.Drawing.Size(58, 13);\r
this.lbl_modulus.TabIndex = 51;\r
"8",\r
"4",\r
"2"});\r
- this.drop_modulus.Location = new System.Drawing.Point(109, 115);\r
+ this.drop_modulus.Location = new System.Drawing.Point(110, 144);\r
this.drop_modulus.Name = "drop_modulus";\r
this.drop_modulus.Size = new System.Drawing.Size(110, 21);\r
this.drop_modulus.TabIndex = 52;\r
// \r
// txt_displayWidth\r
// \r
- this.txt_displayWidth.Location = new System.Drawing.Point(109, 142);\r
+ this.txt_displayWidth.Location = new System.Drawing.Point(110, 171);\r
this.txt_displayWidth.Name = "txt_displayWidth";\r
this.txt_displayWidth.Size = new System.Drawing.Size(100, 20);\r
this.txt_displayWidth.TabIndex = 53;\r
this.lbl_displayWidth.AutoSize = true;\r
this.lbl_displayWidth.BackColor = System.Drawing.Color.Transparent;\r
this.lbl_displayWidth.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.lbl_displayWidth.Location = new System.Drawing.Point(13, 145);\r
+ this.lbl_displayWidth.Location = new System.Drawing.Point(14, 174);\r
this.lbl_displayWidth.Name = "lbl_displayWidth";\r
this.lbl_displayWidth.Size = new System.Drawing.Size(90, 13);\r
this.lbl_displayWidth.TabIndex = 54;\r
this.lbl_parWidth.AutoSize = true;\r
this.lbl_parWidth.BackColor = System.Drawing.Color.Transparent;\r
this.lbl_parWidth.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.lbl_parWidth.Location = new System.Drawing.Point(13, 171);\r
+ this.lbl_parWidth.Location = new System.Drawing.Point(14, 200);\r
this.lbl_parWidth.Name = "lbl_parWidth";\r
this.lbl_parWidth.Size = new System.Drawing.Size(71, 13);\r
this.lbl_parWidth.TabIndex = 56;\r
// \r
// txt_parWidth\r
// \r
- this.txt_parWidth.Location = new System.Drawing.Point(109, 168);\r
+ this.txt_parWidth.Location = new System.Drawing.Point(110, 197);\r
this.txt_parWidth.Name = "txt_parWidth";\r
this.txt_parWidth.Size = new System.Drawing.Size(100, 20);\r
this.txt_parWidth.TabIndex = 55;\r
this.lbl_parHeight.AutoSize = true;\r
this.lbl_parHeight.BackColor = System.Drawing.Color.Transparent;\r
this.lbl_parHeight.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.lbl_parHeight.Location = new System.Drawing.Point(13, 197);\r
+ this.lbl_parHeight.Location = new System.Drawing.Point(14, 226);\r
this.lbl_parHeight.Name = "lbl_parHeight";\r
this.lbl_parHeight.Size = new System.Drawing.Size(75, 13);\r
this.lbl_parHeight.TabIndex = 58;\r
// \r
// txt_parHeight\r
// \r
- this.txt_parHeight.Location = new System.Drawing.Point(109, 194);\r
+ this.txt_parHeight.Location = new System.Drawing.Point(110, 223);\r
this.txt_parHeight.Name = "txt_parHeight";\r
this.txt_parHeight.Size = new System.Drawing.Size(100, 20);\r
this.txt_parHeight.TabIndex = 57;\r
// check_KeepAR\r
// \r
this.check_KeepAR.AutoSize = true;\r
- this.check_KeepAR.Location = new System.Drawing.Point(276, 60);\r
+ this.check_KeepAR.Location = new System.Drawing.Point(68, 85);\r
this.check_KeepAR.Name = "check_KeepAR";\r
- this.check_KeepAR.Size = new System.Drawing.Size(69, 17);\r
+ this.check_KeepAR.Size = new System.Drawing.Size(115, 17);\r
this.check_KeepAR.TabIndex = 59;\r
- this.check_KeepAR.Text = "Keep AR";\r
+ this.check_KeepAR.Text = "Keep Aspect Ratio";\r
this.check_KeepAR.UseVisualStyleBackColor = true;\r
this.check_KeepAR.CheckedChanged += new System.EventHandler(this.check_KeepAR_CheckedChanged);\r
// \r
// crop_bottom\r
// \r
this.crop_bottom.Enabled = false;\r
+ this.crop_bottom.Increment = new decimal(new int[] {\r
+ 2,\r
+ 0,\r
+ 0,\r
+ 0});\r
this.crop_bottom.Location = new System.Drawing.Point(467, 146);\r
this.crop_bottom.Maximum = new decimal(new int[] {\r
1080,\r
this.crop_bottom.Name = "crop_bottom";\r
this.crop_bottom.Size = new System.Drawing.Size(44, 20);\r
this.crop_bottom.TabIndex = 67;\r
+ this.crop_bottom.ValueChanged += new System.EventHandler(this.crop_bottom_ValueChanged);\r
// \r
// crop_top\r
// \r
this.crop_top.Enabled = false;\r
+ this.crop_top.Increment = new decimal(new int[] {\r
+ 2,\r
+ 0,\r
+ 0,\r
+ 0});\r
this.crop_top.Location = new System.Drawing.Point(467, 100);\r
this.crop_top.Maximum = new decimal(new int[] {\r
1080,\r
this.crop_top.Name = "crop_top";\r
this.crop_top.Size = new System.Drawing.Size(44, 20);\r
this.crop_top.TabIndex = 64;\r
+ this.crop_top.ValueChanged += new System.EventHandler(this.crop_top_ValueChanged);\r
// \r
// crop_left\r
// \r
this.crop_left.Enabled = false;\r
+ this.crop_left.Increment = new decimal(new int[] {\r
+ 2,\r
+ 0,\r
+ 0,\r
+ 0});\r
this.crop_left.Location = new System.Drawing.Point(416, 122);\r
this.crop_left.Maximum = new decimal(new int[] {\r
1920,\r
this.crop_left.Name = "crop_left";\r
this.crop_left.Size = new System.Drawing.Size(44, 20);\r
this.crop_left.TabIndex = 62;\r
+ this.crop_left.ValueChanged += new System.EventHandler(this.crop_left_ValueChanged);\r
// \r
// crop_right\r
// \r
this.crop_right.Enabled = false;\r
+ this.crop_right.Increment = new decimal(new int[] {\r
+ 2,\r
+ 0,\r
+ 0,\r
+ 0});\r
this.crop_right.Location = new System.Drawing.Point(518, 122);\r
this.crop_right.Maximum = new decimal(new int[] {\r
1920,\r
this.crop_right.Name = "crop_right";\r
this.crop_right.Size = new System.Drawing.Size(44, 20);\r
this.crop_right.TabIndex = 65;\r
+ this.crop_right.ValueChanged += new System.EventHandler(this.crop_right_ValueChanged);\r
// \r
// label8\r
// \r
this.lbl_anamorphic.AutoSize = true;\r
this.lbl_anamorphic.BackColor = System.Drawing.Color.Transparent;\r
this.lbl_anamorphic.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.lbl_anamorphic.Location = new System.Drawing.Point(107, 222);\r
+ this.lbl_anamorphic.Location = new System.Drawing.Point(108, 251);\r
this.lbl_anamorphic.Name = "lbl_anamorphic";\r
this.lbl_anamorphic.Size = new System.Drawing.Size(72, 12);\r
this.lbl_anamorphic.TabIndex = 74;\r
// \r
this.lbl_anamprohicLbl.AutoSize = true;\r
this.lbl_anamprohicLbl.BackColor = System.Drawing.Color.Transparent;\r
- this.lbl_anamprohicLbl.Location = new System.Drawing.Point(13, 221);\r
+ this.lbl_anamprohicLbl.Location = new System.Drawing.Point(14, 250);\r
this.lbl_anamprohicLbl.Name = "lbl_anamprohicLbl";\r
this.lbl_anamprohicLbl.Size = new System.Drawing.Size(66, 13);\r
this.lbl_anamprohicLbl.TabIndex = 73;\r
namespace Handbrake.Controls\r
{\r
// TODO\r
-\r
- // - Fix MAX Width / Height Code.\r
// - Tie in the cropping controls.\r
\r
public partial class PictureSettings : UserControl\r
{\r
// Globals\r
- int maxWidth, maxHeight;\r
+ public int maxWidth, maxHeight;\r
int widthVal, heightVal;\r
private double darValue;\r
- private double storageAspect = 0; // Storage Aspect Cache for current source and title\r
- public Title selectedTitle { get; set; }\r
+ private double storageAspect; // Storage Aspect Cache for current source and title\r
+ public Title selectedTitle { private get; set; }\r
private Boolean heightChangeGuard;\r
private Boolean looseAnamorphicHeightGuard;\r
private Boolean heightModJumpGaurd;\r
text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;\r
}\r
\r
-\r
-\r
if (drp_anamorphic.SelectedIndex == 3)\r
{\r
txt_parWidth.Text = selectedTitle.ParVal.Width.ToString();\r
txt_parHeight.Text = selectedTitle.ParVal.Height.ToString();\r
txt_displayWidth.Text = displayWidth().ToString();\r
}\r
+\r
+ setMax();\r
}\r
public void setMax()\r
{\r
// Basic Picture Setting Controls\r
private void text_width_ValueChanged(object sender, EventArgs e)\r
{\r
+ maxWidth = 0;\r
+ setMax();\r
+ \r
// Get the Modulus\r
int mod;\r
int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);\r
switch (drp_anamorphic.SelectedIndex)\r
{\r
case 0:\r
- if (calculateUnchangeValue(true) != -1)\r
+ if (calculateUnchangeValue(true) != -1 && check_KeepAR.Checked)\r
text_height.Value = calculateUnchangeValue(true);\r
break;\r
case 1:\r
}\r
private void text_height_ValueChanged(object sender, EventArgs e)\r
{\r
+ maxHeight = 0;\r
+ setMax();\r
+\r
// Get the Modulus\r
int mod;\r
int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);\r
switch (drp_anamorphic.SelectedIndex)\r
{\r
case 0: // None\r
- text_height.BackColor = Color.White;\r
- text_width.BackColor = Color.White;\r
text_height.Enabled = true;\r
text_width.Enabled = true;\r
check_KeepAR.CheckState = CheckState.Checked;\r
check_KeepAR.Enabled = true;\r
disableCustomAnaControls();\r
- text_width.Text = widthVal.ToString();\r
- text_height.Text = heightVal.ToString();\r
+ if (selectedTitle != null)\r
+ {\r
+ text_width.Value = selectedTitle.Resolution.Width;\r
+ text_height.Value = selectedTitle.Resolution.Height;\r
+ }\r
check_KeepAR.Enabled = true;\r
lbl_anamorphic.Text = "";\r
lbl_anamprohicLbl.Visible = false;\r
break;\r
case 1: // Strict\r
- text_height.BackColor = Color.LightGray;\r
- text_width.BackColor = Color.LightGray;\r
if (selectedTitle != null)\r
{\r
heightModJumpGaurd = true;\r
disableCustomAnaControls();\r
storageAspect = 0;\r
text_height.Enabled = false;\r
- text_height.BackColor = Color.LightGray;\r
text_width.Enabled = true;\r
- text_width.BackColor = Color.White;\r
if (selectedTitle != null)\r
{\r
heightModJumpGaurd = true;\r
- text_width.Value = selectedTitle.Resolution.Width - (int) crop_left.Value - (int) crop_right.Value;\r
+ text_width.Value = selectedTitle.Resolution.Width;\r
text_height.Value = selectedTitle.Resolution.Height - (int) crop_top.Value - (int) crop_bottom.Value;\r
}\r
lbl_anamorphic.Text = looseAnamorphic();\r
\r
// Display Elements\r
enableCustomAnaControls();\r
- text_height.BackColor = Color.White;\r
- text_width.BackColor = Color.White;\r
text_height.Enabled = true;\r
text_width.Enabled = true;\r
\r
customAnamorphic(txt_parWidth);\r
}\r
\r
- // Cropping Control\r
+ // Cropping Controls\r
private void check_autoCrop_CheckedChanged(object sender, EventArgs e)\r
{\r
crop_left.Enabled = false;\r
crop_bottom.Text = "0";\r
}\r
}\r
+ private void crop_left_ValueChanged(object sender, EventArgs e)\r
+ {\r
+ if (crop_left.Value % 2 != 0)\r
+ crop_left.Value++;\r
+ }\r
+ private void crop_right_ValueChanged(object sender, EventArgs e)\r
+ {\r
+ if (crop_right.Value % 2 != 0)\r
+ crop_right.Value++;\r
+ }\r
+ private void crop_top_ValueChanged(object sender, EventArgs e)\r
+ {\r
+ if (crop_top.Value % 2 != 0)\r
+ crop_top.Value++;\r
+ }\r
+ private void crop_bottom_ValueChanged(object sender, EventArgs e)\r
+ {\r
+ if (crop_bottom.Value % 2 != 0)\r
+ crop_bottom.Value++;\r
+ }\r
\r
// Custom Anamorphic Code\r
private void customAnamorphic(Control control)\r
mainWindow.pictureSettings.crop_left.Value = left;\r
mainWindow.pictureSettings.crop_right.Value = right;\r
}\r
-\r
- if (presetQuery.Width != 0)\r
- mainWindow.pictureSettings.text_width.Text = presetQuery.Width.ToString();\r
-\r
- if (presetQuery.Height != 0)\r
- mainWindow.pictureSettings.text_height.Text = presetQuery.Height.ToString();\r
}\r
\r
// Set the anamorphic mode 0,1,2,3\r
mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;\r
\r
-\r
// Custom Anamorphic Controls\r
mainWindow.pictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked;\r
-\r
mainWindow.pictureSettings.txt_displayWidth.Text = presetQuery.displayWidthValue.ToString();\r
mainWindow.pictureSettings.txt_parWidth.Text = presetQuery.pixelAspectWidth.ToString();\r
mainWindow.pictureSettings.txt_parHeight.Text = presetQuery.pixelAspectHeight.ToString();\r
mainWindow.pictureSettings.drop_modulus.SelectedItem = presetQuery.AnamorphicModulus;\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
+\r
+ // Reset maxWidth and MaxHeight to 0\r
+ mainWindow.pictureSettings.maxWidth = 0;\r
+ mainWindow.pictureSettings.maxHeight = 0;\r
+\r
+ // Set the width and height\r
+ if (presetQuery.Width != 0)\r
+ mainWindow.pictureSettings.text_width.Value = presetQuery.Width;\r
+\r
+ if (presetQuery.Height != 0)\r
+ mainWindow.pictureSettings.text_height.Value = presetQuery.Height;\r
+\r
+ // Max Width/Height override Width/Height\r
if (presetQuery.MaxWidth != 0)\r
{\r
- mainWindow.pictureSettings.text_width.Text = presetQuery.MaxWidth.ToString();\r
- mainWindow.maxWidth = presetQuery.MaxWidth;\r
+ mainWindow.pictureSettings.text_width.Value = presetQuery.MaxWidth;\r
+ mainWindow.pictureSettings.maxWidth = presetQuery.MaxWidth;\r
}\r
\r
if (presetQuery.MaxHeight != 0)\r
{\r
- mainWindow.pictureSettings.text_height.Text = presetQuery.MaxHeight.ToString();\r
- mainWindow.maxHeight = presetQuery.MaxHeight;\r
+ mainWindow.pictureSettings.text_height.Value = presetQuery.MaxHeight;\r
+ mainWindow.pictureSettings.maxHeight = presetQuery.MaxHeight;\r
}\r
-\r
+ mainWindow.pictureSettings.setMax();\r
\r
#endregion\r
\r