summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-07-24 22:34:16 +0000
committersr55 <[email protected]>2009-07-24 22:34:16 +0000
commitaea56fe347510698cd90e9def4393a1d9d283329 (patch)
treeb5813fa68c5de96a89638de9c812800b6ab0c998 /win/C#/Controls
parent0e2b1478f2b2b336a68887382fcffbc78cc79612 (diff)
WinGui:
- PictureSettings: Custom Anamorphic partially re-implemented. "NOT KEEPING DISPLAY ASPECT" Done. "KEEPING DISPLAY ASPECT RATIO" Still to do. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2731 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r--win/C#/Controls/PictureSettings.Designer.cs3
-rw-r--r--win/C#/Controls/PictureSettings.cs53
2 files changed, 53 insertions, 3 deletions
diff --git a/win/C#/Controls/PictureSettings.Designer.cs b/win/C#/Controls/PictureSettings.Designer.cs
index 51dd32c32..f39e1e3d8 100644
--- a/win/C#/Controls/PictureSettings.Designer.cs
+++ b/win/C#/Controls/PictureSettings.Designer.cs
@@ -471,6 +471,7 @@ namespace Handbrake.Controls
this.updownParHeight.Name = "updownParHeight";
this.updownParHeight.Size = new System.Drawing.Size(53, 21);
this.updownParHeight.TabIndex = 112;
+ this.updownParHeight.ValueChanged += new System.EventHandler(this.text_width_ValueChanged);
//
// label6
//
@@ -534,6 +535,7 @@ namespace Handbrake.Controls
this.updownParWidth.Name = "updownParWidth";
this.updownParWidth.Size = new System.Drawing.Size(53, 21);
this.updownParWidth.TabIndex = 111;
+ this.updownParWidth.ValueChanged += new System.EventHandler(this.text_width_ValueChanged);
//
// drp_anamorphic
//
@@ -574,6 +576,7 @@ namespace Handbrake.Controls
this.updownDisplayWidth.Name = "updownDisplayWidth";
this.updownDisplayWidth.Size = new System.Drawing.Size(53, 21);
this.updownDisplayWidth.TabIndex = 110;
+ this.updownDisplayWidth.ValueChanged += new System.EventHandler(this.updownDisplayWidth_ValueChanged);
//
// lbl_modulus
//
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs
index ed9b4474e..7f9687883 100644
--- a/win/C#/Controls/PictureSettings.cs
+++ b/win/C#/Controls/PictureSettings.cs
@@ -7,12 +7,33 @@ using Handbrake.Parsing;
namespace Handbrake.Controls
{
+
+ // TODO Custom Anamorphic
+ /* NOT KEEPING DISPLAY ASPECT == [Complete]
+
+ KEEPING DISPLAY ASPECT RATIO == [TODO]
+ DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
+ Disable editing: PIXEL WIDTH, PIXEL HEIGHT
+ Changing DISPLAY WIDTH:
+ Changes HEIGHT to keep DAR
+ Changes PIXEL WIDTH to new DISPLAY WIDTH
+ Changes PIXEL HEIGHT to STORAGE WIDTH
+ Changing HEIGHT
+ Changes DISPLAY WIDTH to keep DAR
+ Changes PIXEL WIDTH to new DISPLAY WIDTH
+ Changes PIXEL HEIGHT to STORAGE WIDTH
+ Changing STORAGE_WIDTH:
+ Changes PIXEL WIDTH to DISPLAY WIDTH
+ Changes PIXEL HEIGHT to new STORAGE WIDTH
+ * */
+
+
public partial class PictureSettings : UserControl
{
private readonly CultureInfo Culture = new CultureInfo("en-US", false);
public event EventHandler PictureSettingsChanged;
- private Boolean preventChangingWidth, preventChangingHeight;
+ private Boolean preventChangingWidth, preventChangingHeight, preventChangingCustom, preventChangingDisplayWidth;
private int _PresetMaximumWidth, _PresetMaximumHeight;
private Title _SourceTitle;
@@ -52,7 +73,7 @@ namespace Handbrake.Controls
{
if (text_width.Value == 0) // Only update the values if the fields don't already have values.
text_width.Value = _SourceTitle.Resolution.Width;
-
+
check_KeepAR.Checked = true; // Forces Resolution to be correct.
}
else
@@ -62,9 +83,9 @@ namespace Handbrake.Controls
labelDisplaySize.Text = calculateAnamorphicSizes().Width + "x" + calculateAnamorphicSizes().Height;
}
+ updownDisplayWidth.Value = calculateAnamorphicSizes().Width;
updownParWidth.Value = _SourceTitle.ParVal.Width;
updownParHeight.Value = _SourceTitle.ParVal.Height;
- updownDisplayWidth.Value = calculateAnamorphicSizes().Width;
}
}
@@ -122,6 +143,19 @@ namespace Handbrake.Controls
preventChangingHeight = false;
}
break;
+ case 3:
+ if (check_KeepAR.CheckState == CheckState.Unchecked && Source != null)
+ {
+ if (preventChangingCustom)
+ break;
+
+ preventChangingDisplayWidth = true;
+ updownDisplayWidth.Value = text_width.Value * updownParWidth.Value / updownParHeight.Value;
+ preventChangingDisplayWidth = false;
+
+ labelDisplaySize.Text = Math.Truncate(updownDisplayWidth.Value) + "x" + text_height.Value;
+ }
+ break;
default:
labelDisplaySize.Text = calculateAnamorphicSizes().Width + "x" + calculateAnamorphicSizes().Height;
break;
@@ -156,6 +190,9 @@ namespace Handbrake.Controls
preventChangingWidth = false;
}
break;
+ case 3:
+ labelDisplaySize.Text = Math.Truncate(updownDisplayWidth.Value) + "x" + text_height.Value;
+ break;
default:
labelDisplaySize.Text = calculateAnamorphicSizes().Width + "x" + calculateAnamorphicSizes().Height;
break;
@@ -180,6 +217,16 @@ namespace Handbrake.Controls
if (PictureSettingsChanged != null)
PictureSettingsChanged(this, new EventArgs());
}
+ private void updownDisplayWidth_ValueChanged(object sender, EventArgs e)
+ {
+ if (preventChangingDisplayWidth == false)
+ {
+ preventChangingCustom = true;
+ updownParWidth.Value = updownDisplayWidth.Value;
+ updownParHeight.Value = text_width.Value;
+ preventChangingCustom = false;
+ }
+ }
// Anamorphic Controls
private void drp_anamorphic_SelectedIndexChanged(object sender, EventArgs e)