]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sun, 7 Jun 2009 23:04:05 +0000 (23:04 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 7 Jun 2009 23:04:05 +0000 (23:04 +0000)
- Checkin of the new picutre settings panel (before I end up accidentally losing working code)
- Modes: None, Strict and Loose work (mostly).  Custom does not work (yet)

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2497 b64f7644-9d1e-0410-96f1-a4d463321fa5

12 files changed:
win/C#/Controls/PictureSettings.Designer.cs [new file with mode: 0644]
win/C#/Controls/PictureSettings.cs [new file with mode: 0644]
win/C#/Controls/PictureSettings.resx [new file with mode: 0644]
win/C#/EncodeQueue/Encode.cs
win/C#/Functions/PresetLoader.cs
win/C#/Functions/QueryGenerator.cs
win/C#/Functions/QueryParser.cs
win/C#/HandBrakeCS.csproj
win/C#/Installer/Installer.nsi
win/C#/Parsing/Title.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

diff --git a/win/C#/Controls/PictureSettings.Designer.cs b/win/C#/Controls/PictureSettings.Designer.cs
new file mode 100644 (file)
index 0000000..a5a79d8
--- /dev/null
@@ -0,0 +1,569 @@
+using System.Windows.Forms;\r
+\r
+namespace Handbrake.Controls\r
+{\r
+    partial class PictureSettings\r
+    {\r
+        /// <summary> \r
+        /// Required designer variable.\r
+        /// </summary>\r
+        private System.ComponentModel.IContainer components = null;\r
+\r
+        /// <summary> \r
+        /// Clean up any resources being used.\r
+        /// </summary>\r
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+        protected override void Dispose(bool disposing)\r
+        {\r
+            if (disposing && (components != null))\r
+            {\r
+                components.Dispose();\r
+            }\r
+            base.Dispose(disposing);\r
+        }\r
+\r
+        #region Component Designer generated code\r
+\r
+        /// <summary> \r
+        /// Required method for Designer support - do not modify \r
+        /// the contents of this method with the code editor.\r
+        /// </summary>\r
+        private void InitializeComponent()\r
+        {\r
+            this.text_height = new System.Windows.Forms.NumericUpDown();\r
+            this.text_width = new System.Windows.Forms.NumericUpDown();\r
+            this.label4 = new System.Windows.Forms.Label();\r
+            this.lbl_max = new System.Windows.Forms.Label();\r
+            this.lbl_src_res = new System.Windows.Forms.Label();\r
+            this.label7 = new System.Windows.Forms.Label();\r
+            this.label6 = new System.Windows.Forms.Label();\r
+            this.drp_anamorphic = new System.Windows.Forms.ComboBox();\r
+            this.label26 = new System.Windows.Forms.Label();\r
+            this.lbl_Aspect = new System.Windows.Forms.Label();\r
+            this.Label91 = new System.Windows.Forms.Label();\r
+            this.Label55 = new System.Windows.Forms.Label();\r
+            this.lbl_modulus = new System.Windows.Forms.Label();\r
+            this.drop_modulus = new System.Windows.Forms.ComboBox();\r
+            this.txt_displayWidth = new System.Windows.Forms.TextBox();\r
+            this.lbl_displayWidth = new System.Windows.Forms.Label();\r
+            this.lbl_parWidth = new System.Windows.Forms.Label();\r
+            this.txt_parWidth = new System.Windows.Forms.TextBox();\r
+            this.lbl_parHeight = new System.Windows.Forms.Label();\r
+            this.txt_parHeight = new System.Windows.Forms.TextBox();\r
+            this.check_KeepAR = new System.Windows.Forms.CheckBox();\r
+            this.check_customCrop = new System.Windows.Forms.RadioButton();\r
+            this.check_autoCrop = new System.Windows.Forms.RadioButton();\r
+            this.crop_bottom = new System.Windows.Forms.NumericUpDown();\r
+            this.crop_top = new System.Windows.Forms.NumericUpDown();\r
+            this.crop_left = new System.Windows.Forms.NumericUpDown();\r
+            this.crop_right = new System.Windows.Forms.NumericUpDown();\r
+            this.label8 = new System.Windows.Forms.Label();\r
+            this.Label53 = new System.Windows.Forms.Label();\r
+            this.Label52 = new System.Windows.Forms.Label();\r
+            this.Label51 = new System.Windows.Forms.Label();\r
+            this.Label15 = new System.Windows.Forms.Label();\r
+            this.lbl_anamorphic = new System.Windows.Forms.Label();\r
+            this.label3 = new System.Windows.Forms.Label();\r
+            ((System.ComponentModel.ISupportInitialize)(this.text_height)).BeginInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.text_width)).BeginInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_bottom)).BeginInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_top)).BeginInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_left)).BeginInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_right)).BeginInit();\r
+            this.SuspendLayout();\r
+            // \r
+            // text_height\r
+            // \r
+            this.text_height.Location = new System.Drawing.Point(206, 59);\r
+            this.text_height.Maximum = new decimal(new int[] {\r
+            2560,\r
+            0,\r
+            0,\r
+            0});\r
+            this.text_height.Minimum = new decimal(new int[] {\r
+            64,\r
+            0,\r
+            0,\r
+            0});\r
+            this.text_height.Name = "text_height";\r
+            this.text_height.Size = new System.Drawing.Size(64, 20);\r
+            this.text_height.TabIndex = 50;\r
+            this.text_height.Value = new decimal(new int[] {\r
+            64,\r
+            0,\r
+            0,\r
+            0});\r
+            this.text_height.ValueChanged += new System.EventHandler(this.text_height_ValueChanged);\r
+            // \r
+            // text_width\r
+            // \r
+            this.text_width.Location = new System.Drawing.Point(68, 59);\r
+            this.text_width.Maximum = new decimal(new int[] {\r
+            2560,\r
+            0,\r
+            0,\r
+            0});\r
+            this.text_width.Minimum = new decimal(new int[] {\r
+            64,\r
+            0,\r
+            0,\r
+            0});\r
+            this.text_width.Name = "text_width";\r
+            this.text_width.Size = new System.Drawing.Size(64, 20);\r
+            this.text_width.TabIndex = 49;\r
+            this.text_width.Value = new decimal(new int[] {\r
+            64,\r
+            0,\r
+            0,\r
+            0});\r
+            this.text_width.ValueChanged += new System.EventHandler(this.text_width_ValueChanged);\r
+            // \r
+            // label4\r
+            // \r
+            this.label4.AutoSize = true;\r
+            this.label4.BackColor = System.Drawing.Color.Transparent;\r
+            this.label4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label4.ForeColor = System.Drawing.Color.Black;\r
+            this.label4.Location = new System.Drawing.Point(152, 63);\r
+            this.label4.Name = "label4";\r
+            this.label4.Size = new System.Drawing.Size(48, 13);\r
+            this.label4.TabIndex = 48;\r
+            this.label4.Text = "Height:";\r
+            // \r
+            // lbl_max\r
+            // \r
+            this.lbl_max.AutoSize = true;\r
+            this.lbl_max.Location = new System.Drawing.Point(273, 80);\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.lbl_max.Text = "{max}";\r
+            // \r
+            // lbl_src_res\r
+            // \r
+            this.lbl_src_res.AutoSize = true;\r
+            this.lbl_src_res.BackColor = System.Drawing.Color.Transparent;\r
+            this.lbl_src_res.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_src_res.Location = new System.Drawing.Point(66, 36);\r
+            this.lbl_src_res.Name = "lbl_src_res";\r
+            this.lbl_src_res.Size = new System.Drawing.Size(72, 12);\r
+            this.lbl_src_res.TabIndex = 41;\r
+            this.lbl_src_res.Text = "Select a Title";\r
+            // \r
+            // label7\r
+            // \r
+            this.label7.AutoSize = true;\r
+            this.label7.BackColor = System.Drawing.Color.Transparent;\r
+            this.label7.Location = new System.Drawing.Point(13, 35);\r
+            this.label7.Name = "label7";\r
+            this.label7.Size = new System.Drawing.Size(44, 13);\r
+            this.label7.TabIndex = 40;\r
+            this.label7.Text = "Source:";\r
+            // \r
+            // label6\r
+            // \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.Name = "label6";\r
+            this.label6.Size = new System.Drawing.Size(80, 13);\r
+            this.label6.TabIndex = 45;\r
+            this.label6.Text = "Anamorphic:";\r
+            // \r
+            // drp_anamorphic\r
+            // \r
+            this.drp_anamorphic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.drp_anamorphic.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.drp_anamorphic.FormattingEnabled = true;\r
+            this.drp_anamorphic.Items.AddRange(new object[] {\r
+            "None",\r
+            "Strict",\r
+            "Loose",\r
+            "Custom"});\r
+            this.drp_anamorphic.Location = new System.Drawing.Point(109, 88);\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.drp_anamorphic.SelectedIndexChanged += new System.EventHandler(this.drp_anamorphic_SelectedIndexChanged);\r
+            // \r
+            // label26\r
+            // \r
+            this.label26.AutoSize = true;\r
+            this.label26.BackColor = System.Drawing.Color.Transparent;\r
+            this.label26.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label26.Location = new System.Drawing.Point(13, 13);\r
+            this.label26.Name = "label26";\r
+            this.label26.Size = new System.Drawing.Size(34, 13);\r
+            this.label26.TabIndex = 39;\r
+            this.label26.Text = "Size";\r
+            // \r
+            // lbl_Aspect\r
+            // \r
+            this.lbl_Aspect.AutoSize = true;\r
+            this.lbl_Aspect.BackColor = System.Drawing.Color.Transparent;\r
+            this.lbl_Aspect.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_Aspect.Location = new System.Drawing.Point(241, 36);\r
+            this.lbl_Aspect.Name = "lbl_Aspect";\r
+            this.lbl_Aspect.Size = new System.Drawing.Size(72, 12);\r
+            this.lbl_Aspect.TabIndex = 43;\r
+            this.lbl_Aspect.Text = "Select a Title";\r
+            // \r
+            // Label91\r
+            // \r
+            this.Label91.AutoSize = true;\r
+            this.Label91.BackColor = System.Drawing.Color.Transparent;\r
+            this.Label91.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Label91.Location = new System.Drawing.Point(152, 35);\r
+            this.Label91.Name = "Label91";\r
+            this.Label91.Size = new System.Drawing.Size(83, 13);\r
+            this.Label91.TabIndex = 42;\r
+            this.Label91.Text = "Aspect Ratio:";\r
+            // \r
+            // Label55\r
+            // \r
+            this.Label55.AutoSize = true;\r
+            this.Label55.BackColor = System.Drawing.Color.Transparent;\r
+            this.Label55.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Label55.ForeColor = System.Drawing.Color.Black;\r
+            this.Label55.Location = new System.Drawing.Point(13, 63);\r
+            this.Label55.Name = "Label55";\r
+            this.Label55.Size = new System.Drawing.Size(44, 13);\r
+            this.Label55.TabIndex = 44;\r
+            this.Label55.Text = "Width:";\r
+            // \r
+            // lbl_modulus\r
+            // \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.Name = "lbl_modulus";\r
+            this.lbl_modulus.Size = new System.Drawing.Size(58, 13);\r
+            this.lbl_modulus.TabIndex = 51;\r
+            this.lbl_modulus.Text = "Modulus:";\r
+            // \r
+            // drop_modulus\r
+            // \r
+            this.drop_modulus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.drop_modulus.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.drop_modulus.FormattingEnabled = true;\r
+            this.drop_modulus.Items.AddRange(new object[] {\r
+            "16",\r
+            "8",\r
+            "4",\r
+            "2"});\r
+            this.drop_modulus.Location = new System.Drawing.Point(109, 115);\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.Name = "txt_displayWidth";\r
+            this.txt_displayWidth.Size = new System.Drawing.Size(100, 20);\r
+            this.txt_displayWidth.TabIndex = 53;\r
+            this.txt_displayWidth.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_displayWidth_Keyup);\r
+            // \r
+            // lbl_displayWidth\r
+            // \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.Name = "lbl_displayWidth";\r
+            this.lbl_displayWidth.Size = new System.Drawing.Size(90, 13);\r
+            this.lbl_displayWidth.TabIndex = 54;\r
+            this.lbl_displayWidth.Text = "Display Width:";\r
+            // \r
+            // lbl_parWidth\r
+            // \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.Name = "lbl_parWidth";\r
+            this.lbl_parWidth.Size = new System.Drawing.Size(71, 13);\r
+            this.lbl_parWidth.TabIndex = 56;\r
+            this.lbl_parWidth.Text = "PAR Width:";\r
+            // \r
+            // txt_parWidth\r
+            // \r
+            this.txt_parWidth.Location = new System.Drawing.Point(109, 168);\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.txt_parWidth.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_parWidth_Keyup);\r
+            // \r
+            // lbl_parHeight\r
+            // \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.Name = "lbl_parHeight";\r
+            this.lbl_parHeight.Size = new System.Drawing.Size(75, 13);\r
+            this.lbl_parHeight.TabIndex = 58;\r
+            this.lbl_parHeight.Text = "PAR Height:";\r
+            // \r
+            // txt_parHeight\r
+            // \r
+            this.txt_parHeight.Location = new System.Drawing.Point(109, 194);\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
+            this.txt_parHeight.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_parHeight_Keyup);\r
+            // \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.Name = "check_KeepAR";\r
+            this.check_KeepAR.Size = new System.Drawing.Size(69, 17);\r
+            this.check_KeepAR.TabIndex = 59;\r
+            this.check_KeepAR.Text = "Keep AR";\r
+            this.check_KeepAR.UseVisualStyleBackColor = true;\r
+            this.check_KeepAR.CheckedChanged += new System.EventHandler(this.check_KeepAR_CheckedChanged);\r
+            // \r
+            // check_customCrop\r
+            // \r
+            this.check_customCrop.AutoSize = true;\r
+            this.check_customCrop.Location = new System.Drawing.Point(387, 57);\r
+            this.check_customCrop.Name = "check_customCrop";\r
+            this.check_customCrop.Size = new System.Drawing.Size(63, 17);\r
+            this.check_customCrop.TabIndex = 70;\r
+            this.check_customCrop.Text = "Custom:";\r
+            this.check_customCrop.UseVisualStyleBackColor = true;\r
+            this.check_customCrop.CheckedChanged += new System.EventHandler(this.check_customCrop_CheckedChanged);\r
+            // \r
+            // check_autoCrop\r
+            // \r
+            this.check_autoCrop.AutoSize = true;\r
+            this.check_autoCrop.Checked = true;\r
+            this.check_autoCrop.Location = new System.Drawing.Point(387, 33);\r
+            this.check_autoCrop.Name = "check_autoCrop";\r
+            this.check_autoCrop.Size = new System.Drawing.Size(72, 17);\r
+            this.check_autoCrop.TabIndex = 69;\r
+            this.check_autoCrop.TabStop = true;\r
+            this.check_autoCrop.Text = "Automatic";\r
+            this.check_autoCrop.UseVisualStyleBackColor = true;\r
+            this.check_autoCrop.CheckedChanged += new System.EventHandler(this.check_autoCrop_CheckedChanged);\r
+            // \r
+            // crop_bottom\r
+            // \r
+            this.crop_bottom.Enabled = false;\r
+            this.crop_bottom.Location = new System.Drawing.Point(467, 146);\r
+            this.crop_bottom.Maximum = new decimal(new int[] {\r
+            1080,\r
+            0,\r
+            0,\r
+            0});\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
+            // \r
+            // crop_top\r
+            // \r
+            this.crop_top.Enabled = false;\r
+            this.crop_top.Location = new System.Drawing.Point(467, 100);\r
+            this.crop_top.Maximum = new decimal(new int[] {\r
+            1080,\r
+            0,\r
+            0,\r
+            0});\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
+            // \r
+            // crop_left\r
+            // \r
+            this.crop_left.Enabled = false;\r
+            this.crop_left.Location = new System.Drawing.Point(416, 122);\r
+            this.crop_left.Maximum = new decimal(new int[] {\r
+            1920,\r
+            0,\r
+            0,\r
+            0});\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
+            // \r
+            // crop_right\r
+            // \r
+            this.crop_right.Enabled = false;\r
+            this.crop_right.Location = new System.Drawing.Point(518, 122);\r
+            this.crop_right.Maximum = new decimal(new int[] {\r
+            1920,\r
+            0,\r
+            0,\r
+            0});\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
+            // \r
+            // label8\r
+            // \r
+            this.label8.AutoSize = true;\r
+            this.label8.BackColor = System.Drawing.Color.Transparent;\r
+            this.label8.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label8.Location = new System.Drawing.Point(384, 13);\r
+            this.label8.Name = "label8";\r
+            this.label8.Size = new System.Drawing.Size(37, 13);\r
+            this.label8.TabIndex = 60;\r
+            this.label8.Text = "Crop";\r
+            // \r
+            // Label53\r
+            // \r
+            this.Label53.AutoSize = true;\r
+            this.Label53.BackColor = System.Drawing.Color.Transparent;\r
+            this.Label53.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Label53.Location = new System.Drawing.Point(465, 170);\r
+            this.Label53.Name = "Label53";\r
+            this.Label53.Size = new System.Drawing.Size(48, 13);\r
+            this.Label53.TabIndex = 68;\r
+            this.Label53.Text = "Bottom";\r
+            // \r
+            // Label52\r
+            // \r
+            this.Label52.AutoSize = true;\r
+            this.Label52.BackColor = System.Drawing.Color.Transparent;\r
+            this.Label52.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Label52.Location = new System.Drawing.Point(474, 85);\r
+            this.Label52.Name = "Label52";\r
+            this.Label52.Size = new System.Drawing.Size(28, 13);\r
+            this.Label52.TabIndex = 63;\r
+            this.Label52.Text = "Top";\r
+            // \r
+            // Label51\r
+            // \r
+            this.Label51.AutoSize = true;\r
+            this.Label51.BackColor = System.Drawing.Color.Transparent;\r
+            this.Label51.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Label51.Location = new System.Drawing.Point(561, 124);\r
+            this.Label51.Name = "Label51";\r
+            this.Label51.Size = new System.Drawing.Size(36, 13);\r
+            this.Label51.TabIndex = 66;\r
+            this.Label51.Text = "Right";\r
+            // \r
+            // Label15\r
+            // \r
+            this.Label15.AutoSize = true;\r
+            this.Label15.BackColor = System.Drawing.Color.Transparent;\r
+            this.Label15.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.Label15.Location = new System.Drawing.Point(384, 124);\r
+            this.Label15.Name = "Label15";\r
+            this.Label15.Size = new System.Drawing.Size(28, 13);\r
+            this.Label15.TabIndex = 61;\r
+            this.Label15.Text = "Left";\r
+            // \r
+            // lbl_anamorphic\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.Name = "lbl_anamorphic";\r
+            this.lbl_anamorphic.Size = new System.Drawing.Size(72, 12);\r
+            this.lbl_anamorphic.TabIndex = 74;\r
+            this.lbl_anamorphic.Text = "Select a Title";\r
+            // \r
+            // label3\r
+            // \r
+            this.label3.AutoSize = true;\r
+            this.label3.BackColor = System.Drawing.Color.Transparent;\r
+            this.label3.Location = new System.Drawing.Point(13, 221);\r
+            this.label3.Name = "label3";\r
+            this.label3.Size = new System.Drawing.Size(66, 13);\r
+            this.label3.TabIndex = 73;\r
+            this.label3.Text = "Anamorphic:";\r
+            // \r
+            // PictureSettings\r
+            // \r
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;\r
+            this.Controls.Add(this.lbl_anamorphic);\r
+            this.Controls.Add(this.label3);\r
+            this.Controls.Add(this.check_customCrop);\r
+            this.Controls.Add(this.check_autoCrop);\r
+            this.Controls.Add(this.crop_bottom);\r
+            this.Controls.Add(this.crop_top);\r
+            this.Controls.Add(this.crop_left);\r
+            this.Controls.Add(this.crop_right);\r
+            this.Controls.Add(this.label8);\r
+            this.Controls.Add(this.Label53);\r
+            this.Controls.Add(this.Label52);\r
+            this.Controls.Add(this.Label51);\r
+            this.Controls.Add(this.Label15);\r
+            this.Controls.Add(this.check_KeepAR);\r
+            this.Controls.Add(this.lbl_parHeight);\r
+            this.Controls.Add(this.txt_parHeight);\r
+            this.Controls.Add(this.lbl_parWidth);\r
+            this.Controls.Add(this.txt_parWidth);\r
+            this.Controls.Add(this.lbl_displayWidth);\r
+            this.Controls.Add(this.txt_displayWidth);\r
+            this.Controls.Add(this.lbl_modulus);\r
+            this.Controls.Add(this.drop_modulus);\r
+            this.Controls.Add(this.text_height);\r
+            this.Controls.Add(this.text_width);\r
+            this.Controls.Add(this.label4);\r
+            this.Controls.Add(this.lbl_max);\r
+            this.Controls.Add(this.lbl_src_res);\r
+            this.Controls.Add(this.label7);\r
+            this.Controls.Add(this.label6);\r
+            this.Controls.Add(this.drp_anamorphic);\r
+            this.Controls.Add(this.label26);\r
+            this.Controls.Add(this.lbl_Aspect);\r
+            this.Controls.Add(this.Label91);\r
+            this.Controls.Add(this.Label55);\r
+            this.Name = "PictureSettings";\r
+            this.Size = new System.Drawing.Size(666, 279);\r
+            ((System.ComponentModel.ISupportInitialize)(this.text_height)).EndInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.text_width)).EndInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_bottom)).EndInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_top)).EndInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_left)).EndInit();\r
+            ((System.ComponentModel.ISupportInitialize)(this.crop_right)).EndInit();\r
+            this.ResumeLayout(false);\r
+            this.PerformLayout();\r
+\r
+        }\r
+\r
+        #endregion\r
+\r
+        internal System.Windows.Forms.Label label4;\r
+        private System.Windows.Forms.Label lbl_max;\r
+        internal System.Windows.Forms.Label lbl_src_res;\r
+        internal System.Windows.Forms.Label label7;\r
+        internal System.Windows.Forms.Label label6;\r
+        internal System.Windows.Forms.ComboBox drp_anamorphic;\r
+        internal System.Windows.Forms.Label label26;\r
+        internal System.Windows.Forms.Label lbl_Aspect;\r
+        internal System.Windows.Forms.Label Label91;\r
+        internal System.Windows.Forms.Label Label55;\r
+        internal System.Windows.Forms.Label lbl_modulus;\r
+        internal System.Windows.Forms.ComboBox drop_modulus;\r
+        internal System.Windows.Forms.Label lbl_displayWidth;\r
+        internal System.Windows.Forms.Label lbl_parWidth;\r
+        internal System.Windows.Forms.Label lbl_parHeight;\r
+        internal System.Windows.Forms.RadioButton check_customCrop;\r
+        internal System.Windows.Forms.RadioButton check_autoCrop;\r
+        internal System.Windows.Forms.NumericUpDown crop_bottom;\r
+        internal System.Windows.Forms.NumericUpDown crop_top;\r
+        internal System.Windows.Forms.NumericUpDown crop_left;\r
+        internal System.Windows.Forms.NumericUpDown crop_right;\r
+        internal System.Windows.Forms.Label label8;\r
+        internal System.Windows.Forms.Label Label53;\r
+        internal System.Windows.Forms.Label Label52;\r
+        internal System.Windows.Forms.Label Label51;\r
+        internal System.Windows.Forms.Label Label15;\r
+        internal System.Windows.Forms.NumericUpDown text_height;\r
+        internal System.Windows.Forms.NumericUpDown text_width;\r
+        internal System.Windows.Forms.TextBox txt_displayWidth;\r
+        internal System.Windows.Forms.TextBox txt_parWidth;\r
+        internal System.Windows.Forms.TextBox txt_parHeight;\r
+        internal System.Windows.Forms.CheckBox check_KeepAR;\r
+        internal System.Windows.Forms.Label lbl_anamorphic;\r
+        internal System.Windows.Forms.Label label3;\r
+\r
+    }\r
+}\r
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs
new file mode 100644 (file)
index 0000000..77be0db
--- /dev/null
@@ -0,0 +1,729 @@
+using System;\r
+using System.Drawing;\r
+using System.Windows.Forms;\r
+using Handbrake.Parsing;\r
+\r
+namespace Handbrake.Controls\r
+{\r
+    /*\r
+     *  ***** WARNING *****\r
+     *  This file is incomplete.\r
+     *  - Custom Anamorphic mode does not work.\r
+     *  - Several Out of bound exceptions on the numeric up down width/height inputs need fixed.\r
+     *  - Code needs cleaned up and a ton of bugs probably need fixed.\r
+     */ \r
+\r
+\r
+\r
+    /*\r
+     * DISPLAY WIDTH       STORAGE WIDTH   PIXEL WIDTH\r
+     * HEIGHT              KEEP ASPECT     PIXEL HEIGHT\r
+     *\r
+     * --- NOT KEEPING DISPLAY ASPECT ---\r
+     * Changing STORAGE WIDTH changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT\r
+     * Changing PIXEL dimensions changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT\r
+     * Changing DISPLAY WIDTH changes PIXEL WIDTH to DISPLAY WIDTH and PIXEL HEIGHT to STORAGE WIDTH\r
+     * Changing HEIGHT just....changes the height.\r
+     *\r
+     * --- KEEPING DISPLAY ASPECT RATIO ---\r
+     * DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)\r
+     * Disable editing: PIXEL WIDTH, PIXEL HEIGHT\r
+     * Changing DISPLAY WIDTH:\r
+     *    Changes HEIGHT to keep DAR\r
+     *    Changes PIXEL WIDTH to new DISPLAY WIDTH\r
+     *    Changes PIXEL HEIGHT to STORAGE WIDTH\r
+     * Changing HEIGHT\r
+     *    Changes DISPLAY WIDTH to keep DAR\r
+     *    Changes PIXEL WIDTH to new DISPLAY WIDTH\r
+     *    Changes PIXEL HEIGHT to STORAGE WIDTH\r
+     * Changing STORAGE_WIDTH:\r
+     *    Changes PIXEL WIDTH to DISPLAY WIDTH\r
+     *    Changes PIXEL HEIGHT to new STORAGE WIDTH\r
+     */\r
+\r
+    public partial class PictureSettings : UserControl\r
+    {\r
+        // Globals\r
+        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 Boolean heightChangeGuard;\r
+        private Boolean looseAnamorphicHeightGuard;\r
+\r
+        // Window Setup\r
+        public PictureSettings()\r
+        {\r
+            InitializeComponent();\r
+            lbl_max.Text = "";\r
+            drop_modulus.SelectedIndex = 0;\r
+            storageAspect = 0;\r
+        }\r
+        public void setComponentsAfterScan(Title st)\r
+        {\r
+            storageAspect = 0;\r
+            selectedTitle = st;\r
+            // Set the Aspect Ratio\r
+            lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();\r
+            lbl_src_res.Text = selectedTitle.Resolution.Width + " x " + selectedTitle.Resolution.Height;\r
+\r
+            // Set the Recommended Cropping values\r
+            crop_top.Text = selectedTitle.AutoCropDimensions[0].ToString();\r
+            crop_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();\r
+            crop_left.Text = selectedTitle.AutoCropDimensions[2].ToString();\r
+            crop_right.Text = selectedTitle.AutoCropDimensions[3].ToString();\r
+\r
+\r
+            // Set the Resolution Boxes\r
+            text_width.Value = selectedTitle.Resolution.Width;\r
+            text_height.Value = cacluateHeight(selectedTitle.Resolution.Width);\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
+        public void setMax()\r
+        {\r
+            if (maxWidth != 0 && maxHeight != 0)\r
+                lbl_max.Text = "Max Width / Height";\r
+            else if (maxWidth != 0)\r
+                lbl_max.Text = "Max Width";\r
+            else\r
+                lbl_max.Text = "";\r
+        }\r
+\r
+        // Basic Picture Setting Controls\r
+        private void text_width_ValueChanged(object sender, EventArgs e)\r
+        {\r
+            // Get the Modulus\r
+            int mod;\r
+            int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);\r
+\r
+            // Increase or decrease value by the correct mod.\r
+            text_width.Value = widthChangeMod(mod);\r
+\r
+            // Mode Switch\r
+            switch (drp_anamorphic.SelectedIndex)\r
+            {\r
+                case 0:\r
+                    if (calculateUnchangeValue(true) != -1)\r
+                        text_height.Value = calculateUnchangeValue(true);\r
+                    break;\r
+                case 1:\r
+                    lbl_anamorphic.Text = strictAnamorphic();\r
+                    break;\r
+                case 2:\r
+                    lbl_anamorphic.Text = looseAnamorphic();\r
+                    break;\r
+                case 3:\r
+                    customAnamorphic(text_width);\r
+                    break;\r
+            }\r
+                \r
+        }\r
+        private void text_height_ValueChanged(object sender, EventArgs e)\r
+        {\r
+            // Get the Modulus\r
+            int mod;\r
+            int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);\r
+\r
+            // Increase or decrease value by the correct mod.\r
+            if (drp_anamorphic.SelectedIndex != 2)\r
+            {\r
+                decimal val = heightChangeMod(mod);\r
+                heightChangeGuard = true;\r
+                if (text_height.Value != val)\r
+                {\r
+                    heightChangeGuard = false;\r
+                    text_height.Value = val;\r
+                }\r
+            }\r
+\r
+            // Mode Switch\r
+            switch (drp_anamorphic.SelectedIndex)\r
+            {\r
+                case 0:\r
+                    if (drp_anamorphic.SelectedIndex != 3)\r
+                    {\r
+                        if (calculateUnchangeValue(false) != -1)\r
+                            text_width.Value = calculateUnchangeValue(false);\r
+                    }\r
+                    break;\r
+                case 1:\r
+                    lbl_anamorphic.Text = strictAnamorphic();\r
+                    break;\r
+                case 2:\r
+                    if (!looseAnamorphicHeightGuard)\r
+                        lbl_anamorphic.Text = looseAnamorphic();\r
+                    break;\r
+                case 3:\r
+                    if (!heightChangeGuard)\r
+                        customAnamorphic(text_height);\r
+                    break;\r
+            }\r
+            heightChangeGuard = false;\r
+            looseAnamorphicHeightGuard = false;\r
+        }\r
+        private void check_KeepAR_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            // Recalculate Height based on width when enabled\r
+            if (drp_anamorphic.SelectedIndex != 3 && check_KeepAR.Checked && selectedTitle != null)\r
+                text_height.Value = cacluateHeight(widthVal);\r
+\r
+            // Enable Par Width/Height Check boxes if Keep AR is enabled, otherwise disable them\r
+            if (check_KeepAR.Checked)\r
+            {\r
+                txt_parWidth.Enabled = false;\r
+                txt_parHeight.Enabled = false;\r
+            }\r
+            else\r
+            {\r
+                txt_parWidth.Enabled = true;\r
+                txt_parHeight.Enabled = true;\r
+            }\r
+        }\r
+        private void drp_anamorphic_SelectedIndexChanged(object sender, EventArgs e)\r
+        {\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
+                    check_KeepAR.Enabled = true;\r
+                    lbl_anamorphic.Text = "";\r
+                    break;\r
+                case 1: // Strict\r
+                    text_height.BackColor = Color.LightGray;\r
+                    text_width.BackColor = Color.LightGray;\r
+                    text_height.Text = "";\r
+                    text_width.Text = "";\r
+                    text_height.Enabled = false;\r
+                    text_width.Enabled = false;\r
+                    check_KeepAR.CheckState = CheckState.Unchecked;\r
+                    check_KeepAR.Enabled = false;\r
+                    disableCustomAnaControls();\r
+                    lbl_anamorphic.Text = strictAnamorphic();\r
+                    break;\r
+                case 2: // Loose\r
+                    storageAspect = 0;\r
+                    text_width.Text = widthVal.ToString();\r
+                    text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;\r
+                    text_height.Enabled = false;\r
+                    text_height.BackColor = Color.LightGray;\r
+                    text_width.Enabled = true;\r
+                    text_width.BackColor = Color.White;\r
+                    disableCustomAnaControls();\r
+                    lbl_anamorphic.Text = looseAnamorphic();\r
+                    break;\r
+                case 3: // Custom\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
+                    // Actual Work                \r
+                    text_width.Text = widthVal.ToString();\r
+                    text_height.Text = cacluateHeight(widthVal).ToString(); // Bug here\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
+                    darValue = calculateDar();\r
+\r
+                    check_KeepAR.CheckState = CheckState.Checked;\r
+                    check_KeepAR.Enabled = true;\r
+\r
+\r
+                    break;\r
+            }\r
+        }\r
+\r
+        // Custom Anamorphic Controls\r
+        private void txt_displayWidth_Keyup(object sender, KeyEventArgs e)\r
+        {\r
+            if (e.KeyCode == Keys.Enter)\r
+                customAnamorphic(txt_displayWidth);\r
+        }\r
+        private void txt_parHeight_Keyup(object sender, KeyEventArgs e)\r
+        {\r
+            if (e.KeyCode == Keys.Enter)\r
+                customAnamorphic(txt_parHeight);\r
+        }\r
+        private void txt_parWidth_Keyup(object sender, KeyEventArgs e)\r
+        {\r
+            if (e.KeyCode == Keys.Enter)\r
+                customAnamorphic(txt_parWidth);\r
+        }\r
+        \r
+        // Cropping Control\r
+        private void check_autoCrop_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            crop_left.Enabled = false;\r
+            crop_right.Enabled = false;\r
+            crop_top.Enabled = false;\r
+            crop_bottom.Enabled = false;\r
+        }\r
+        private void check_customCrop_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            crop_left.Enabled = true;\r
+            crop_right.Enabled = true;\r
+            crop_top.Enabled = true;\r
+            crop_bottom.Enabled = true;\r
+            if (selectedTitle != null)\r
+            {\r
+                crop_top.Text = selectedTitle.AutoCropDimensions[0].ToString();\r
+                crop_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();\r
+                crop_left.Text = selectedTitle.AutoCropDimensions[2].ToString();\r
+                crop_right.Text = selectedTitle.AutoCropDimensions[3].ToString();\r
+            }\r
+            else\r
+            {\r
+                crop_left.Text = "0";\r
+                crop_right.Text = "0";\r
+                crop_top.Text = "0";\r
+                crop_bottom.Text = "0";\r
+            }\r
+        }\r
+\r
+        // Custom Anamorphic Code\r
+        private void customAnamorphic(Control control)\r
+        {\r
+            // Get and parse all the required values\r
+            int cropLeft = (int)crop_left.Value;\r
+            int cropRight = (int)crop_right.Value;\r
+\r
+            int width = (int)text_width.Value;\r
+            int cropped_width = width - cropLeft - cropRight;\r
+\r
+            int mod = 16;\r
+            int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);\r
+\r
+            int parW, parH;\r
+            double displayWidth;\r
+            int.TryParse(txt_parWidth.Text, out parW);\r
+            int.TryParse(txt_parHeight.Text, out parH);\r
+            double.TryParse(txt_displayWidth.Text, out displayWidth);\r
+\r
+            /* NOT KEEPING DISPLAY ASPECT\r
+             * Changing STORAGE WIDTH changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT\r
+             * Changing PIXEL dimensions changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT\r
+             * Changing DISPLAY WIDTH changes PIXEL WIDTH to DISPLAY WIDTH and PIXEL HEIGHT to STORAGE WIDTH\r
+             * Changing HEIGHT just....changes the height.\r
+             */\r
+            if (!check_KeepAR.Checked)\r
+            {\r
+                switch (control.Name) // TODO Check if CroppedWidth or just Width\r
+                {\r
+                    case "text_width":\r
+                        double dw = (double)cropped_width * parW / parH;\r
+                        txt_displayWidth.Text = dw.ToString();\r
+                        break;\r
+                    case "txt_parWidth":\r
+                        double dwpw = (double)cropped_width * parW / parH;\r
+                        txt_displayWidth.Text = dwpw.ToString();\r
+                        break;\r
+                    case "txt_parHeight":\r
+                        double dwph = (double)cropped_width * parW / parH;\r
+                        txt_displayWidth.Text = dwph.ToString();\r
+                        break;\r
+                    case "txt_displayWidth":\r
+                        txt_parWidth.Text = txt_displayWidth.Text;\r
+                        txt_parHeight.Text = text_width.Text;\r
+                        break;\r
+                }\r
+            }\r
+\r
+            /*\r
+             * KEEPING DISPLAY ASPECT RATIO\r
+             * DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)\r
+             * Disable editing: PIXEL WIDTH, PIXEL HEIGHT\r
+             * Changing DISPLAY WIDTH:\r
+             *     Changes HEIGHT to keep DAR\r
+             *     Changes PIXEL WIDTH to new DISPLAY WIDTH\r
+             *     Changes PIXEL HEIGHT to STORAGE WIDTH\r
+             * Changing HEIGHT\r
+             *     Changes DISPLAY WIDTH to keep DAR\r
+             *     Changes PIXEL WIDTH to new DISPLAY WIDTH\r
+             *     Changes PIXEL HEIGHT to STORAGE WIDTH\r
+             * Changing STORAGE_WIDTH:\r
+             *     Changes PIXEL WIDTH to DISPLAY WIDTH\r
+             *     Changes PIXEL HEIGHT to new STORAGE WIDTH \r
+             */\r
+\r
+            if (check_KeepAR.Checked)\r
+            {\r
+                switch (control.Name)\r
+                {\r
+                    case "txt_displayWidth":\r
+                        heightChangeGuard = true;\r
+                        text_height.Value = (decimal)getHeightKeepDar();  //Changes HEIGHT to keep DAR\r
+                        txt_parWidth.Text = txt_displayWidth.Text;\r
+                        txt_parHeight.Text = cropped_width.ToString();\r
+                        break;\r
+                    case "text_height":\r
+                        heightChangeGuard = true;\r
+                        txt_displayWidth.Text = getDisplayWidthKeepDar().ToString();  //Changes DISPLAY WIDTH to keep DAR\r
+                        txt_parWidth.Text = txt_displayWidth.Text;\r
+                        txt_parHeight.Text = cropped_width.ToString();\r
+                        break;\r
+                    case "text_width":\r
+                        txt_parWidth.Text = txt_displayWidth.Text;\r
+                        txt_parHeight.Text = cropped_width.ToString();\r
+                        break;\r
+                }\r
+            }\r
+        }\r
+        private double getDisplayWidthKeepDar()\r
+        {\r
+            double displayWidth;\r
+            double.TryParse(txt_displayWidth.Text, out displayWidth);\r
+            double currentDar = calculateDar();\r
+            double newDwValue = displayWidth;\r
+\r
+            // Correct display width up or down to correct for dar.           \r
+            if (currentDar > darValue)\r
+            {\r
+                while (currentDar > darValue)\r
+                {\r
+                    displayWidth--;\r
+                    newDwValue = displayWidth;\r
+                    currentDar = calculateDarByVal(text_height.Value, displayWidth);\r
+                }\r
+            }\r
+            else\r
+            {\r
+                while (currentDar < darValue)\r
+                {\r
+                    displayWidth++;\r
+                    newDwValue = displayWidth;\r
+                    currentDar = calculateDarByVal(text_height.Value, displayWidth);\r
+                }\r
+            }\r
+\r
+            darValue = calculateDar(); // Cache the dar value\r
+            return newDwValue;\r
+        }\r
+        private double getHeightKeepDar()\r
+        {\r
+            double displayWidth;\r
+            double.TryParse(txt_displayWidth.Text, out displayWidth);\r
+            double currentDar = calculateDar();\r
+            double newHeightVal = heightVal;\r
+\r
+            // Correct display width up or down.\r
+            if (currentDar > darValue)\r
+            {\r
+                while (currentDar > darValue)\r
+                {\r
+                    heightVal++;\r
+                    newHeightVal = heightVal;\r
+                    currentDar = calculateDarByVal(heightVal, displayWidth);\r
+                }\r
+            }\r
+            else\r
+            {\r
+                while (currentDar < darValue)\r
+                {\r
+                    heightVal--;\r
+                    newHeightVal = heightVal;\r
+                    currentDar = calculateDarByVal(heightVal, displayWidth);\r
+                }\r
+            }\r
+\r
+            darValue = calculateDar(); // Cache the dar value\r
+            return newHeightVal;\r
+        }\r
+        private double calculateDar()\r
+        {\r
+            // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)\r
+            int cropTop = (int)crop_top.Value;\r
+            int cropBottom = (int)crop_bottom.Value;\r
+            int croppedHeight = (int)text_height.Value - cropTop - cropBottom;\r
+\r
+            double displayWidth;\r
+            double.TryParse(txt_displayWidth.Text, out displayWidth);\r
+\r
+            double calculatedDar = displayWidth / croppedHeight;\r
+\r
+            return calculatedDar;\r
+        }\r
+        private double calculateDarByVal(decimal height, double displayWidth)\r
+        {\r
+            // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)\r
+            int cropTop = (int)crop_top.Value;\r
+            int cropBottom = (int)crop_bottom.Value;\r
+            int croppedHeight = (int)height - cropTop - cropBottom;\r
+\r
+            double calculatedDar = darValue;\r
+            if (croppedHeight > 0)\r
+                 calculatedDar = displayWidth / croppedHeight;\r
+\r
+            return calculatedDar;\r
+        }\r
+        private int displayWidth()\r
+        {\r
+            if (selectedTitle != null)\r
+            {\r
+                int actualWidth = (int)text_width.Value;\r
+                int displayWidth = 0;\r
+                int parW, parH;\r
+\r
+                int.TryParse(txt_parWidth.Text, out parW);\r
+                int.TryParse(txt_parHeight.Text, out parH);\r
+\r
+                if (drp_anamorphic.SelectedIndex != 3)\r
+                    displayWidth = (actualWidth * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height);\r
+                else if (parW > 0 && parH > 0)\r
+                    displayWidth = (actualWidth * parW / parH);\r
+\r
+                return displayWidth;\r
+            }\r
+            return -1;\r
+        }\r
+\r
+        // Resolution calculation and controls\r
+        private decimal widthChangeMod(int mod)\r
+        {\r
+            // Increase or decrease the height based on the users input.\r
+            decimal returnVal = text_width.Value > widthVal ? getResolutionJump(mod, text_width.Value, true) : getResolutionJump(mod, text_width.Value, false);\r
+\r
+            // Make sure we don't go above source value\r
+            if (selectedTitle != null)\r
+                if (selectedTitle.Resolution.Width < returnVal)\r
+                    returnVal = selectedTitle.Resolution.Width;\r
+\r
+            // Set the global tracker\r
+            widthVal = (int)returnVal;\r
+\r
+            return returnVal;\r
+        }\r
+        private decimal heightChangeMod(int mod)\r
+        {\r
+            // Increase or decrease the height based on the users input.\r
+            decimal returnVal = text_height.Value > heightVal ? getResolutionJump(mod, text_height.Value, true) : getResolutionJump(mod, text_height.Value, false);\r
+\r
+            // Make sure we don't go above source value\r
+            if (selectedTitle != null)\r
+                if (selectedTitle.Resolution.Height < returnVal)\r
+                    returnVal = selectedTitle.Resolution.Height;\r
+\r
+            // Set the global tracker\r
+            heightVal = (int)returnVal;     // TODO THIS IS CAUSING PROBLEM\r
+\r
+            return returnVal;\r
+        }\r
+        private decimal calculateUnchangeValue(Boolean widthChangeFromControl)\r
+        {\r
+            decimal newValue = -1;\r
+            if (selectedTitle != null && drp_anamorphic.SelectedIndex != 3 && drp_anamorphic.SelectedIndex != 2)\r
+                if (widthChangeFromControl)\r
+                    newValue = cacluateHeight(widthVal);\r
+                else\r
+                {\r
+                    if (check_KeepAR.Checked)\r
+                        newValue = cacluateWidth(heightVal);\r
+                }\r
+\r
+            return newValue;\r
+        }\r
+        private int getResolutionJump(int mod, decimal value, Boolean up)\r
+        {\r
+            if (up)\r
+                while ((value % mod) != 0)\r
+                    value++;\r
+            else\r
+                while ((value % mod) != 0)\r
+                    value--;\r
+\r
+            return (int)value;\r
+        }\r
+        private double getModulusAuto(int mod, double value)\r
+        {\r
+            int modDiv2 = mod / 2;\r
+\r
+            if ((value % mod) != 0)\r
+            {\r
+                double modVal = (int)value % mod;\r
+                if (modVal >= modDiv2)\r
+                {\r
+                    modVal = 16 - modVal;\r
+                    value = (int)value + (int)modVal;\r
+                }\r
+                else\r
+                {\r
+                    value = (int)value - (int)modVal;\r
+                }\r
+            }\r
+            return value;\r
+        }\r
+        private int cacluateHeight(int width)\r
+        {\r
+            int aw = 0;\r
+            int ah = 0;\r
+            if (selectedTitle.AspectRatio.ToString() == "1.78")\r
+            {\r
+                aw = 16;\r
+                ah = 9;\r
+            }\r
+            else if (selectedTitle.AspectRatio.ToString() == "1.33")\r
+            {\r
+                aw = 4;\r
+                ah = 3;\r
+            }\r
+\r
+            if (aw != 0)\r
+            {\r
+                // Crop_Width = Title->Width - crop_Left - crop_right\r
+                // Crop_Height = Title->Height - crop_top - crop_bottom\r
+                double crop_width = selectedTitle.Resolution.Width - (double)crop_left.Value - (double)crop_right.Value;\r
+                double crop_height = selectedTitle.Resolution.Height - (double)crop_top.Value - (double)crop_bottom.Value;\r
+\r
+                double new_height = (width * selectedTitle.Resolution.Width * ah * crop_height) /\r
+                                    (selectedTitle.Resolution.Height * aw * crop_width);\r
+\r
+                if (drp_anamorphic.SelectedIndex == 3)\r
+                    new_height = getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_height);\r
+                else\r
+                    new_height = getModulusAuto(16, new_height);\r
+\r
+                //16 * (421 / 16)\r
+                //double z = ( 16 * (( y + 8 ) / 16 ) );\r
+                int x = int.Parse(new_height.ToString());\r
+                if (x < 64)\r
+                    x = 64;\r
+                return x;\r
+            }\r
+            return 0;\r
+        }\r
+        private int cacluateWidth(int height)\r
+        {\r
+            int aw = 0;\r
+            int ah = 0;\r
+            if (selectedTitle.AspectRatio.ToString() == "1.78")\r
+            {\r
+                aw = 16;\r
+                ah = 9;\r
+            }\r
+            else if (selectedTitle.AspectRatio.ToString() == "1.33")\r
+            {\r
+                aw = 4;\r
+                ah = 3;\r
+            }\r
+\r
+            if (aw != 0)\r
+            {\r
+\r
+                double crop_width = selectedTitle.Resolution.Width - (double)crop_left.Value - (double)crop_right.Value;\r
+                double crop_height = selectedTitle.Resolution.Height - (double)crop_top.Value - (double)crop_bottom.Value;\r
+\r
+                double new_width = (height * selectedTitle.Resolution.Height * aw * crop_width) /\r
+                                    (selectedTitle.Resolution.Width * ah * crop_height);\r
+\r
+                if (drp_anamorphic.SelectedIndex == 3)\r
+                    new_width = getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_width);\r
+                else\r
+                    new_width = getModulusAuto(16, new_width);\r
+\r
+                //16 * (421 / 16)\r
+                //double z = ( 16 * (( y + 8 ) / 16 ) );\r
+                int x = int.Parse(new_width.ToString());\r
+                return x;\r
+            }\r
+            return 0;\r
+        }\r
+\r
+        // Calculate Resolution for Anamorphic functions\r
+        private string strictAnamorphic()\r
+        {\r
+            // TODO Make sure cropping is Mod2\r
+            if (selectedTitle != null)\r
+            {\r
+                // Calculate the Actual Height\r
+                int actualWidth = (int)text_width.Value - (int)crop_left.Value - (int)crop_right.Value; ;\r
+                int actualHeight = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;\r
+                if (drp_anamorphic.SelectedIndex == 2)\r
+                    actualHeight = (int)getModulusAuto(16, actualHeight);\r
+\r
+                // Calculate Actual Width\r
+                double displayWidth = ((double)actualWidth * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height);\r
+                return Math.Round(displayWidth, 0) + "x" + actualHeight;\r
+            }\r
+            return "Select a Title";\r
+        }\r
+        private string looseAnamorphic()\r
+        {\r
+            if (selectedTitle != null)\r
+            {\r
+                // Get some values\r
+                int actualWidth = (int)text_width.Value - (int)crop_left.Value - (int)crop_right.Value;\r
+\r
+                int source_display_width = selectedTitle.Resolution.Width * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height;\r
+                int source_cropped_height = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;\r
+\r
+                // Calculate storage Aspect and cache it for reuse\r
+                if (storageAspect == 0)\r
+                    storageAspect = (double)actualWidth / source_cropped_height;               \r
+\r
+                // Calculate the new height based on the input cropped width\r
+                double hcalc = actualWidth / storageAspect;\r
+                double newHeight = getModulusAuto(16, hcalc);\r
+                looseAnamorphicHeightGuard = true;\r
+                text_height.Value = (decimal)newHeight;   // BUG Out of Range Exception with Width too low here.\r
+\r
+                // Calculate the anamorphic width\r
+                double parW = newHeight * source_display_width / source_cropped_height;\r
+                double parH = actualWidth;\r
+                double displayWidth = (actualWidth * parW / parH);\r
+\r
+                // Now correct DisplayWidth to maintain Aspect ratio.  ActualHeight was mod16'd and thus AR is slightly different than the worked out displayWidths\r
+                return Math.Round(displayWidth, 0) + "x" + newHeight;  \r
+            }\r
+            return "Select a Title";\r
+\r
+        }\r
+        \r
+        // GUI\r
+        private void disableCustomAnaControls()\r
+        {\r
+            // Disable Custom Anamorphic Stuff\r
+            lbl_modulus.Visible = false;\r
+            lbl_displayWidth.Visible = false;\r
+            lbl_parWidth.Visible = false;\r
+            lbl_parHeight.Visible = false;\r
+            drop_modulus.Visible = false;\r
+            txt_displayWidth.Visible = false;\r
+            txt_parWidth.Visible = false;\r
+            txt_parHeight.Visible = false;\r
+            check_KeepAR.Enabled = false;\r
+        }\r
+        private void enableCustomAnaControls()\r
+        {\r
+            // Disable Custom Anamorphic Stuff\r
+            lbl_modulus.Visible = true;\r
+            lbl_displayWidth.Visible = true;\r
+            lbl_parWidth.Visible = true;\r
+            lbl_parHeight.Visible = true;\r
+            drop_modulus.Visible = true;\r
+            txt_displayWidth.Visible = true;\r
+            txt_parWidth.Visible = true;\r
+            txt_parHeight.Visible = true;\r
+            check_KeepAR.Enabled = true;\r
+        }\r
+\r
+    }\r
+}
\ No newline at end of file
diff --git a/win/C#/Controls/PictureSettings.resx b/win/C#/Controls/PictureSettings.resx
new file mode 100644 (file)
index 0000000..ff31a6d
--- /dev/null
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+  <!-- \r
+    Microsoft ResX Schema \r
+    \r
+    Version 2.0\r
+    \r
+    The primary goals of this format is to allow a simple XML format \r
+    that is mostly human readable. The generation and parsing of the \r
+    various data types are done through the TypeConverter classes \r
+    associated with the data types.\r
+    \r
+    Example:\r
+    \r
+    ... ado.net/XML headers & schema ...\r
+    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+    <resheader name="version">2.0</resheader>\r
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+    </data>\r
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+        <comment>This is a comment</comment>\r
+    </data>\r
+                \r
+    There are any number of "resheader" rows that contain simple \r
+    name/value pairs.\r
+    \r
+    Each data row contains a name, and value. The row also contains a \r
+    type or mimetype. Type corresponds to a .NET class that support \r
+    text/value conversion through the TypeConverter architecture. \r
+    Classes that don't support this are serialized and stored with the \r
+    mimetype set.\r
+    \r
+    The mimetype is used for serialized objects, and tells the \r
+    ResXResourceReader how to depersist the object. This is currently not \r
+    extensible. For a given mimetype the value must be set accordingly:\r
+    \r
+    Note - application/x-microsoft.net.object.binary.base64 is the format \r
+    that the ResXResourceWriter will generate, however the reader can \r
+    read any of the formats listed below.\r
+    \r
+    mimetype: application/x-microsoft.net.object.binary.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+            : and then encoded with base64 encoding.\r
+    \r
+    mimetype: application/x-microsoft.net.object.soap.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+            : and then encoded with base64 encoding.\r
+\r
+    mimetype: application/x-microsoft.net.object.bytearray.base64\r
+    value   : The object must be serialized into a byte array \r
+            : using a System.ComponentModel.TypeConverter\r
+            : and then encoded with base64 encoding.\r
+    -->\r
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+    <xsd:element name="root" msdata:IsDataSet="true">\r
+      <xsd:complexType>\r
+        <xsd:choice maxOccurs="unbounded">\r
+          <xsd:element name="metadata">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" use="required" type="xsd:string" />\r
+              <xsd:attribute name="type" type="xsd:string" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="assembly">\r
+            <xsd:complexType>\r
+              <xsd:attribute name="alias" type="xsd:string" />\r
+              <xsd:attribute name="name" type="xsd:string" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="data">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="resheader">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+        </xsd:choice>\r
+      </xsd:complexType>\r
+    </xsd:element>\r
+  </xsd:schema>\r
+  <resheader name="resmimetype">\r
+    <value>text/microsoft-resx</value>\r
+  </resheader>\r
+  <resheader name="version">\r
+    <value>2.0</value>\r
+  </resheader>\r
+  <resheader name="reader">\r
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+  <resheader name="writer">\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+</root>
\ No newline at end of file
index 8da86561acf377923cd371f9d8678d609ded94ec..77b2b2957597ef6f8d3a8b83c88c57570fee8cf4 100644 (file)
@@ -40,6 +40,7 @@ namespace Handbrake.EncodeQueue
                 {\r
                     cliStart.RedirectStandardOutput = true;\r
                     cliStart.UseShellExecute = false;\r
+                    \r
                 }\r
                 if (Properties.Settings.Default.cli_minimized == "Checked")\r
                     cliStart.WindowStyle = ProcessWindowStyle.Minimized;\r
