diff options
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/PresetLoader.cs | 32 | ||||
-rw-r--r-- | win/C#/Functions/QueryGenerator.cs | 63 | ||||
-rw-r--r-- | win/C#/Functions/QueryParser.cs | 1 |
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
|