\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
+ // TODO\r
+\r
+ // - Fix MAX Width / Height Code.\r
+ // - Tie in the cropping controls.\r
+ \r
+ /* Custom Anamorphic Mode \r
+ * \r
* DISPLAY WIDTH STORAGE WIDTH PIXEL WIDTH\r
* HEIGHT KEEP ASPECT PIXEL HEIGHT\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 == 0)\r
+ text_height.Value = cacluateHeight(selectedTitle.Resolution.Width);\r
+ else if (drp_anamorphic.SelectedIndex == 1 || drp_anamorphic.SelectedIndex == 3)\r
+ {\r
+ heightModJumpGaurd = true;\r
+ text_height.Value = selectedTitle.Resolution.Height - (int) crop_top.Value - (int) crop_bottom.Value;\r
+ }\r
+ else if (drp_anamorphic.SelectedIndex == 2)\r
+ {\r
+ heightModJumpGaurd = false;\r
+ text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;\r
+ }\r
+\r
+\r
\r
if (drp_anamorphic.SelectedIndex == 3)\r
{\r
case "txt_displayWidth":\r
heightChangeGuard = true;\r
text_height.Value = (decimal)getHeightKeepDar(); //Changes HEIGHT to keep DAR\r
+ //darValue = calculateDar(); // Cache the dar value\r
txt_parWidth.Text = txt_displayWidth.Text;\r
txt_parHeight.Text = cropped_width.ToString();\r
break;\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
+ break; \r
case "text_width":\r
txt_parWidth.Text = txt_displayWidth.Text;\r
txt_parHeight.Text = cropped_width.ToString();\r
}\r
}\r
\r
- darValue = calculateDar(); // Cache the dar value\r
- return newDwValue;\r
+ return Math.Round(newDwValue, 2);\r
}\r
private double getHeightKeepDar()\r
{\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
+ double calculatedDar = displayWidth / (int)text_height.Value;\r
\r
return calculatedDar;\r
}\r
- private double calculateDarByVal(decimal height, double displayWidth)\r
+ private double calculateDarByVal(decimal croppedHeight, 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
+ calculatedDar = displayWidth / (double)croppedHeight;\r
\r
return calculatedDar;\r
}\r
this.components = new System.ComponentModel.Container();\r
System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
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
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.pictureSettings = new Handbrake.Controls.PictureSettings();\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
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
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
// \r
// number\r
// \r
- dataGridViewCellStyle1.Format = "N0";\r
- dataGridViewCellStyle1.NullValue = null;\r
- this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
+ dataGridViewCellStyle2.Format = "N0";\r
+ dataGridViewCellStyle2.NullValue = null;\r
+ this.number.DefaultCellStyle = dataGridViewCellStyle2;\r
this.number.Frozen = true;\r
this.number.HeaderText = "Chapter Number";\r
this.number.MaxInputLength = 3;\r
this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";\r
this.debugToolStripMenuItem.Size = new System.Drawing.Size(56, 20);\r
this.debugToolStripMenuItem.Text = "Debug";\r
+ this.debugToolStripMenuItem.Visible = false;\r
// \r
// mnu_qptest\r
// \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
// AudioMenuRowHeightHack\r
// \r
this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;\r
this.tab_picture.Text = "Picture Settings";\r
this.tab_picture.UseVisualStyleBackColor = true;\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
// slider_deblock\r
// \r
this.slider_deblock.Location = new System.Drawing.Point(118, 162);\r
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
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
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