From 4dfd0131c7ae509122f13ecc775decc970ef3a89 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 6 Jan 2013 19:45:04 +0000 Subject: WinGui: Restore RF0 warning and Correctly show RF or QP depending on the video encoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5159 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Model/Encoding/AudioEncoder.cs | 3 +++ .../HandBrakeWPF/Properties/Resources.Designer.cs | 25 +++++++++++++++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 13 +++++++++++ win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 26 ++++++++++++++++++---- win/CS/HandBrakeWPF/Views/VideoView.xaml | 5 ++++- 5 files changed, 67 insertions(+), 5 deletions(-) diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs index 570597176..c8877e6d6 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs @@ -2,6 +2,9 @@ // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // +// +// The audio encoder enumeration +// // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.Interop.Model.Encoding diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index ba0031cc6..b1a31d882 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -286,6 +286,31 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Warning: RF 0 is Lossless!. + /// + public static string Video_LosslessWarning { + get { + return ResourceManager.GetString("Video_LosslessWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value of 0 means lossless and will result in a file size that is larger than the original source, + ///unless the source was also lossless. + /// + ///x264's scale is logarithmic and lower values correspond to higher quality. + /// + ///So small increases in value will result in progressively larger increases in the resulting file size. + /// + ///Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Definition.. + /// + public static string Video_LosslessWarningTooltip { + get { + return ResourceManager.GetString("Video_LosslessWarningTooltip", resourceCulture); + } + } + /// /// Looks up a localized string similar to Set the desired quality factor. The encoder targets a certain quality. ///The scale used by each video encoder is different. diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 6265c3fc9..64d5ef562 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -277,4 +277,17 @@ Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Def FFMpeg's and Theora's scale is more linear. These encoders do not have a lossless mode. + + Warning: RF 0 is Lossless! + + + A value of 0 means lossless and will result in a file size that is larger than the original source, +unless the source was also lossless. + +x264's scale is logarithmic and lower values correspond to higher quality. + +So small increases in value will result in progressively larger increases in the resulting file size. + +Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Definition. + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index b0b46b760..6164e3603 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -23,12 +23,10 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.ApplicationServices.Utilities; using HandBrake.Interop; - using HandBrake.Interop.HbLib; using HandBrake.Interop.Model.Encoding; using HandBrake.Interop.Model.Encoding.x264; using HandBrakeWPF.Commands.Interfaces; - using HandBrakeWPF.Properties; using HandBrakeWPF.ViewModels.Interfaces; /// @@ -240,6 +238,17 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets a value indicating whether is lossless. + /// + public bool IsLossless + { + get + { + return 51.Equals(this.RF); + } + } + /// /// Gets or sets QualityMax. /// @@ -303,8 +312,6 @@ namespace HandBrakeWPF.ViewModels double rfValue = 51.0 - value * cqStep; rfValue = Math.Round(rfValue, 2); this.Task.Quality = rfValue; - - // TODO: Lossless warning. break; case VideoEncoder.Theora: Task.Quality = value; @@ -313,6 +320,7 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.RF); this.NotifyOfPropertyChange(() => this.DisplayRF); + this.NotifyOfPropertyChange(() => this.IsLossless); } } @@ -327,6 +335,14 @@ namespace HandBrakeWPF.ViewModels } } + public string Rfqp + { + get + { + return this.SelectedVideoEncoder == VideoEncoder.X264 ? "RF" : "QP"; + } + } + /// /// Gets or sets SelectedFramerate. /// @@ -391,6 +407,8 @@ namespace HandBrakeWPF.ViewModels // Hide the x264 controls when not needed. this.DisplayX264Options = value == VideoEncoder.X264; + + this.NotifyOfPropertyChange(() => this.Rfqp); } } diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 78186238d..c9b125abe 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -79,7 +79,10 @@ - + + +