index 9ad6375fca328d63f2bb31f762071543e47852dd..2434ad42ae8eb70f617f3ead9bf47dc2ba70a23e 100644 (file)
@@ -67,13 +67,13 @@ namespace Handbrake.Functions
             #endregion\r
 \r
             #region Picture\r
-            mainWindow.check_autoCrop.Checked = true;\r
+            mainWindow.pictureSettings.check_autoCrop.Checked = true;\r
             if (presetQuery.CropBottom == "0" && presetQuery.CropTop == "0")\r
                 if (presetQuery.CropLeft == "0" && presetQuery.CropRight == "0")\r
-                    mainWindow.check_customCrop.Checked = true;\r
+                    mainWindow.pictureSettings.check_customCrop.Checked = true;\r
 \r
-            mainWindow.text_width.Text = "";\r
-            mainWindow.text_height.Text = "";\r
+            mainWindow.pictureSettings.text_width.Text = "";\r
+            mainWindow.pictureSettings.text_height.Text = "";\r
 \r
             if (pictureSettings)\r
             {\r
@@ -85,41 +85,41 @@ namespace Handbrake.Functions
                     int.TryParse(presetQuery.CropLeft, out left);\r
                     int.TryParse(presetQuery.CropRight, out right);\r
 \r
-                    mainWindow.check_customCrop.Checked = true;\r
-                    mainWindow.text_top.Value = top;\r
-                    mainWindow.text_bottom.Value = bottom;\r
-                    mainWindow.text_left.Value = left;\r
-                    mainWindow.text_right.Value = right;\r
+                    mainWindow.pictureSettings.check_customCrop.Checked = true;\r
+                    mainWindow.pictureSettings.crop_top.Value = top;\r
+                    mainWindow.pictureSettings.crop_bottom.Value = bottom;\r
+                    mainWindow.pictureSettings.crop_left.Value = left;\r
+                    mainWindow.pictureSettings.crop_right.Value = right;\r
                 }\r
 \r
                 if (presetQuery.Width != 0)\r
