summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.mm
diff options
context:
space:
mode:
authordynaflash <[email protected]>2009-02-11 04:16:52 +0000
committerdynaflash <[email protected]>2009-02-11 04:16:52 +0000
commitbb6fae9833388382ddc581ee5da3736e5ed6b247 (patch)
treecf9b9f4ddf1d7ec13dc0c8b27b368193fdd2586f /macosx/Controller.mm
parent8fe4592112acf80dd8fba8de130196e8a12a2c46 (diff)
MacGui: Constant Quality Slider - theora's qp goes up as the quality goes up.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2139 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.mm')
-rw-r--r--macosx/Controller.mm47
1 files changed, 28 insertions, 19 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 13cc8745b..0e1359a07 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -4077,26 +4077,35 @@ the user is using "Custom" settings by determining the sender*/
- (IBAction) qualitySliderChanged: (id) sender
{
- /* Our constant quality slider is in a range based
- * on each encoders qp/rf values. The range depends
- * on the encoder. Also, the range is inverse of quality
- * (ie. as the "quality" goes up, the cq or rf value
- * actually goes down). Since the IB sliders always set
- * their max value at the right end of the slider, we
- * will calculate the inverse, so as the slider floatValue
- * goes up, we will show the inverse in the rf field
- * so, the floatValue at the right for x264 would be 51
- * and our rf field needs to show 0 and vice versa.
- */
-
- float sliderRfInverse = ([fVidQualitySlider maxValue] - [fVidQualitySlider floatValue]) + [fVidQualitySlider minValue];
+ /* Our constant quality slider is in a range based
+ * on each encoders qp/rf values. The range depends
+ * on the encoder. Also, the range is inverse of quality
+ * for all of the encoders *except* for theora
+ * (ie. as the "quality" goes up, the cq or rf value
+ * actually goes down). Since the IB sliders always set
+ * their max value at the right end of the slider, we
+ * will calculate the inverse, so as the slider floatValue
+ * goes up, we will show the inverse in the rf field
+ * so, the floatValue at the right for x264 would be 51
+ * and our rf field needs to show 0 and vice versa.
+ */
+
+ float sliderRfInverse = ([fVidQualitySlider maxValue] - [fVidQualitySlider floatValue]) + [fVidQualitySlider minValue];
+ /* If the encoder is theora, use the float, otherwise use the inverse float*/
+ if ([[fVidEncoderPopUp selectedItem] tag] == HB_VCODEC_THEORA)
+ {
+ [fVidQualityRFField setStringValue: [NSString stringWithFormat: @"%.2f", [fVidQualitySlider floatValue]]];
+ }
+ else
+ {
[fVidQualityRFField setStringValue: [NSString stringWithFormat: @"%.2f", sliderRfInverse]];
-
- float sliderRfToPercent = ( [fVidQualitySlider maxValue] - sliderRfInverse ) / [fVidQualitySlider maxValue];
- [fVidConstantCell setTitle: [NSString stringWithFormat:
- NSLocalizedString( @"Constant quality: %.2f %%", @"" ), 100 * sliderRfToPercent]];
-
- [self customSettingUsed: sender];
+ }
+
+ float sliderRfToPercent = ( [fVidQualitySlider maxValue] - sliderRfInverse ) / [fVidQualitySlider maxValue];
+ [fVidConstantCell setTitle: [NSString stringWithFormat:
+ NSLocalizedString( @"Constant quality: %.2f %%", @"" ), 100 * sliderRfToPercent]];
+
+ [self customSettingUsed: sender];
}
- (void) controlTextDidChange: (NSNotification *) notification