summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-07-04 19:34:25 +0000
committersr55 <[email protected]>2009-07-04 19:34:25 +0000
commit39236e31497de99fe8e29458bab51d7a9d28a27d (patch)
tree208d81d44cfb8be24d1992903a840bcfd575672e /win/C#/Controls
parent499dbe37cfa932362827622bb04132ecd2371f96 (diff)
WinGui:
- Some fixes to the Picture settings panel and preset loader. - Small UI tweak to options. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2664 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r--win/C#/Controls/PictureSettings.cs61
-rw-r--r--win/C#/Controls/PictureSettings.resx22
2 files changed, 46 insertions, 37 deletions
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs
index e490c2e63..bd367d464 100644
--- a/win/C#/Controls/PictureSettings.cs
+++ b/win/C#/Controls/PictureSettings.cs
@@ -8,7 +8,7 @@ namespace Handbrake.Controls
// TODO
// - Tie in the cropping controls.
// - Cleanup this code. It's a bit messy.
-
+
public partial class PictureSettings : UserControl
{
private static readonly CultureInfo Culture = new CultureInfo("en-US", false);
@@ -56,7 +56,7 @@ namespace Handbrake.Controls
else if (drp_anamorphic.SelectedIndex == 1 || drp_anamorphic.SelectedIndex == 3)
{
heightModJumpGaurd = true;
- text_height.Value = selectedTitle.Resolution.Height - (int) crop_top.Value - (int) crop_bottom.Value;
+ text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
}
else if (drp_anamorphic.SelectedIndex == 2)
{
@@ -86,9 +86,10 @@ namespace Handbrake.Controls
// Basic Picture Setting Controls
private void text_width_ValueChanged(object sender, EventArgs e)
{
+
maxWidth = 0;
setMax();
-
+
// Get the Modulus
int mod;
int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
@@ -115,7 +116,8 @@ namespace Handbrake.Controls
}
// A Picture Setting has changed so raise a PictureSettingsChanged event.
if (this.PictureSettingsChanged != null)
- this.PictureSettingsChanged(this, new EventArgs());
+ this.PictureSettingsChanged(this, new EventArgs());
+
}
private void text_height_ValueChanged(object sender, EventArgs e)
{
@@ -166,7 +168,7 @@ namespace Handbrake.Controls
// A Picture Setting has changed so raise a PictureSettingsChanged event.
if (this.PictureSettingsChanged != null)
- this.PictureSettingsChanged(this, new EventArgs());
+ this.PictureSettingsChanged(this, new EventArgs());
}
private void check_KeepAR_CheckedChanged(object sender, EventArgs e)
{
@@ -196,12 +198,13 @@ namespace Handbrake.Controls
check_KeepAR.CheckState = CheckState.Checked;
check_KeepAR.Enabled = true;
disableCustomAnaControls();
+ check_KeepAR.Enabled = true;
if (selectedTitle != null)
{
- text_width.Value = selectedTitle.Resolution.Width;
- text_height.Value = selectedTitle.Resolution.Height;
+ text_width.Value = maxWidth != 0 ? maxWidth : selectedTitle.Resolution.Width;
+ text_height.Value = maxHeight != 0 ? maxHeight : selectedTitle.Resolution.Height;
+ setMax();
}
- check_KeepAR.Enabled = true;
lbl_anamorphic.Text = "";
lbl_anamprohicLbl.Visible = false;
break;
@@ -209,8 +212,10 @@ namespace Handbrake.Controls
if (selectedTitle != null)
{
heightModJumpGaurd = true;
- text_width.Value = selectedTitle.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
- text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
+ text_width.Value = selectedTitle.Resolution.Width - (int)crop_left.Value -
+ (int)crop_right.Value;
+ text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value -
+ (int)crop_bottom.Value;
}
text_height.Enabled = false;
text_width.Enabled = false;
@@ -229,7 +234,8 @@ namespace Handbrake.Controls
{
heightModJumpGaurd = true;
text_width.Value = selectedTitle.Resolution.Width;
- text_height.Value = selectedTitle.Resolution.Height - (int) crop_top.Value - (int) crop_bottom.Value;
+ text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value -
+ (int)crop_bottom.Value;
}
lbl_anamorphic.Text = looseAnamorphic();
lbl_anamprohicLbl.Visible = true;
@@ -246,13 +252,15 @@ namespace Handbrake.Controls
{
heightModJumpGaurd = true;
widthVal = selectedTitle.Resolution.Width;
- text_width.Value = selectedTitle.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
- text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
+ text_width.Value = selectedTitle.Resolution.Width - (int)crop_left.Value -
+ (int)crop_right.Value;
+ text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value -
+ (int)crop_bottom.Value;
txt_parWidth.Text = selectedTitle.ParVal.Width.ToString();
txt_parHeight.Text = selectedTitle.ParVal.Height.ToString();
txt_displayWidth.Text = displayWidth().ToString(Culture);
}
-
+
darValue = calculateDar();
check_KeepAR.CheckState = CheckState.Checked;
@@ -264,7 +272,8 @@ namespace Handbrake.Controls
// A Picture Setting has changed so raise a PictureSettingsChanged event.
if (this.PictureSettingsChanged != null)
- this.PictureSettingsChanged(this, new EventArgs());
+ this.PictureSettingsChanged(this, new EventArgs());
+
}
// Custom Anamorphic Controls
@@ -283,7 +292,7 @@ namespace Handbrake.Controls
if (e.KeyCode == Keys.Enter)
customAnamorphic(txt_parWidth);
}
-
+
// Cropping Controls
private void check_autoCrop_CheckedChanged(object sender, EventArgs e)
{
@@ -418,7 +427,7 @@ namespace Handbrake.Controls
txt_displayWidth.Text = getDisplayWidthKeepDar().ToString(Culture); //Changes DISPLAY WIDTH to keep DAR
txt_parWidth.Text = txt_displayWidth.Text;
txt_parHeight.Text = cropped_width.ToString();
- break;
+ break;
case "text_width":
txt_parWidth.Text = txt_displayWidth.Text;
txt_parHeight.Text = cropped_width.ToString();
@@ -626,13 +635,13 @@ namespace Handbrake.Controls
{
// Crop_Width = Title->Width - crop_Left - crop_right
// Crop_Height = Title->Height - crop_top - crop_bottom
- double crop_width = selectedTitle.Resolution.Width - (double) crop_left.Value -
- (double) crop_right.Value;
- double crop_height = selectedTitle.Resolution.Height - (double) crop_top.Value -
- (double) crop_bottom.Value;
+ double crop_width = selectedTitle.Resolution.Width - (double)crop_left.Value -
+ (double)crop_right.Value;
+ double crop_height = selectedTitle.Resolution.Height - (double)crop_top.Value -
+ (double)crop_bottom.Value;
- double new_height = (width*selectedTitle.Resolution.Width*ah*crop_height)/
- (selectedTitle.Resolution.Height*aw*crop_width);
+ double new_height = (width * selectedTitle.Resolution.Width * ah * crop_height) /
+ (selectedTitle.Resolution.Height * aw * crop_width);
new_height = drp_anamorphic.SelectedIndex == 3 ? getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_height) : getModulusAuto(16, new_height);
@@ -712,7 +721,7 @@ namespace Handbrake.Controls
// Calculate storage Aspect and cache it for reuse
if (storageAspect == 0)
- storageAspect = (double)actualWidth / source_cropped_height;
+ storageAspect = (double)actualWidth / source_cropped_height;
// Calculate the new height based on the input cropped width
double hcalc = (actualWidth / storageAspect) + 0.5;
@@ -729,12 +738,12 @@ namespace Handbrake.Controls
double displayWidth = (actualWidth * parW / parH);
// Now correct DisplayWidth to maintain Aspect ratio. ActualHeight was mod16'd and thus AR is slightly different than the worked out displayWidths
- return Math.Truncate(displayWidth) + "x" + newHeight;
+ return Math.Truncate(displayWidth) + "x" + newHeight;
}
return "Select a Title";
}
-
+
// GUI
private void disableCustomAnaControls()
{
diff --git a/win/C#/Controls/PictureSettings.resx b/win/C#/Controls/PictureSettings.resx
index 406977e64..f9ff3dffe 100644
--- a/win/C#/Controls/PictureSettings.resx
+++ b/win/C#/Controls/PictureSettings.resx
@@ -725,7 +725,7 @@
<value>True</value>
</data>
<data name="check_customCrop.Location" type="System.Drawing.Point, System.Drawing">
- <value>387, 57</value>
+ <value>399, 57</value>
</data>
<data name="check_customCrop.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 17</value>
@@ -752,7 +752,7 @@
<value>True</value>
</data>
<data name="check_autoCrop.Location" type="System.Drawing.Point, System.Drawing">
- <value>387, 33</value>
+ <value>399, 33</value>
</data>
<data name="check_autoCrop.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 17</value>
@@ -779,7 +779,7 @@
<value>False</value>
</data>
<data name="crop_bottom.Location" type="System.Drawing.Point, System.Drawing">
- <value>467, 146</value>
+ <value>479, 146</value>
</data>
<data name="crop_bottom.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
@@ -803,7 +803,7 @@
<value>False</value>
</data>
<data name="crop_top.Location" type="System.Drawing.Point, System.Drawing">
- <value>467, 100</value>
+ <value>479, 100</value>
</data>
<data name="crop_top.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
@@ -827,7 +827,7 @@
<value>False</value>
</data>
<data name="crop_left.Location" type="System.Drawing.Point, System.Drawing">
- <value>416, 122</value>
+ <value>428, 122</value>
</data>
<data name="crop_left.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
@@ -851,7 +851,7 @@
<value>False</value>
</data>
<data name="crop_right.Location" type="System.Drawing.Point, System.Drawing">
- <value>518, 122</value>
+ <value>530, 122</value>
</data>
<data name="crop_right.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
@@ -878,7 +878,7 @@
<value>Verdana, 8.25pt, style=Bold</value>
</data>
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
- <value>384, 13</value>
+ <value>396, 13</value>
</data>
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 13</value>
@@ -908,7 +908,7 @@
<value>Verdana, 8.25pt</value>
</data>
<data name="Label53.Location" type="System.Drawing.Point, System.Drawing">
- <value>465, 170</value>
+ <value>477, 170</value>
</data>
<data name="Label53.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 13</value>
@@ -938,7 +938,7 @@
<value>Verdana, 8.25pt</value>
</data>
<data name="Label52.Location" type="System.Drawing.Point, System.Drawing">
- <value>474, 85</value>
+ <value>486, 85</value>
</data>
<data name="Label52.Size" type="System.Drawing.Size, System.Drawing">
<value>28, 13</value>
@@ -968,7 +968,7 @@
<value>Verdana, 8.25pt</value>
</data>
<data name="Label51.Location" type="System.Drawing.Point, System.Drawing">
- <value>561, 124</value>
+ <value>573, 124</value>
</data>
<data name="Label51.Size" type="System.Drawing.Size, System.Drawing">
<value>36, 13</value>
@@ -998,7 +998,7 @@
<value>Verdana, 8.25pt</value>
</data>
<data name="Label15.Location" type="System.Drawing.Point, System.Drawing">
- <value>384, 124</value>
+ <value>396, 124</value>
</data>
<data name="Label15.Size" type="System.Drawing.Size, System.Drawing">
<value>28, 13</value>