-                    mainWindow.text_width.Text = presetQuery.Width.ToString();\r
+                    mainWindow.pictureSettings.text_width.Text = presetQuery.Width.ToString();\r
 \r
                 if (presetQuery.Height != 0)\r
-                    mainWindow.text_height.Text = presetQuery.Height.ToString();\r
+                    mainWindow.pictureSettings.text_height.Text = presetQuery.Height.ToString();\r
             }\r
 \r
-            mainWindow.drp_anamorphic.SelectedIndex = presetQuery.Anamorphic ? 1 : 0;\r
+            mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = presetQuery.Anamorphic ? 1 : 0;\r
 \r
             if (presetQuery.LooseAnamorphic)\r
-                mainWindow.drp_anamorphic.SelectedIndex = 2;\r
+                mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = 2;\r
             else\r
             {\r
                 if (presetQuery.Anamorphic != true)\r
-                    mainWindow.drp_anamorphic.SelectedIndex = 0;\r
+                    mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = 0;\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.pictureSettings.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.pictureSettings.text_height.Text = presetQuery.MaxHeight.ToString();\r
                 mainWindow.maxHeight = presetQuery.MaxHeight;\r
             }\r
 \r
index bab608c57747894d4070086c0bcbee955356fd59..a60ad31125521a796c5375ffe207810ee1d0791d 100644 (file)
@@ -121,55 +121,63 @@ namespace Handbrake.Functions
             if (mainWindow.maxWidth == 0)\r
             {\r
 \r
-                if (mainWindow.text_width.Text != "")\r
-                    query += " -w " + mainWindow.text_width.Text;\r
+                if (mainWindow.pictureSettings.text_width.Text != "")\r
+                    query += " -w " + mainWindow.pictureSettings.text_width.Text;\r
             }\r
             else\r
             {\r
-                if (mainWindow.text_width.Text != "")\r
-                    query += " -X " + mainWindow.text_width.Text;\r
+                if (mainWindow.pictureSettings.text_width.Text != "")\r
+                    query += " -X " + mainWindow.pictureSettings.text_width.Text;\r
             }\r
 \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
