summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-06-07 23:04:05 +0000
committersr55 <[email protected]>2009-06-07 23:04:05 +0000
commit2b3ac1f2ae64e8591ffa6f3485bd131b8ff7d9ef (patch)
tree4594d79c72ac0e4f48fa69b8b260ac9128eabb16 /win/C#/Functions
parenta4bc7d65af62d27c3b8d9a2f3c50f5938a46d9da (diff)
WinGui:
- 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
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/PresetLoader.cs32
-rw-r--r--win/C#/Functions/QueryGenerator.cs63
-rw-r--r--win/C#/Functions/QueryParser.cs1
3 files changed, 53 insertions, 43 deletions
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs
index 9ad6375fc..2434ad42a 100644
--- a/win/C#/Functions/PresetLoader.cs
+++ b/win/C#/Functions/PresetLoader.cs
@@ -67,13 +67,13 @@ namespace Handbrake.Functions
#endregion
#region Picture
- mainWindow.check_autoCrop.Checked = true;
+ mainWindow.pictureSettings.check_autoCrop.Checked = true;
if (presetQuery.CropBottom == "0" && presetQuery.CropTop == "0")
if (presetQuery.CropLeft == "0" && presetQuery.CropRight == "0")
- mainWindow.check_customCrop.Checked = true;
+ mainWindow.pictureSettings.check_customCrop.Checked = true;
- mainWindow.text_width.Text = "";
- mainWindow.text_height.Text = "";
+ mainWindow.pictureSettings.text_width.Text = "";
+ mainWindow.pictureSettings.text_height.Text = "";
if (pictureSettings)
{
@@ -85,41 +85,41 @@ namespace Handbrake.Functions
int.TryParse(presetQuery.CropLeft, out left);
int.TryParse(presetQuery.CropRight, out right);
- mainWindow.check_customCrop.Checked = true;
- mainWindow.text_top.Value = top;
- mainWindow.text_bottom.Value = bottom;
- mainWindow.text_left.Value = left;
- mainWindow.text_right.Value = right;
+ mainWindow.pictureSettings.check_customCrop.Checked = true;
+ mainWindow.pictureSettings.crop_top.Value = top;
+ mainWindow.pictureSettings.crop_bottom.Value = bottom;
+ mainWindow.pictureSettings.crop_left.Value = left;
+ mainWindow.pictureSettings.crop_right.Value = right;
}
if (presetQuery.Width != 0)
- mainWindow.text_width.Text = presetQuery.Width.ToString();
+ mainWindow.pictureSettings.text_width.Text = presetQuery.Width.ToString();
if (presetQuery.Height != 0)
- mainWindow.text_height.Text = presetQuery.Height.ToString();
+ mainWindow.pictureSettings.text_height.Text = presetQuery.Height.ToString();
}
- mainWindow.drp_anamorphic.SelectedIndex = presetQuery.Anamorphic ? 1 : 0;
+ mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = presetQuery.Anamorphic ? 1 : 0;
if (presetQuery.LooseAnamorphic)
- mainWindow.drp_anamorphic.SelectedIndex = 2;
+ mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = 2;
else
{
if (presetQuery.Anamorphic != true)
- mainWindow.drp_anamorphic.SelectedIndex = 0;
+ mainWindow.pictureSettings.drp_anamorphic.SelectedIndex = 0;
}
// Set the public max width and max height varibles in frmMain
// These are used by the query generator to determine if it should use -X or -w / -Y or -h
if (presetQuery.MaxWidth != 0)
{
- mainWindow.text_width.Text = presetQuery.MaxWidth.ToString();
+ mainWindow.pictureSettings.text_width.Text = presetQuery.MaxWidth.ToString();
mainWindow.maxWidth = presetQuery.MaxWidth;
}
if (presetQuery.MaxHeight != 0)
{
- mainWindow.text_height.Text = presetQuery.MaxHeight.ToString();
+ mainWindow.pictureSettings.text_height.Text = presetQuery.MaxHeight.ToString();
mainWindow.maxHeight = presetQuery.MaxHeight;
}
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index bab608c57..a60ad3112 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -121,55 +121,63 @@ namespace Handbrake.Functions
if (mainWindow.maxWidth == 0)
{
- if (mainWindow.text_width.Text != "")
- query += " -w " + mainWindow.text_width.Text;
+ if (mainWindow.pictureSettings.text_width.Text != "")
+ query += " -w " + mainWindow.pictureSettings.text_width.Text;
}
else
{
- if (mainWindow.text_width.Text != "")
- query += " -X " + mainWindow.text_width.Text;
+ if (mainWindow.pictureSettings.text_width.Text != "")
+ query += " -X " + mainWindow.pictureSettings.text_width.Text;
}
// Use MaxHeight for built-in presets and height for user settings.
if (mainWindow.maxHeight == 0)
{
- if (mainWindow.text_height.Text != "")
- query += " -l " + mainWindow.text_height.Text;
+ if (mainWindow.pictureSettings.text_height.Text != "")
+ query += " -l " + mainWindow.pictureSettings.text_height.Text;
}
else
{
- if (mainWindow.text_height.Text != "")
- query += " -Y " + mainWindow.text_height.Text;
+ if (mainWindow.pictureSettings.text_height.Text != "")
+ query += " -Y " + mainWindow.pictureSettings.text_height.Text;
}
- string cropTop = mainWindow.text_top.Text;
- string cropBottom = mainWindow.text_bottom.Text;
- string cropLeft = mainWindow.text_left.Text;
- string cropRight = mainWindow.text_right.Text;
+ string cropTop = mainWindow.pictureSettings.crop_top.Text;
+ string cropBottom = mainWindow.pictureSettings.crop_bottom.Text;
+ string cropLeft = mainWindow.pictureSettings.crop_left.Text;
+ string cropRight = mainWindow.pictureSettings.crop_right.Text;
- if (mainWindow.check_customCrop.Checked)
+ if (mainWindow.pictureSettings.check_customCrop.Checked)
{
- if (mainWindow.text_top.Text == string.Empty)
+ if (mainWindow.pictureSettings.crop_top.Text == string.Empty)
cropTop = "0";
- if (mainWindow.text_bottom.Text == string.Empty)
+ if (mainWindow.pictureSettings.crop_bottom.Text == string.Empty)
cropBottom = "0";
- if (mainWindow.text_left.Text == string.Empty)
+ if (mainWindow.pictureSettings.crop_left.Text == string.Empty)
cropLeft = "0";
- if (mainWindow.text_right.Text == string.Empty)
+ if (mainWindow.pictureSettings.crop_right.Text == string.Empty)
cropRight = "0";
query += " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;
}
- if (mainWindow.drp_anamorphic.SelectedIndex == 1)
- query += " -p ";
- else if (mainWindow.drp_anamorphic.SelectedIndex == 2)
- query += " -P ";
-
- if (mainWindow.slider_deblock.Value != 4)
- query += " --deblock=" + mainWindow.slider_deblock.Value;
-
-
+ switch (mainWindow.pictureSettings.drp_anamorphic.SelectedIndex)
+ {
+ case 1:
+ query += " --strict-anamorphic ";
+ break;
+ case 2:
+ query += " --loose-anamorphic ";
+ break;
+ case 3:
+ query += " --custom-anamorphic ";
+ query += " --display-width " + mainWindow.pictureSettings.txt_displayWidth.Text + " ";
+ if (mainWindow.pictureSettings.check_KeepAR.Checked)
+ query += " --keep-display-aspect ";
+ if (mainWindow.pictureSettings.txt_parWidth.Text != "" && mainWindow.pictureSettings.txt_parHeight.Text != "")
+ query += " --pixel-aspect " + mainWindow.pictureSettings.txt_parWidth.Text + ":" + mainWindow.pictureSettings.txt_parHeight.Text + " ";
+ break;
+ }
#endregion
#region Filters
@@ -177,6 +185,9 @@ namespace Handbrake.Functions
query += mainWindow.ctl_decomb.getCLIQuery;
query += mainWindow.ctl_deinterlace.getCLIQuery;
query += mainWindow.ctl_denoise.getCLIQuery;
+
+ if (mainWindow.slider_deblock.Value != 4)
+ query += " --deblock=" + mainWindow.slider_deblock.Value;
#endregion
#region Video Settings Tab
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index bbdb77b7e..ff621c625 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -299,7 +299,6 @@ namespace Handbrake.Functions
if (videoQuality.Success)
{
float qConvert = float.Parse(videoQuality.ToString().Replace("-q ", ""), Culture);
- //qConvert = Math.Ceiling(qConvert);
thisQuery.VideoQuality = qConvert;
}
#endregion