\r
// Quality\r
\r
- mainWindow.radio_cq.Checked = true;\r
- if (presetQuery.VideoEncoder == "H.264 (x264)")\r
+ if (presetQuery.VideoQuality != -1)\r
{\r
- double cqStep = Properties.Settings.Default.x264cqstep;\r
- int value;\r
- double x264step = cqStep;\r
- double presetValue = presetQuery.VideoQuality;\r
-\r
- double x = 51 / x264step;\r
-\r
- double calculated = presetValue / x264step;\r
- calculated = x - calculated;\r
-\r
- int.TryParse(calculated.ToString(), out value);\r
-\r
- // This will sometimes occur when the preset was generated \r
- // with a different granularity, so, round and try again.\r
- if (value == 0)\r
+ mainWindow.radio_cq.Checked = true;\r
+ if (presetQuery.VideoEncoder == "H.264 (x264)")\r
{\r
- double val = Math.Round(calculated, 0);\r
- int.TryParse(val.ToString(), out value);\r
+ double cqStep = Properties.Settings.Default.x264cqstep;\r
+ int value;\r
+ double x264step = cqStep;\r
+ double presetValue = presetQuery.VideoQuality;\r
+\r
+ double x = 51/x264step;\r
+\r
+ double calculated = presetValue/x264step;\r
+ calculated = x - calculated;\r
+\r
+ int.TryParse(calculated.ToString(), out value);\r
+\r
+ // This will sometimes occur when the preset was generated \r
+ // with a different granularity, so, round and try again.\r
+ if (value == 0)\r
+ {\r
+ double val = Math.Round(calculated, 0);\r
+ int.TryParse(val.ToString(), out value);\r
+ }\r
+ if (value <= mainWindow.slider_videoQuality.Maximum)\r
+ mainWindow.slider_videoQuality.Value = value;\r
+ }\r
+ else\r
+ {\r
+ int presetVal;\r
+ int.TryParse(presetQuery.VideoQuality.ToString(), out presetVal);\r
+ if (presetVal > mainWindow.slider_videoQuality.Minimum)\r
+ mainWindow.slider_videoQuality.Value = presetVal;\r
}\r
- if (value <= mainWindow.slider_videoQuality.Maximum)\r
- mainWindow.slider_videoQuality.Value = value;\r
- }\r
- else\r
- {\r
- int presetVal;\r
- int.TryParse(presetQuery.VideoQuality.ToString(), out presetVal);\r
- if (presetVal > mainWindow.slider_videoQuality.Minimum)\r
- mainWindow.slider_videoQuality.Value = presetVal;\r
}\r
\r
-\r
mainWindow.check_2PassEncode.CheckState = presetQuery.TwoPass ? CheckState.Checked : CheckState.Unchecked;\r
\r
mainWindow.drp_videoFramerate.Text = presetQuery.VideoFramerate;\r