+                if (mainWindow.pictureSettings.text_height.Text != "")\r
+                    query += " -l " + mainWindow.pictureSettings.text_height.Text;\r
             }\r
             else\r
             {\r
-                if (mainWindow.text_height.Text != "")\r
-                    query += " -Y " + mainWindow.text_height.Text;\r
+                if (mainWindow.pictureSettings.text_height.Text != "")\r
+                    query += " -Y " + mainWindow.pictureSettings.text_height.Text;\r
             }\r
 \r
-            string cropTop = mainWindow.text_top.Text;\r
-            string cropBottom = mainWindow.text_bottom.Text;\r
-            string cropLeft = mainWindow.text_left.Text;\r
-            string cropRight = mainWindow.text_right.Text;\r
+            string cropTop = mainWindow.pictureSettings.crop_top.Text;\r
+            string cropBottom = mainWindow.pictureSettings.crop_bottom.Text;\r
+            string cropLeft = mainWindow.pictureSettings.crop_left.Text;\r
+            string cropRight = mainWindow.pictureSettings.crop_right.Text;\r
 \r
-            if (mainWindow.check_customCrop.Checked)\r
+            if (mainWindow.pictureSettings.check_customCrop.Checked)\r
             {\r
-                if (mainWindow.text_top.Text == string.Empty)\r
+                if (mainWindow.pictureSettings.crop_top.Text == string.Empty)\r
                     cropTop = "0";\r
-                if (mainWindow.text_bottom.Text == string.Empty)\r
+                if (mainWindow.pictureSettings.crop_bottom.Text == string.Empty)\r
                     cropBottom = "0";\r
-                if (mainWindow.text_left.Text == string.Empty)\r
+                if (mainWindow.pictureSettings.crop_left.Text == string.Empty)\r
                     cropLeft = "0";\r
-                if (mainWindow.text_right.Text == string.Empty)\r
+                if (mainWindow.pictureSettings.crop_right.Text == string.Empty)\r
                     cropRight = "0";\r
 \r
                 query += " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;\r
             }\r
 \r
