From: sr55 Date: Wed, 17 Jun 2009 18:37:28 +0000 (+0000) Subject: WinGui: X-Git-Tag: 0.9.4~404 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=369338c32344dcf54cca78efaa95f57f83bed7c9;p=handbrake WinGui: - Tweak the presetLoader and Picture settings panel to work a bit better with built-in presets. Sets width/height then sets anamorphic mode (instead of vice-versa). This forces the calculation code to run which should correct the weird numbers that were appearing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2558 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/C#/Controls/PictureSettings.Designer.cs b/win/C#/Controls/PictureSettings.Designer.cs index 67c0dad4b..11e7aa5d3 100644 --- a/win/C#/Controls/PictureSettings.Designer.cs +++ b/win/C#/Controls/PictureSettings.Designer.cs @@ -106,11 +106,6 @@ namespace Handbrake.Controls 0, 0, 0}); - this.text_width.Minimum = new decimal(new int[] { - 64, - 0, - 0, - 0}); this.text_width.Name = "text_width"; this.toolTip.SetToolTip(this.text_width, resources.GetString("text_width.ToolTip")); this.text_width.Value = new decimal(new int[] { diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs index 2d1fc154d..c35c2fa51 100644 --- a/win/C#/Controls/PictureSettings.cs +++ b/win/C#/Controls/PictureSettings.cs @@ -524,8 +524,8 @@ namespace Handbrake.Controls if (selectedTitle.Resolution.Width < returnVal) returnVal = selectedTitle.Resolution.Width; - if (returnVal < 64) - returnVal = 64; + /*if (returnVal < 64) + returnVal = 64; */ // Set the global tracker widthVal = (int)returnVal; diff --git a/win/C#/Controls/PictureSettings.resx b/win/C#/Controls/PictureSettings.resx index 455879185..f53a46d0e 100644 --- a/win/C#/Controls/PictureSettings.resx +++ b/win/C#/Controls/PictureSettings.resx @@ -120,14 +120,11 @@ $this - - $this - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + PictureSettings - - + + $this @@ -139,10 +136,6 @@ 68 - - - 108, 250 - True @@ -155,9 +148,10 @@ crop_bottom - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 72, 12 @@ -167,8 +161,9 @@ crop_right - - $this + + PAR Height - Press "Enter" after entering a new value. + Select a Title @@ -176,8 +171,8 @@ System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 110, 170 + + @@ -188,18 +183,9 @@ 467, 100 - - - - - Label51 - 100, 20 - - 39 - True @@ -215,8 +201,8 @@ 30 - - Anamorphic: + + 22 $this @@ -224,14 +210,11 @@ $this - - $this - - - lbl_Aspect + + Anamorphic: - - 474, 85 + + Label15 System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -239,8 +222,8 @@ Select a Title - - 279, 61 + + lbl_src_res @@ -257,17 +240,14 @@ True - - 206, 59 - - - 416, 122 - - + $this - - $this + + + + + 4 44, 13 @@ -281,6 +261,18 @@ + + True + + + True + + + 18 + + + 14, 225 + $this @@ -312,20 +304,23 @@ - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 73 7 - - 68, 85 + + False - - + + 26 - - lbl_parHeight + + True + + + Verdana, 8.25pt crop_left @@ -333,21 +328,24 @@ 70 - - Verdana, 8.25pt - True 48, 13 + + $this + 14, 199 34, 13 + + 20 + Size @@ -357,29 +355,26 @@ Height: - - 1 - 2 + + Verdana, 8.25pt, style=Bold + txt_parWidth - - 72, 12 - - - Verdana, 8.25pt + + False - - 37, 13 + + txt_displayWidth - - 34, 13 + + PAR Width: - - + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 label8 @@ -387,8 +382,8 @@ Strict - - Loose + + 1 Custom @@ -405,6 +400,9 @@ 6 + + $this + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -414,15 +412,18 @@ label4 - - Modulus: + + 110, 170 - - False + + Display Width - Press "Enter" after entering a new value. $this + + None + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -432,8 +433,8 @@ System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 20 + + $this $this @@ -450,17 +451,20 @@ False - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Verdana, 8.25pt + + 66, 13 + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Label51 23 @@ -468,24 +472,18 @@ 100, 20 - - 75, 13 - Verdana, 6.75pt Display Width: - - txt_parHeight + + 37, 13 Custom: - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 54 @@ -501,11 +499,11 @@ System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + 34, 13 - - 18 + + 69 True @@ -531,9 +529,6 @@ Right - - Label52 - 29 @@ -543,17 +538,17 @@ System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True + + $this - - PictureSettings + + - - 69 + + Verdana, 8.25pt System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -564,21 +559,12 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - Verdana, 8.25pt - - - PAR Width: + + $this label26 - - 13 - 384, 13 @@ -588,23 +574,23 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 44, 20 + + Verdana, 8.25pt - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 19 - - Label15 + + 10 13, 63 - - True + + - - 73 + + True 31 @@ -618,15 +604,12 @@ System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Verdana, 8.25pt + + check_autoCrop 27 - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Source: @@ -639,20 +622,17 @@ lbl_anamorphic - - True - - - toolTip + + 61 - - lbl_displayWidth + + 39 36, 13 - - 64, 20 + + text_height @@ -663,17 +643,20 @@ 32 + + 14 + 28, 13 System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - lbl_parWidth + + $this - - True + + Verdana, 8.25pt True @@ -681,17 +664,23 @@ label6 - - 13, 13 + + $this label7 - - $this + + 64, 20 - - Automatic + + 74 + + + 21 + + + 68, 59 47 @@ -702,8 +691,8 @@ True - - + + $this 13, 35 @@ -714,14 +703,11 @@ 561, 124 - - - - - 14, 173 + + 13 - - PAR Height: + + Aspect Ratio: 24 @@ -732,6 +718,9 @@ + + 72, 17 + 100, 20 @@ -741,80 +730,71 @@ 57 - - 49 + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 241, 36 - - 80, 13 + + 666, 279 - - 42 + + 63 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True 518, 122 - - 61 - 11 - - check_autoCrop - $this 83, 13 - - lbl_max + + lbl_parHeight $this - - Label91 + + 75, 13 - - 72, 17 + + Label52 - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 206, 59 - - 14, 225 + + 68, 85 - - 152, 35 + + 108, 250 - - drp_anamorphic + + 80, 13 Select a Title - - True - - - + + 0 - - 14 + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Verdana, 8.25pt @@ -822,32 +802,35 @@ 467, 146 + + lbl_parWidth + $this - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + txt_parHeight - - + + Modulus: - - 51 + + $this 5 - - 60 + + 152, 35 16 - - Verdana, 8.25pt + + $this 14, 119 @@ -870,8 +853,8 @@ Label53 - - 4 + + Verdana, 8.25pt $this @@ -882,20 +865,20 @@ 59 - - 74 - 12 + + 50 + Top - - 26 + + toolTip lbl_anamprohicLbl @@ -918,6 +901,9 @@ True + + Width: + 64 @@ -927,14 +913,14 @@ Verdana, 8.25pt - - + + 110, 196 - - True + + 44, 20 - - 666, 279 + + lbl_max text_width @@ -942,11 +928,11 @@ Bottom - - txt_displayWidth + + True - - Display Width - Press "Enter" after entering a new value. + + 72, 12 110, 21 @@ -957,29 +943,32 @@ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Loose + 110, 222 387, 33 - - Verdana, 8.25pt + + Automatic - + 4 - - 71, 13 - Anamorphic: - - Verdana, 6.75pt + + lbl_displayWidth + + + 90, 13 Verdana, 8.25pt @@ -1005,11 +994,11 @@ $this - - 0 + + Verdana, 8.25pt - - $this + + @@ -1023,11 +1012,11 @@ 110, 116 - - True + + 60 - - + + lbl_modulus @@ -1038,32 +1027,41 @@ 58 + + 15 + + + 279, 61 + 66, 36 + + $this + 67 {max} - - 68, 59 + + - - $this + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 21 + + 71, 13 - - $this + + lbl_Aspect - - Width: + + 474, 85 - - Aspect Ratio: + + Verdana, 8.25pt @@ -1071,17 +1069,17 @@ Verdana, 8.25pt - - False + + 14, 173 - - 45 + + - - lbl_modulus + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - False + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 65 @@ -1089,8 +1087,8 @@ $this - - 10 + + 13, 13 40 @@ -1098,11 +1096,11 @@ True - - None + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -1116,75 +1114,77 @@ 55 - - $this + + True - - 110, 196 + + 51 - - Verdana, 8.25pt + + Verdana, 6.75pt + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 384, 124 - - 19 + + PAR Height: True - - Verdana, 8.25pt + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 90, 13 + + 416, 122 check_customCrop - - PAR Height - Press "Enter" after entering a new value. - + + True 9 - - - crop_top 66 - - 22 + + Label91 - - Verdana, 8.25pt, style=Bold + + drp_anamorphic 14, 249 - - $this + + False 44, 20 - - 15 + + 42 - - 66, 13 + + Verdana, 8.25pt - - 50 + + 45 - - True + + + + + 49 True diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs index 6428097b1..251735aec 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -90,16 +90,6 @@ namespace Handbrake.Functions } } - // Set the anamorphic mode 0,1,2,3 - mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode; - - // Custom Anamorphic Controls - mainWindow.pictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked; - mainWindow.pictureSettings.txt_displayWidth.Text = presetQuery.displayWidthValue.ToString(); - mainWindow.pictureSettings.txt_parWidth.Text = presetQuery.pixelAspectWidth.ToString(); - mainWindow.pictureSettings.txt_parHeight.Text = presetQuery.pixelAspectHeight.ToString(); - mainWindow.pictureSettings.drop_modulus.SelectedItem = presetQuery.AnamorphicModulus; - // Reset maxWidth and MaxHeight to 0 mainWindow.pictureSettings.maxWidth = 0; mainWindow.pictureSettings.maxHeight = 0; @@ -107,11 +97,10 @@ namespace Handbrake.Functions // Set the width and height if (presetQuery.Width != 0) mainWindow.pictureSettings.text_width.Value = presetQuery.Width; + else if (presetQuery.MaxWidth == 0) + mainWindow.pictureSettings.text_width.Value = 0; - if (presetQuery.Height != 0) - mainWindow.pictureSettings.text_height.Value = presetQuery.Height; - else - mainWindow.pictureSettings.text_height.Value = 0; + mainWindow.pictureSettings.text_height.Value = presetQuery.Height != 0 ? presetQuery.Height : 0; // Max Width/Height override Width/Height if (presetQuery.MaxWidth != 0) @@ -127,6 +116,16 @@ namespace Handbrake.Functions } mainWindow.pictureSettings.setMax(); + // Set the anamorphic mode 0,1,2,3 + mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode; + + // Custom Anamorphic Controls + mainWindow.pictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked; + mainWindow.pictureSettings.txt_displayWidth.Text = presetQuery.displayWidthValue.ToString(); + mainWindow.pictureSettings.txt_parWidth.Text = presetQuery.pixelAspectWidth.ToString(); + mainWindow.pictureSettings.txt_parHeight.Text = presetQuery.pixelAspectHeight.ToString(); + mainWindow.pictureSettings.drop_modulus.SelectedItem = presetQuery.AnamorphicModulus; + #endregion