From 8bdaf62855e06248bdf4c4d5b22d9051f092ad27 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 8 Sep 2012 18:16:46 +0000 Subject: WinGui: Couple Corrections to the Audiobitrate converter. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4941 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Model/Encoding/AudioTrack.cs | 2 +- .../Converters/Audio/AudioBitrateConverter.cs | 15 ++++----------- win/CS/HandBrakeWPF/Views/AudioView.xaml | 4 ++-- 3 files changed, 7 insertions(+), 14 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs index fedeb275f..830cea25e 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs @@ -338,7 +338,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding /// /// Gets a value indicating whether can set bitrate. /// - public bool CanSetBitrate + public bool CannotSetBitrate { get { diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs index 28bbf81ac..f4e805957 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs @@ -80,26 +80,19 @@ namespace HandBrakeWPF.Converters.Audio break; case AudioEncoder.ffaac: low = ((channels + lfeCount) * 32); - max = ((channels + lfeCount) * - ((192 + (64 * ((samplerate << srShift) >= 44100 ? 1 : 0))) - >> srShift)); + max = ((channels + lfeCount) * ((192 + (64 * ((samplerate << srShift) >= 44100 ? 1 : 0))) >> srShift)); break; case AudioEncoder.Lame: low = 8 + (24 * (srShift < 1 ? 1 : 0) ); max = 64 + (96 * (srShift < 2 ? 1 : 0)) + (160 * (srShift < 1 ? 1 : 0)); break; case AudioEncoder.Vorbis: - low = (channels + lfeCount) * (14 + - (8 * (srShift < 2 ? 1 : 0)) + - (6 * (srShift < 1 ? 1 : 0))); - max = (channels + lfeCount) * (32 + - (54 * (srShift < 2 ? 1 : 0)) + - (104 * (srShift < 1 ? 1 : 0)) + - (50 * (samplerate >= 44100 ? 1 : 0))); + low = (channels + lfeCount) * (14 + (8 * (srShift < 2 ? 1 : 0)) + (6 * (srShift < 1 ? 1 : 0))); + max = (channels + lfeCount) * (32 + (54 * (srShift < 2 ? 1 : 0)) + (104 * (srShift < 1 ? 1 : 0)) + (50 * (samplerate >= 44100 ? 1 : 0))); break; case AudioEncoder.Ac3: low = 224 * channels / 5; - max = samplerate > 24 ? 640 : 320; + max = 640; break; case AudioEncoder.Ac3Passthrough: case AudioEncoder.DtsPassthrough: diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml index 2f8d0d8e3..d90e5643f 100644 --- a/win/CS/HandBrakeWPF/Views/AudioView.xaml +++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml @@ -200,7 +200,7 @@ VerticalAlignment="Center" FontWeight="Bold" Text="Bitrate" - Visibility="{Binding CanSetBitrate, + Visibility="{Binding CannotSetBitrate, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" /> -- cgit v1.2.3