-            if (mainWindow.drp_anamorphic.SelectedIndex == 1)\r
-                query += " -p ";\r
-            else if (mainWindow.drp_anamorphic.SelectedIndex == 2)\r
-                query += " -P ";\r
-\r
-            if (mainWindow.slider_deblock.Value != 4)\r
-                query += " --deblock=" + mainWindow.slider_deblock.Value;\r
-\r
-            \r
+            switch (mainWindow.pictureSettings.drp_anamorphic.SelectedIndex)\r
+            {\r
+                case 1:\r
+                    query += " --strict-anamorphic ";\r
+                    break;\r
+                case 2:\r
+                    query += " --loose-anamorphic ";\r
+                    break;\r
+                case 3:\r
+                    query += " --custom-anamorphic ";\r
+                    query += " --display-width " + mainWindow.pictureSettings.txt_displayWidth.Text + " ";\r
+                    if (mainWindow.pictureSettings.check_KeepAR.Checked)\r
+                        query += " --keep-display-aspect ";\r
+                    if (mainWindow.pictureSettings.txt_parWidth.Text != "" && mainWindow.pictureSettings.txt_parHeight.Text != "")\r
+                        query += " --pixel-aspect " + mainWindow.pictureSettings.txt_parWidth.Text + ":" + mainWindow.pictureSettings.txt_parHeight.Text + " ";\r
+                    break;\r
+            }           \r
             #endregion\r
 \r
             #region Filters\r
@@ -177,6 +185,9 @@ namespace Handbrake.Functions
             query += mainWindow.ctl_decomb.getCLIQuery;\r
             query += mainWindow.ctl_deinterlace.getCLIQuery;\r
             query += mainWindow.ctl_denoise.getCLIQuery;\r
+\r
+            if (mainWindow.slider_deblock.Value != 4)\r
+                query += " --deblock=" + mainWindow.slider_deblock.Value;\r
             #endregion\r
 \r
             #region Video Settings Tab\r
index bbdb77b7e72de05b779f484618f9770d0af0b9a6..ff621c625b332e72e41bda53e6d147ac6441cc0d 100644 (file)
@@ -299,7 +299,6 @@ namespace Handbrake.Functions
                 if (videoQuality.Success)\r
                 {\r
                     float qConvert = float.Parse(videoQuality.ToString().Replace("-q ", ""), Culture);\r
-                    //qConvert = Math.Ceiling(qConvert);\r
                     thisQuery.VideoQuality = qConvert;\r
                 }\r
                 #endregion\r
index b082ce6ab0fcd374d83ce71cd314036a3beb44be..8e294d90d56dd07cd638203db991caa655a0cd9b 100644 (file)
     <Compile Include="Controls\Deinterlace.Designer.cs">\r
       <DependentUpon>Deinterlace.cs</DependentUpon>\r
     </Compile>\r
+    <Compile Include="Controls\PictureSettings.cs">\r
+      <SubType>UserControl</SubType>\r
+    </Compile>\r
+    <Compile Include="Controls\PictureSettings.Designer.cs">\r
+      <DependentUpon>PictureSettings.cs</DependentUpon>\r
+    </Compile>\r
     <Compile Include="Controls\x264Panel.cs">\r
       <SubType>UserControl</SubType>\r
     </Compile>\r
       <DependentUpon>Deinterlace.cs</DependentUpon>\r
       <SubType>Designer</SubType>\r
     </EmbeddedResource>\r
+    <EmbeddedResource Include="Controls\PictureSettings.resx">\r
+      <DependentUpon>PictureSettings.cs</DependentUpon>\r
+      <SubType>Designer</SubType>\r
+    </EmbeddedResource>\r
     <EmbeddedResource Include="Controls\x264Panel.resx">\r
       <DependentUpon>x264Panel.cs</DependentUpon>\r
       <SubType>Designer</SubType>\r
index 4b1e7dee2ae9c955de26993a6d138850aefca422..f666e270f4cf255ecfeac63521ce8cfcab20917c 100644 (file)
@@ -99,9 +99,7 @@ Section "Handbrake" SEC01
   File "HandBrakeCLI.exe"\r
   File "Handbrake.exe.config"\r
   File "handbrakepineapple.ico"\r
-  File "presets.xml"\r
-  File "user_presets.xml"\r
-  \r
+\r
   SetOutPath "$INSTDIR\doc"\r
   SetOverwrite ifnewer\r
   File "doc\AUTHORS"\r
@@ -147,8 +145,6 @@ Section Uninstall
   Delete "$INSTDIR\handbrakepineapple.ico"\r
   Delete "$INSTDIR\Handbrake.exe"\r
   Delete "$INSTDIR\Handbrake.exe.config"\r
-  Delete "$INSTDIR\presets.xml"\r
-  Delete "$INSTDIR\user_presets.xml"\r
   Delete "$INSTDIR\doc\AUTHORS"\r
   Delete "$INSTDIR\doc\BUILD"\r
   Delete "$INSTDIR\doc\COPYING"\r
index 69afe3e90ef5ad2a3c6dfd6a687d39c0a78e1c7d..e79dd72bd3bb7f87cd80691259ad54b2c797b2ed 100644 (file)
@@ -28,7 +28,8 @@ namespace Handbrake.Parsing
         private TimeSpan m_duration;\r
         private Size m_resolution;\r
         private int m_titleNumber;\r
-\r
+        private Size m_parVal;\r
+        \r
         /// <summary>\r
         /// The constructor for this object\r
         /// </summary>\r
@@ -95,6 +96,14 @@ namespace Handbrake.Parsing
             get { return m_aspectRatio; }\r
         }\r
 \r
+        /// <summary>\r
+        /// Par Value\r
+        /// </summary>\r
+        public Size ParVal\r
+        {\r
+            get { return m_parVal; }\r
+        }\r
+\r
         /// <summary>\r
         /// The automatically detected crop region for this Title.\r
         /// This is an int array with 4 items in it as so:\r
@@ -163,11 +172,16 @@ namespace Handbrake.Parsing
 \r
             // Get resolution, aspect ratio and FPS for this title\r
             m = Regex.Match(output.ReadLine(),\r
-                            @"^  \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
+                            @"^  \+ size: ([0-9]*)x([0-9]*), pixel aspect: ([0-9]*)/([0-9]*), display aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
+            //size: 720x576, pixel aspect: 16/15, display aspect: 1.33, 25.000 fps\r
+\r
+\r
+\r
             if (m.Success)\r
             {\r
                 thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
-                thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Culture);\r
+                thisTitle.m_parVal = new Size(int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value));\r
+                thisTitle.m_aspectRatio = float.Parse(m.Groups[5].Value, Culture);\r
             }\r
 \r
             // Get autocrop region for this title\r
index 90c6f4955142a0f6712a6373eb551d5955cbb7b4..729bf142fd9ec09e46cad142867982a1ad310771 100644 (file)
@@ -58,8 +58,6 @@ namespace Handbrake
             this.text_bitrate = new System.Windows.Forms.TextBox();\r
             this.drp_subtitle = new System.Windows.Forms.ComboBox();\r
             this.btn_setDefault = new System.Windows.Forms.Button();\r
-            this.text_height = new System.Windows.Forms.TextBox();\r
-            this.text_width = new System.Windows.Forms.TextBox();\r
             this.check_optimiseMP4 = new System.Windows.Forms.CheckBox();\r
             this.check_iPodAtom = new System.Windows.Forms.CheckBox();\r
             this.data_chpt = new System.Windows.Forms.DataGridView();\r
@@ -68,14 +66,10 @@ namespace Handbrake
             this.btn_addPreset = new System.Windows.Forms.Button();\r
             this.btn_removePreset = new System.Windows.Forms.Button();\r
             this.drop_format = new System.Windows.Forms.ComboBox();\r
