summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-01-09 21:41:37 +0000
committersr55 <[email protected]>2010-01-09 21:41:37 +0000
commit0c14d42b05c248158a5ee2932f2389d474927b82 (patch)
treee4c6e69c8178b2719da42464b54ccdee04f0753e
parent61754097d357885dcd728c088ef7ebb17f1ead72 (diff)
WinGui:
- Fixed the preset loader. It would not set the quality slider if RF51 was used. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3059 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/Functions/PresetLoader.cs67
1 files changed, 33 insertions, 34 deletions
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs
index 3018b915d..645a2ba81 100644
--- a/win/C#/Functions/PresetLoader.cs
+++ b/win/C#/Functions/PresetLoader.cs
@@ -50,12 +50,12 @@ namespace Handbrake.Functions
{
if (mainWindow.drop_format.SelectedIndex == 0)
mainWindow.SetExtension(".mp4");
- else
+ else
mainWindow.drop_format.SelectedIndex = 0;
}
else if (presetQuery.Format == "mkv")
{
- if(mainWindow.drop_format.SelectedIndex == 1)
+ if (mainWindow.drop_format.SelectedIndex == 1)
mainWindow.SetExtension(".mkv");
else
mainWindow.drop_format.SelectedIndex = 1;
@@ -91,13 +91,13 @@ namespace Handbrake.Functions
mainWindow.PictureSettings.crop_right.Value = right;
}
}
-
+
// Set the anamorphic mode 0,1,2,3
mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;
// Aspect Ratio
mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked;
-
+
// Set the Width and height as Required.
if (presetQuery.Width != 0)
mainWindow.PictureSettings.text_width.Value = presetQuery.Width;
@@ -154,40 +154,39 @@ namespace Handbrake.Functions
}
// Quality
- if (presetQuery.VideoQuality != 0)
+
+ mainWindow.radio_cq.Checked = true;
+ if (presetQuery.VideoEncoder == "H.264 (x264)")
{
- mainWindow.radio_cq.Checked = true;
- if (presetQuery.VideoEncoder == "H.264 (x264)")
- {
- double cqStep = Properties.Settings.Default.x264cqstep;
- int value;
- double x264step = cqStep;
- double presetValue = presetQuery.VideoQuality;
-
- double x = 51 / x264step;
-
- double calculated = presetValue / x264step;
- calculated = x - calculated;
-
- int.TryParse(calculated.ToString(), out value);
-
- // This will sometimes occur when the preset was generated
- // with a different granularity, so, round and try again.
- if (value == 0)
- {
- double val = Math.Round(calculated, 0);
- int.TryParse(val.ToString(), out value);
- }
- if (value < mainWindow.slider_videoQuality.Maximum)
- mainWindow.slider_videoQuality.Value = value;
- }
- else
+ double cqStep = Properties.Settings.Default.x264cqstep;
+ int value;
+ double x264step = cqStep;
+ double presetValue = presetQuery.VideoQuality;
+
+ double x = 51 / x264step;
+
+ double calculated = presetValue / x264step;
+ calculated = x - calculated;
+
+ int.TryParse(calculated.ToString(), out value);
+
+ // This will sometimes occur when the preset was generated
+ // with a different granularity, so, round and try again.
+ if (value == 0)
{
- int presetVal;
- int.TryParse(presetQuery.VideoQuality.ToString(), out presetVal);
- mainWindow.slider_videoQuality.Value = presetVal;
+ double val = Math.Round(calculated, 0);
+ int.TryParse(val.ToString(), out value);
}
+ if (value <= mainWindow.slider_videoQuality.Maximum)
+ mainWindow.slider_videoQuality.Value = value;
}
+ else
+ {
+ int presetVal;
+ int.TryParse(presetQuery.VideoQuality.ToString(), out presetVal);
+ mainWindow.slider_videoQuality.Value = presetVal;
+ }
+
mainWindow.check_2PassEncode.CheckState = presetQuery.TwoPass ? CheckState.Checked : CheckState.Unchecked;