-            this.check_customCrop = new System.Windows.Forms.RadioButton();\r
-            this.check_autoCrop = new System.Windows.Forms.RadioButton();\r
             this.text_source = new System.Windows.Forms.TextBox();\r
             this.drop_angle = new System.Windows.Forms.ComboBox();\r
-            this.lbl_src_res = new System.Windows.Forms.Label();\r
             this.lbl_duration = new System.Windows.Forms.Label();\r
             this.label_duration = new System.Windows.Forms.Label();\r
-            this.label7 = new System.Windows.Forms.Label();\r
             this.DVD_Open = new System.Windows.Forms.FolderBrowserDialog();\r
             this.File_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.ISO_Open = new System.Windows.Forms.OpenFileDialog();\r
@@ -116,7 +110,6 @@ namespace Handbrake
             this.Label47 = new System.Windows.Forms.Label();\r
             this.Label3 = new System.Windows.Forms.Label();\r
             this.tab_audio = new System.Windows.Forms.TabPage();\r
-            this.audioPanel = new Handbrake.Controls.AudioPanel();\r
             this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);\r
             this.check_forced = new System.Windows.Forms.CheckBox();\r
             this.Label19 = new System.Windows.Forms.Label();\r
@@ -132,23 +125,6 @@ namespace Handbrake
             this.Label46 = new System.Windows.Forms.Label();\r
             this.check_grayscale = new System.Windows.Forms.CheckBox();\r
             this.tab_picture = new System.Windows.Forms.TabPage();\r
-            this.lbl_max = new System.Windows.Forms.Label();\r
-            this.label6 = new System.Windows.Forms.Label();\r
-            this.drp_anamorphic = new System.Windows.Forms.ComboBox();\r
-            this.text_bottom = new System.Windows.Forms.NumericUpDown();\r
-            this.text_top = new System.Windows.Forms.NumericUpDown();\r
-            this.text_left = new System.Windows.Forms.NumericUpDown();\r
-            this.text_right = new System.Windows.Forms.NumericUpDown();\r
-            this.label26 = new System.Windows.Forms.Label();\r
-            this.Label56 = new System.Windows.Forms.Label();\r
-            this.lbl_Aspect = new System.Windows.Forms.Label();\r
-            this.Label91 = new System.Windows.Forms.Label();\r
-            this.Label55 = new System.Windows.Forms.Label();\r
-            this.Label1 = new System.Windows.Forms.Label();\r
-            this.Label53 = new System.Windows.Forms.Label();\r
-            this.Label52 = new System.Windows.Forms.Label();\r
-            this.Label51 = new System.Windows.Forms.Label();\r
-            this.Label15 = new System.Windows.Forms.Label();\r
             this.slider_deblock = new System.Windows.Forms.TrackBar();\r
             this.label8 = new System.Windows.Forms.Label();\r
             this.lbl_deblockVal = new System.Windows.Forms.Label();\r
@@ -156,15 +132,10 @@ namespace Handbrake
             this.Check_ChapterMarkers = new System.Windows.Forms.CheckBox();\r
             this.tabs_panel = new System.Windows.Forms.TabControl();\r
             this.tab_filters = new System.Windows.Forms.TabPage();\r
-            this.ctl_deinterlace = new Handbrake.Deinterlace();\r
-            this.ctl_denoise = new Handbrake.Denoise();\r
-            this.ctl_decomb = new Handbrake.Decomb();\r
-            this.ctl_detelecine = new Handbrake.Detelecine();\r
             this.tab_subtitles = new System.Windows.Forms.TabPage();\r
             this.tab_chapters = new System.Windows.Forms.TabPage();\r
             this.label31 = new System.Windows.Forms.Label();\r
             this.tab_advanced = new System.Windows.Forms.TabPage();\r
-            this.x264Panel = new Handbrake.Controls.x264Panel();\r
             this.tab_query = new System.Windows.Forms.TabPage();\r
             this.btn_clear = new System.Windows.Forms.Button();\r
             this.label34 = new System.Windows.Forms.Label();\r
@@ -199,6 +170,13 @@ namespace Handbrake
             this.StatusStrip = new System.Windows.Forms.StatusStrip();\r
             this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();\r
             this.hbproc = new System.Diagnostics.Process();\r
+            this.pictureSettings = new Handbrake.Controls.PictureSettings();\r
+            this.ctl_deinterlace = new Handbrake.Deinterlace();\r
+            this.ctl_denoise = new Handbrake.Denoise();\r
+            this.ctl_decomb = new Handbrake.Decomb();\r
+            this.ctl_detelecine = new Handbrake.Detelecine();\r
+            this.audioPanel = new Handbrake.Controls.AudioPanel();\r
+            this.x264Panel = new Handbrake.Controls.x264Panel();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
@@ -209,10 +187,6 @@ namespace Handbrake
             this.tab_audio.SuspendLayout();\r
             this.tab_video.SuspendLayout();\r
             this.tab_picture.SuspendLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_bottom)).BeginInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_top)).BeginInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_left)).BeginInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_right)).BeginInit();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_deblock)).BeginInit();\r
             this.tabs_panel.SuspendLayout();\r
             this.tab_filters.SuspendLayout();\r
@@ -440,28 +414,6 @@ namespace Handbrake
             this.btn_setDefault.UseVisualStyleBackColor = true;\r
             this.btn_setDefault.Click += new System.EventHandler(this.btn_setDefault_Click);\r
             // \r
-            // text_height\r
-            // \r
-            this.text_height.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.text_height.ForeColor = System.Drawing.SystemColors.InfoText;\r
-            this.text_height.Location = new System.Drawing.Point(498, 81);\r
-            this.text_height.Name = "text_height";\r
-            this.text_height.Size = new System.Drawing.Size(64, 21);\r
-            this.text_height.TabIndex = 19;\r
-            this.ToolTip.SetToolTip(this.text_height, "Video Resolution (Height)\r\nCan only be altered when Anamorphic is set to \"None\"");\r
-            this.text_height.TextChanged += new System.EventHandler(this.text_height_TextChanged);\r
-            // \r
-            // text_width\r
-            // \r
-            this.text_width.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.text_width.Location = new System.Drawing.Point(407, 81);\r
-            this.text_width.Name = "text_width";\r
-            this.text_width.Size = new System.Drawing.Size(64, 21);\r
-            this.text_width.TabIndex = 17;\r
-            this.ToolTip.SetToolTip(this.text_width, "Video Resolution (Width)\r\nCan only be altered when Anamorphic is set to \"None\" or" +\r
-                    " \"Loose\"");\r
-            this.text_width.TextChanged += new System.EventHandler(this.text_width_TextChanged);\r
-            // \r
             // check_optimiseMP4\r
             // \r
             this.check_optimiseMP4.AutoSize = true;\r
@@ -572,32 +524,6 @@ namespace Handbrake
             this.ToolTip.SetToolTip(this.drop_format, "Select the file container format.");\r
             this.drop_format.SelectedIndexChanged += new System.EventHandler(this.drop_format_SelectedIndexChanged);\r
             // \r
-            // check_customCrop\r
-            // \r
-            this.check_customCrop.AutoSize = true;\r
-            this.check_customCrop.Location = new System.Drawing.Point(16, 58);\r
-            this.check_customCrop.Name = "check_customCrop";\r
-            this.check_customCrop.Size = new System.Drawing.Size(74, 17);\r
-            this.check_customCrop.TabIndex = 34;\r
-            this.check_customCrop.Text = "Custom:";\r
-            this.ToolTip.SetToolTip(this.check_customCrop, "Set some custom cropping values.");\r
-            this.check_customCrop.UseVisualStyleBackColor = true;\r
-            this.check_customCrop.CheckedChanged += new System.EventHandler(this.check_customCrop_CheckedChanged);\r
-            // \r
-            // check_autoCrop\r
-            // \r
-            this.check_autoCrop.AutoSize = true;\r
-            this.check_autoCrop.Checked = true;\r
-            this.check_autoCrop.Location = new System.Drawing.Point(16, 34);\r
-            this.check_autoCrop.Name = "check_autoCrop";\r
-            this.check_autoCrop.Size = new System.Drawing.Size(82, 17);\r
-            this.check_autoCrop.TabIndex = 33;\r
-            this.check_autoCrop.TabStop = true;\r
-            this.check_autoCrop.Text = "Automatic";\r
-            this.ToolTip.SetToolTip(this.check_autoCrop, "Automatically set cropping values.");\r
-            this.check_autoCrop.UseVisualStyleBackColor = true;\r
-            this.check_autoCrop.CheckedChanged += new System.EventHandler(this.check_autoCrop_CheckedChanged);\r
-            // \r
             // text_source\r
             // \r
             this.text_source.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -620,17 +546,6 @@ namespace Handbrake
             this.drop_angle.TabIndex = 45;\r
             this.ToolTip.SetToolTip(this.drop_angle, "Select the chapter range you would like to enocde. (default: All Chapters)");\r
             // \r
-            // lbl_src_res\r
-            // \r
-            this.lbl_src_res.AutoSize = true;\r
-            this.lbl_src_res.BackColor = System.Drawing.Color.Transparent;\r
-            this.lbl_src_res.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_src_res.Location = new System.Drawing.Point(405, 34);\r
-            this.lbl_src_res.Name = "lbl_src_res";\r
-            this.lbl_src_res.Size = new System.Drawing.Size(72, 12);\r
-            this.lbl_src_res.TabIndex = 13;\r
-            this.lbl_src_res.Text = "Select a Title";\r
-            // \r
             // lbl_duration\r
             // \r
             this.lbl_duration.AutoSize = true;\r
@@ -653,16 +568,6 @@ namespace Handbrake
             this.label_duration.TabIndex = 42;\r
             this.label_duration.Text = "Duration:";\r
             // \r
-            // label7\r
-            // \r
-            this.label7.AutoSize = true;\r
-            this.label7.BackColor = System.Drawing.Color.Transparent;\r
-            this.label7.Location = new System.Drawing.Point(311, 34);\r
-            this.label7.Name = "label7";\r
-            this.label7.Size = new System.Drawing.Size(52, 13);\r
-            this.label7.TabIndex = 12;\r
-            this.label7.Text = "Source:";\r
-            // \r
             // DVD_Open\r
             // \r
             this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drive.";\r
@@ -1027,15 +932,6 @@ namespace Handbrake
             this.tab_audio.TabIndex = 3;\r
             this.tab_audio.Text = "Audio";\r
             this.tab_audio.UseVisualStyleBackColor = true;\r
-            // \r
-            // audioPanel\r
-            // \r
-            this.audioPanel.BackColor = System.Drawing.Color.Transparent;\r
-            this.audioPanel.Location = new System.Drawing.Point(0, 0);\r
-            this.audioPanel.Name = "audioPanel";\r
-            this.audioPanel.Size = new System.Drawing.Size(715, 310);\r
-            this.audioPanel.TabIndex = 0;\r
-  \r
             // \r
             // AudioMenuRowHeightHack\r
             // \r
@@ -1210,29 +1106,7 @@ namespace Handbrake
             // tab_picture\r
             // \r
             this.tab_picture.BackColor = System.Drawing.Color.Transparent;\r
-            this.tab_picture.Controls.Add(this.lbl_max);\r
-            this.tab_picture.Controls.Add(this.check_customCrop);\r
-            this.tab_picture.Controls.Add(this.check_autoCrop);\r
-            this.tab_picture.Controls.Add(this.lbl_src_res);\r
-            this.tab_picture.Controls.Add(this.label7);\r
-            this.tab_picture.Controls.Add(this.label6);\r
-            this.tab_picture.Controls.Add(this.drp_anamorphic);\r
-            this.tab_picture.Controls.Add(this.text_bottom);\r
-            this.tab_picture.Controls.Add(this.text_top);\r
-            this.tab_picture.Controls.Add(this.text_left);\r
-            this.tab_picture.Controls.Add(this.text_right);\r
-            this.tab_picture.Controls.Add(this.label26);\r
-            this.tab_picture.Controls.Add(this.Label56);\r
-            this.tab_picture.Controls.Add(this.lbl_Aspect);\r
-            this.tab_picture.Controls.Add(this.Label91);\r
-            this.tab_picture.Controls.Add(this.text_height);\r
-            this.tab_picture.Controls.Add(this.Label55);\r
-            this.tab_picture.Controls.Add(this.text_width);\r
-            this.tab_picture.Controls.Add(this.Label1);\r
-            this.tab_picture.Controls.Add(this.Label53);\r
-            this.tab_picture.Controls.Add(this.Label52);\r
-            this.tab_picture.Controls.Add(this.Label51);\r
-            this.tab_picture.Controls.Add(this.Label15);\r
+            this.tab_picture.Controls.Add(this.pictureSettings);\r
             this.tab_picture.Location = new System.Drawing.Point(4, 22);\r
             this.tab_picture.Name = "tab_picture";\r
             this.tab_picture.Padding = new System.Windows.Forms.Padding(3);\r
@@ -1241,205 +1115,6 @@ namespace Handbrake
             this.tab_picture.Text = "Picture Settings";\r
             this.tab_picture.UseVisualStyleBackColor = true;\r
             // \r
-            // lbl_max\r
-            // \r
-            this.lbl_max.AutoSize = true;\r
-            this.lbl_max.Location = new System.Drawing.Point(568, 86);\r
-            this.lbl_max.Name = "lbl_max";\r
-            this.lbl_max.Size = new System.Drawing.Size(46, 13);\r
-            this.lbl_max.TabIndex = 35;\r
-            this.lbl_max.Text = "{max}";\r
-            // \r
-            // label6\r
-            // \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(311, 111);\r
-            this.label6.Name = "label6";\r
-            this.label6.Size = new System.Drawing.Size(80, 13);\r
-            this.label6.TabIndex = 20;\r
-            this.label6.Text = "Anamorphic:";\r
-            // \r
-            // drp_anamorphic\r
-            // \r
-            this.drp_anamorphic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
-            this.drp_anamorphic.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.drp_anamorphic.FormattingEnabled = true;\r
-            this.drp_anamorphic.Items.AddRange(new object[] {\r
-            "None",\r
-            "Strict",\r
-            "Loose"});\r
-            this.drp_anamorphic.Location = new System.Drawing.Point(407, 108);\r
-            this.drp_anamorphic.Name = "drp_anamorphic";\r
-            this.drp_anamorphic.Size = new System.Drawing.Size(110, 21);\r
-            this.drp_anamorphic.TabIndex = 21;\r
-            this.drp_anamorphic.SelectedIndexChanged += new System.EventHandler(this.drp_anamorphic_SelectedIndexChanged);\r
-            // \r
-            // text_bottom\r
-            // \r
-            this.text_bottom.Enabled = false;\r
-            this.text_bottom.Location = new System.Drawing.Point(96, 147);\r
-            this.text_bottom.Maximum = new decimal(new int[] {\r
-            1080,\r
-            0,\r
-            0,\r
-            0});\r
-            this.text_bottom.Name = "text_bottom";\r
-            this.text_bottom.Size = new System.Drawing.Size(44, 21);\r
-            this.text_bottom.TabIndex = 9;\r
-            // \r
-            // text_top\r
-            // \r
-            this.text_top.Enabled = false;\r
-            this.text_top.Location = new System.Drawing.Point(96, 101);\r
-            this.text_top.Maximum = new decimal(new int[] {\r
-            1080,\r
-            0,\r
-            0,\r
-            0});\r
-            this.text_top.Name = "text_top";\r
-            this.text_top.Size = new System.Drawing.Size(44, 21);\r
-            this.text_top.TabIndex = 6;\r
-            // \r
-            // text_left\r
-            // \r
-            this.text_left.Enabled = false;\r
-            this.text_left.Location = new System.Drawing.Point(45, 123);\r
-            this.text_left.Maximum = new decimal(new int[] {\r
-            1920,\r
-            0,\r
-            0,\r
-            0});\r
-            this.text_left.Name = "text_left";\r
-            this.text_left.Size = new System.Drawing.Size(44, 21);\r
-            this.text_left.TabIndex = 4;\r
-            // \r
-            // text_right\r
-            // \r
-            this.text_right.Enabled = false;\r
-            this.text_right.Location = new System.Drawing.Point(147, 123);\r
-            this.text_right.Maximum = new decimal(new int[] {\r
-            1920,\r
-            0,\r
-            0,\r
-            0});\r
-            this.text_right.Name = "text_right";\r
-            this.text_right.Size = new System.Drawing.Size(44, 21);\r
-            this.text_right.TabIndex = 7;\r
-            // \r
-            // label26\r
-            // \r
-            this.label26.AutoSize = true;\r
-            this.label26.BackColor = System.Drawing.Color.Transparent;\r
-            this.label26.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label26.Location = new System.Drawing.Point(311, 13);\r
-            this.label26.Name = "label26";\r
-            this.label26.Size = new System.Drawing.Size(34, 13);\r
-            this.label26.TabIndex = 11;\r
-            this.label26.Text = "Size";\r
-            // \r
-            // Label56\r
-            // \r
-            this.Label56.AutoSize = true;\r
-            this.Label56.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label56.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label56.ForeColor = System.Drawing.Color.Black;\r
-            this.Label56.Location = new System.Drawing.Point(477, 85);\r
-            this.Label56.Name = "Label56";\r
-            this.Label56.Size = new System.Drawing.Size(15, 13);\r
-            this.Label56.TabIndex = 18;\r
-            this.Label56.Text = "x";\r
-            // \r
-            // lbl_Aspect\r
-            // \r
-            this.lbl_Aspect.AutoSize = true;\r
-            this.lbl_Aspect.BackColor = System.Drawing.Color.Transparent;\r
-            this.lbl_Aspect.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_Aspect.Location = new System.Drawing.Point(405, 58);\r
-            this.lbl_Aspect.Name = "lbl_Aspect";\r
-            this.lbl_Aspect.Size = new System.Drawing.Size(72, 12);\r
-            this.lbl_Aspect.TabIndex = 15;\r
-            this.lbl_Aspect.Text = "Select a Title";\r
-            // \r
-            // Label91\r
-            // \r
-            this.Label91.AutoSize = true;\r
-            this.Label91.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label91.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label91.Location = new System.Drawing.Point(311, 57);\r
-            this.Label91.Name = "Label91";\r
-            this.Label91.Size = new System.Drawing.Size(83, 13);\r
-            this.Label91.TabIndex = 14;\r
-            this.Label91.Text = "Aspect Ratio:";\r
-            // \r
-            // Label55\r
-            // \r
-            this.Label55.AutoSize = true;\r
-            this.Label55.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label55.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label55.ForeColor = System.Drawing.Color.Black;\r
-            this.Label55.Location = new System.Drawing.Point(311, 84);\r
-            this.Label55.Name = "Label55";\r
-            this.Label55.Size = new System.Drawing.Size(85, 13);\r
-            this.Label55.TabIndex = 16;\r
-            this.Label55.Text = "Width/Height:";\r
-            // \r
-            // Label1\r
-            // \r
-            this.Label1.AutoSize = true;\r
-            this.Label1.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label1.Location = new System.Drawing.Point(13, 13);\r
-            this.Label1.Name = "Label1";\r
-            this.Label1.Size = new System.Drawing.Size(37, 13);\r
-            this.Label1.TabIndex = 0;\r
-            this.Label1.Text = "Crop";\r
-            // \r
-            // Label53\r
-            // \r
-            this.Label53.AutoSize = true;\r
-            this.Label53.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label53.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label53.Location = new System.Drawing.Point(94, 171);\r
-            this.Label53.Name = "Label53";\r
-            this.Label53.Size = new System.Drawing.Size(48, 13);\r
-            this.Label53.TabIndex = 10;\r
-            this.Label53.Text = "Bottom";\r
-            // \r
-            // Label52\r
-            // \r
-            this.Label52.AutoSize = true;\r
-            this.Label52.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label52.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label52.Location = new System.Drawing.Point(103, 86);\r
-            this.Label52.Name = "Label52";\r
-            this.Label52.Size = new System.Drawing.Size(28, 13);\r
-            this.Label52.TabIndex = 5;\r
-            this.Label52.Text = "Top";\r
-            // \r
-            // Label51\r
-            // \r
-            this.Label51.AutoSize = true;\r
-            this.Label51.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label51.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label51.Location = new System.Drawing.Point(190, 125);\r
-            this.Label51.Name = "Label51";\r
-            this.Label51.Size = new System.Drawing.Size(36, 13);\r
-            this.Label51.TabIndex = 8;\r
-            this.Label51.Text = "Right";\r
-            // \r
-            // Label15\r
-            // \r
-            this.Label15.AutoSize = true;\r
-            this.Label15.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label15.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label15.Location = new System.Drawing.Point(13, 125);\r
-            this.Label15.Name = "Label15";\r
-            this.Label15.Size = new System.Drawing.Size(28, 13);\r
-            this.Label15.TabIndex = 3;\r
-            this.Label15.Text = "Left";\r
-            // \r
             // slider_deblock\r
             // \r
             this.slider_deblock.Location = new System.Drawing.Point(118, 162);\r
@@ -1533,48 +1208,6 @@ namespace Handbrake
             this.tab_filters.Text = "Video Filters";\r
             this.tab_filters.UseVisualStyleBackColor = true;\r
             // \r
-            // ctl_deinterlace\r
-            // \r
-            this.ctl_deinterlace.AutoSize = true;\r
-            this.ctl_deinterlace.Location = new System.Drawing.Point(19, 95);\r
-            this.ctl_deinterlace.Margin = new System.Windows.Forms.Padding(0);\r
-            this.ctl_deinterlace.MaximumSize = new System.Drawing.Size(400, 30);\r
-            this.ctl_deinterlace.Name = "ctl_deinterlace";\r
-            this.ctl_deinterlace.Size = new System.Drawing.Size(275, 28);\r
-            this.ctl_deinterlace.TabIndex = 41;\r
-            this.ctl_deinterlace.onChange += new System.EventHandler(this.ctl_deinterlace_changed);\r
-            // \r
-            // ctl_denoise\r
-            // \r
-            this.ctl_denoise.AutoSize = true;\r
-            this.ctl_denoise.Location = new System.Drawing.Point(19, 123);\r
-            this.ctl_denoise.Margin = new System.Windows.Forms.Padding(0);\r
-            this.ctl_denoise.MaximumSize = new System.Drawing.Size(400, 30);\r
-            this.ctl_denoise.Name = "ctl_denoise";\r
-            this.ctl_denoise.Size = new System.Drawing.Size(275, 28);\r
-            this.ctl_denoise.TabIndex = 40;\r
-            // \r
-            // ctl_decomb\r
-            // \r
-            this.ctl_decomb.AutoSize = true;\r
-            this.ctl_decomb.Location = new System.Drawing.Point(19, 66);\r
-            this.ctl_decomb.Margin = new System.Windows.Forms.Padding(0);\r
-            this.ctl_decomb.MaximumSize = new System.Drawing.Size(400, 30);\r
-            this.ctl_decomb.Name = "ctl_decomb";\r
-            this.ctl_decomb.Size = new System.Drawing.Size(275, 28);\r
-            this.ctl_decomb.TabIndex = 39;\r
-            this.ctl_decomb.onChange += new System.EventHandler(this.ctl_decomb_changed);\r
-            // \r
-            // ctl_detelecine\r
-            // \r
-            this.ctl_detelecine.AutoSize = true;\r
-            this.ctl_detelecine.Location = new System.Drawing.Point(19, 38);\r
-            this.ctl_detelecine.Margin = new System.Windows.Forms.Padding(0);\r
-            this.ctl_detelecine.MaximumSize = new System.Drawing.Size(400, 30);\r
-            this.ctl_detelecine.Name = "ctl_detelecine";\r
-            this.ctl_detelecine.Size = new System.Drawing.Size(275, 28);\r
-            this.ctl_detelecine.TabIndex = 38;\r
-            // \r
             // tab_subtitles\r
             // \r
             this.tab_subtitles.Controls.Add(this.drp_subtitle);\r
@@ -1626,14 +1259,6 @@ namespace Handbrake
             this.tab_advanced.Text = "Advanced";\r
             this.tab_advanced.UseVisualStyleBackColor = true;\r
             // \r
-            // x264Panel\r
-            // \r
-            this.x264Panel.Location = new System.Drawing.Point(0, 0);\r
-            this.x264Panel.Name = "x264Panel";\r
-            this.x264Panel.Size = new System.Drawing.Size(720, 306);\r
-            this.x264Panel.TabIndex = 0;\r
-            this.x264Panel.x264Query = "";\r
-            // \r
             // tab_query\r
             // \r
             this.tab_query.Controls.Add(this.btn_clear);\r
@@ -1993,6 +1618,72 @@ namespace Handbrake
             this.hbproc.StartInfo.UserName = "";\r
             this.hbproc.SynchronizingObject = this;\r
             // \r
+            // pictureSettings\r
+            // \r
+            this.pictureSettings.Location = new System.Drawing.Point(-1, 0);\r
+            this.pictureSettings.Name = "pictureSettings";\r
+            this.pictureSettings.selectedTitle = null;\r
+            this.pictureSettings.Size = new System.Drawing.Size(705, 302);\r
+            this.pictureSettings.TabIndex = 0;\r
+            // \r
+            // ctl_deinterlace\r
+            // \r
+            this.ctl_deinterlace.AutoSize = true;\r
+            this.ctl_deinterlace.Location = new System.Drawing.Point(19, 95);\r
+            this.ctl_deinterlace.Margin = new System.Windows.Forms.Padding(0);\r
+            this.ctl_deinterlace.MaximumSize = new System.Drawing.Size(400, 30);\r
+            this.ctl_deinterlace.Name = "ctl_deinterlace";\r
+            this.ctl_deinterlace.Size = new System.Drawing.Size(275, 28);\r
+            this.ctl_deinterlace.TabIndex = 41;\r
+            this.ctl_deinterlace.onChange += new System.EventHandler(this.ctl_deinterlace_changed);\r
+            // \r
+            // ctl_denoise\r
+            // \r
+            this.ctl_denoise.AutoSize = true;\r
+            this.ctl_denoise.Location = new System.Drawing.Point(19, 123);\r
+            this.ctl_denoise.Margin = new System.Windows.Forms.Padding(0);\r
+            this.ctl_denoise.MaximumSize = new System.Drawing.Size(400, 30);\r
+            this.ctl_denoise.Name = "ctl_denoise";\r
+            this.ctl_denoise.Size = new System.Drawing.Size(275, 28);\r
+            this.ctl_denoise.TabIndex = 40;\r
+            // \r
+            // ctl_decomb\r
+            // \r
+            this.ctl_decomb.AutoSize = true;\r
+            this.ctl_decomb.Location = new System.Drawing.Point(19, 66);\r
+            this.ctl_decomb.Margin = new System.Windows.Forms.Padding(0);\r
+            this.ctl_decomb.MaximumSize = new System.Drawing.Size(400, 30);\r
+            this.ctl_decomb.Name = "ctl_decomb";\r
+            this.ctl_decomb.Size = new System.Drawing.Size(275, 28);\r
+            this.ctl_decomb.TabIndex = 39;\r
+            this.ctl_decomb.onChange += new System.EventHandler(this.ctl_decomb_changed);\r
+            // \r
+            // ctl_detelecine\r
+            // \r
+            this.ctl_detelecine.AutoSize = true;\r
+            this.ctl_detelecine.Location = new System.Drawing.Point(19, 38);\r
+            this.ctl_detelecine.Margin = new System.Windows.Forms.Padding(0);\r
+            this.ctl_detelecine.MaximumSize = new System.Drawing.Size(400, 30);\r
+            this.ctl_detelecine.Name = "ctl_detelecine";\r
+            this.ctl_detelecine.Size = new System.Drawing.Size(275, 28);\r
+            this.ctl_detelecine.TabIndex = 38;\r
+            // \r
+            // audioPanel\r
+            // \r
+            this.audioPanel.BackColor = System.Drawing.Color.Transparent;\r
+            this.audioPanel.Location = new System.Drawing.Point(0, 0);\r
+            this.audioPanel.Name = "audioPanel";\r
+            this.audioPanel.Size = new System.Drawing.Size(715, 310);\r
+            this.audioPanel.TabIndex = 0;\r
+            // \r
+            // x264Panel\r
+            // \r
+            this.x264Panel.Location = new System.Drawing.Point(0, 0);\r
+            this.x264Panel.Name = "x264Panel";\r
+            this.x264Panel.Size = new System.Drawing.Size(720, 306);\r
+            this.x264Panel.TabIndex = 0;\r
+            this.x264Panel.x264Query = "";\r
+            // \r
             // frmMain\r
             // \r
             this.AllowDrop = true;\r
@@ -2026,11 +1717,6 @@ namespace Handbrake
             this.tab_video.ResumeLayout(false);\r
             this.tab_video.PerformLayout();\r
             this.tab_picture.ResumeLayout(false);\r
-            this.tab_picture.PerformLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_bottom)).EndInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_top)).EndInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_left)).EndInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.text_right)).EndInit();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_deblock)).EndInit();\r
             this.tabs_panel.ResumeLayout(false);\r
             this.tab_filters.ResumeLayout(false);\r
@@ -2101,11 +1787,6 @@ namespace Handbrake
         internal System.Windows.Forms.TextBox text_bitrate;\r
         internal System.Windows.Forms.TabPage tab_picture;\r
         internal System.Windows.Forms.CheckBox Check_ChapterMarkers;\r
-        internal System.Windows.Forms.Label Label1;\r
-        internal System.Windows.Forms.Label Label53;\r
-        internal System.Windows.Forms.Label Label52;\r
-        internal System.Windows.Forms.Label Label51;\r
-        internal System.Windows.Forms.Label Label15;\r
         internal System.Windows.Forms.TabControl tabs_panel;\r
         internal System.Windows.Forms.Label Label46;\r
         private System.Windows.Forms.GroupBox groupBox_dest;\r
@@ -2123,19 +1804,8 @@ namespace Handbrake
         private System.Windows.Forms.OpenFileDialog File_Open;\r
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;\r
         internal System.Windows.Forms.CheckBox check_iPodAtom;\r
-        internal System.Windows.Forms.Label label26;\r
-        internal System.Windows.Forms.Label Label56;\r
-        internal System.Windows.Forms.Label lbl_Aspect;\r
-        internal System.Windows.Forms.Label Label91;\r
-        internal System.Windows.Forms.TextBox text_height;\r
-        internal System.Windows.Forms.Label Label55;\r
-        internal System.Windows.Forms.TextBox text_width;\r
         private System.Windows.Forms.TabPage tab_chapters;\r
         internal System.Windows.Forms.Label label31;\r
-        internal System.Windows.Forms.NumericUpDown text_right;\r
-        internal System.Windows.Forms.NumericUpDown text_bottom;\r
-        internal System.Windows.Forms.NumericUpDown text_top;\r
-        internal System.Windows.Forms.NumericUpDown text_left;\r
         internal System.Windows.Forms.CheckBox check_optimiseMP4;\r
         internal System.Windows.Forms.CheckBox check_forced;\r
         internal System.Windows.Forms.DataGridView data_chpt;\r
@@ -2154,16 +1824,12 @@ namespace Handbrake
         internal System.Windows.Forms.Button btn_removePreset;\r
         internal System.Windows.Forms.Button btn_addPreset;\r
         internal System.Windows.Forms.Label label25;\r
-        internal System.Windows.Forms.Label label6;\r
-        internal System.Windows.Forms.ComboBox drp_anamorphic;\r
         internal System.Windows.Forms.TabPage tab_advanced;\r
         private System.Windows.Forms.Button btn_destBrowse;\r
         internal System.Windows.Forms.TreeView treeView_presets;\r
         internal System.Windows.Forms.RichTextBox rtf_query;\r
         private System.Windows.Forms.NotifyIcon notifyIcon;\r
         private System.Windows.Forms.ToolStripMenuItem btn_restore;\r
-        internal System.Windows.Forms.Label lbl_src_res;\r
-        internal System.Windows.Forms.Label label7;\r
         internal System.Windows.Forms.Label lbl_duration;\r
         internal System.Windows.Forms.Label label_duration;\r
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;\r
@@ -2180,8 +1846,6 @@ namespace Handbrake
         internal System.Windows.Forms.ToolStripMenuItem mnu_encodeLog;\r
         private System.Windows.Forms.StatusStrip StatusStrip;\r
         private System.Windows.Forms.ToolStripStatusLabel lbl_encode;\r
-        internal System.Windows.Forms.RadioButton check_customCrop;\r
-        internal System.Windows.Forms.RadioButton check_autoCrop;\r
         internal System.Windows.Forms.Label lbl_deblockVal;\r
         internal System.Windows.Forms.TrackBar slider_deblock;\r
         internal System.Windows.Forms.Label label8;\r
@@ -2209,7 +1873,6 @@ namespace Handbrake
         internal System.Windows.Forms.RadioButton radio_targetFilesize;\r
         internal Handbrake.Controls.x264Panel x264Panel;\r
         private System.Windows.Forms.ToolStripButton tb_preview;\r
-        private System.Windows.Forms.Label lbl_max;\r
         private System.Windows.Forms.DataGridViewTextBoxColumn number;\r
         private System.Windows.Forms.DataGridViewTextBoxColumn name;\r
         internal TextBox text_source;\r
@@ -2218,6 +1881,7 @@ namespace Handbrake
         internal Label lbl_angle;\r
         private TabPage tab_subtitles;\r
         internal Handbrake.Controls.AudioPanel audioPanel;\r
+        internal Handbrake.Controls.PictureSettings pictureSettings;\r
 \r
  \r
     }\r
index 15c3e5588519e9169526bbb2b86dd78967d32066..02582923b6acf4e16cbf35fd5a57673b65606b6c 100644 (file)
@@ -77,7 +77,6 @@ namespace Handbrake
             loadPresetPanel();                       // Load the Preset Panel\r
             treeView_presets.ExpandAll();\r
             lbl_encode.Text = "";\r
-            lbl_max.Text = "";\r
             queueWindow = new frmQueue(encodeQueue);        // Prepare the Queue\r
             if (Properties.Settings.Default.QueryEditorTab != "Checked")\r
                 tabs_panel.TabPages.RemoveAt(7); // Remove the query editor tab if the user does not want it enabled.\r
@@ -485,12 +484,7 @@ namespace Handbrake
                         x264Panel.X264_StandardizeOptString();\r
                         x264Panel.X264_SetCurrentSettingsInPanel();\r
 \r
-                        if (maxWidth != 0 && maxHeight != 0)\r
-                            lbl_max.Text = "Max Width / Height";\r
-                        else if (maxWidth != 0)\r
-                            lbl_max.Text = "Max Width";\r
-                        else\r
-                            lbl_max.Text = "";\r
+                        pictureSettings.setMax();\r
                     }\r
                 }\r
             }\r
@@ -810,7 +804,7 @@ namespace Handbrake
         private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
             // Reset some values on the form\r
-            lbl_Aspect.Text = "Select a Title";\r
+            pictureSettings.lbl_Aspect.Text = "Select a Title";\r
             //lbl_RecomendedCrop.Text = "Select a Title";\r
             drop_chapterStart.Items.Clear();\r
             drop_chapterFinish.Items.Clear();\r
@@ -820,17 +814,8 @@ namespace Handbrake
             if (drp_dvdtitle.Text != "Automatic")\r
             {\r
                 selectedTitle = drp_dvdtitle.SelectedItem as Parsing.Title;\r
-\r
-                // Set the Aspect Ratio\r
-                lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();\r
-                lbl_src_res.Text = selectedTitle.Resolution.Width + " x " + selectedTitle.Resolution.Height;\r
                 lbl_duration.Text = selectedTitle.Duration.ToString();\r
-\r
-                // Set the Recommended Cropping values\r
-                text_top.Text = selectedTitle.AutoCropDimensions[0].ToString();\r
-                text_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();\r
-                text_left.Text = selectedTitle.AutoCropDimensions[2].ToString();\r
-                text_right.Text = selectedTitle.AutoCropDimensions[3].ToString();\r
+                pictureSettings.setComponentsAfterScan(selectedTitle);  // Setup Picture Settings Tab Control\r
 \r
                 // Populate the Angles dropdown\r
                 drop_angle.Items.Clear();\r
@@ -1249,104 +1234,6 @@ namespace Handbrake
             }\r
         }\r
 \r
-        //Picture Tab\r
-        private void text_width_TextChanged(object sender, EventArgs e)\r
-        {\r
-            if (text_width.Text == "")\r
-                text_width.BackColor = Color.White;\r
-\r
-            maxWidth = 0; maxHeight = 0;  // Reset max width so that it's not using the MaxWidth -X. Quick hack to allow -X for preset usage.\r
-            lbl_max.Text = "";\r
-\r
-            int width;\r
-            Boolean parsed = int.TryParse(text_width.Text, out width);\r
-            if (parsed)\r
-            {\r
-                text_width.BackColor = (width % 16) != 0 ? Color.LightCoral : Color.LightGreen;\r
-\r
-                if (lbl_Aspect.Text != "Select a Title" && maxWidth == 0 && maxHeight == 0)\r
-                {\r
-                    if (drp_anamorphic.Text == "None")\r
-                    {\r
-                        int height = Main.cacluateNonAnamorphicHeight(width, text_top.Value, text_bottom.Value, text_left.Value, text_right.Value, selectedTitle);\r
-                        if (height != 0)\r
-                            text_height.Text = height.ToString();\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        private void text_height_TextChanged(object sender, EventArgs e)\r
-        {\r
-            if (text_height.Text == "")\r
-                text_height.BackColor = Color.White;\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
-            lbl_max.Text = maxWidth != 0 ? "Max Width" : "";\r
-\r
-            int height;\r
-            Boolean parsed = int.TryParse(text_height.Text, out height);\r
-            if (parsed)\r
-                text_height.BackColor = (height % 16) != 0 ? Color.LightCoral : Color.LightGreen;\r
-        }\r
-        private void check_customCrop_CheckedChanged(object sender, EventArgs e)\r
-        {\r
-            text_left.Enabled = true;\r
-            text_right.Enabled = true;\r
-            text_top.Enabled = true;\r
-            text_bottom.Enabled = true;\r
-            if (selectedTitle != null)\r
-            {\r
-                text_top.Text = selectedTitle.AutoCropDimensions[0].ToString();\r
-                text_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();\r
-                text_left.Text = selectedTitle.AutoCropDimensions[2].ToString();\r
-                text_right.Text = selectedTitle.AutoCropDimensions[3].ToString();\r
-            }\r
-            else\r
-            {\r
-                text_left.Text = "0";\r
-                text_right.Text = "0";\r
-                text_top.Text = "0";\r
-                text_bottom.Text = "0";\r
-            }\r
-        }\r
-        private void check_autoCrop_CheckedChanged(object sender, EventArgs e)\r
-        {\r
-            text_left.Enabled = false;\r
-            text_right.Enabled = false;\r
-            text_top.Enabled = false;\r
-            text_bottom.Enabled = false;\r
-        }\r
-        private void drp_anamorphic_SelectedIndexChanged(object sender, EventArgs e)\r
-        {\r
-            if (drp_anamorphic.SelectedIndex == 1)\r
-            {\r
-                text_height.BackColor = Color.LightGray;\r
-                text_width.BackColor = Color.LightGray;\r
-                text_height.Text = "";\r
-                text_width.Text = "";\r
-                text_height.Enabled = false;\r
-                text_width.Enabled = false;\r
-            }\r
-\r
-            if (drp_anamorphic.SelectedIndex == 2)\r
-            {\r
-                text_height.Text = "";\r
-                text_height.Enabled = false;\r
-                text_height.BackColor = Color.LightGray;\r
-\r
-                text_width.Enabled = true;\r
-                text_width.BackColor = Color.White;\r
-            }\r
-\r
-            if (drp_anamorphic.SelectedIndex == 0)\r
-            {\r
-                text_height.BackColor = Color.White;\r
-                text_width.BackColor = Color.White;\r
-                text_height.Enabled = true;\r
-                text_width.Enabled = true;\r
-            }\r
-        }\r
-\r
         // Filter Tab\r
         private void ctl_decomb_changed(object sender, EventArgs e)\r
         {\r
@@ -1600,8 +1487,8 @@ namespace Handbrake
             drop_chapterFinish.Items.Clear();\r
             drop_chapterFinish.Text = "Auto";\r
             lbl_duration.Text = "Select a Title";\r
-            lbl_src_res.Text = "Select a Title";\r
-            lbl_Aspect.Text = "Select a Title";\r
+            pictureSettings.lbl_src_res.Text = "Select a Title";\r
+            pictureSettings.lbl_Aspect.Text = "Select a Title";\r
             text_source.Text = "Click 'Source' to continue";\r
             text_destination.Text = "";\r
             thisDVD = null;\r