From: sr55 Date: Wed, 28 Jun 2017 18:53:53 +0000 (+0100) Subject: WinGui: Adding support for Custom Anamorphic back. Implements #504 X-Git-Tag: 1.1.0~479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb56fbecb9d3b249df1de801ace5141a8d5178ed;p=handbrake WinGui: Adding support for Custom Anamorphic back. Implements #504 --- diff --git a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs index 93b85e6e4..896add53e 100644 --- a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs +++ b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs @@ -9,8 +9,6 @@ namespace HandBrakeWPF.Helpers { - using System.Diagnostics; - using HandBrake.ApplicationServices.Interop.HbLib; using HandBrake.ApplicationServices.Interop.Model; using HandBrake.ApplicationServices.Interop.Model.Encoding; diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 6ca2f276e..75fc8ba41 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -1645,20 +1645,11 @@ namespace HandBrakeWPF.Properties { } /// - /// Looks up a localized string similar to PAR Height:. + /// Looks up a localized string similar to PAR:. /// - public static string PictureSettingsView_ParH { + public static string PictureSettingsView_PAR { get { - return ResourceManager.GetString("PictureSettingsView_ParH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to PAR Width:. - /// - public static string PictureSettingsView_ParW { - get { - return ResourceManager.GetString("PictureSettingsView_ParW", resourceCulture); + return ResourceManager.GetString("PictureSettingsView_PAR", resourceCulture); } } diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 6349d4978..2e12b14ef 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -456,11 +456,8 @@ Output - - PAR Height: - - - PAR Width: + + PAR: Right diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 97de36a3c..42cbf0943 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -147,7 +147,7 @@ namespace HandBrakeWPF.ViewModels { get { - return new List { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose }; // , Anamorphic.Custom TODO Re-enable one the UI is re-worked. + return new List { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose, Anamorphic.Custom }; } } @@ -855,7 +855,6 @@ namespace HandBrakeWPF.ViewModels Height = this.sourceResolution.Height, ParW = this.sourceParValues.Width, ParH = this.sourceParValues.Height, - Aspect = 0 // TODO }; return title; @@ -881,8 +880,6 @@ namespace HandBrakeWPF.ViewModels MaxHeight = this.MaxHeight, KeepDisplayAspect = this.MaintainAspectRatio, AnamorphicMode = this.SelectedAnamorphicMode, - DarWidth = 0, - DarHeight = 0, Crop = new Cropping(this.CropTop, this.CropBottom, this.CropLeft, this.CropRight), }; @@ -892,6 +889,12 @@ namespace HandBrakeWPF.ViewModels job.ParH = sourceParValues.Height; } + if (SelectedAnamorphicMode == Anamorphic.Custom) + { + job.ParW = this.DisplayWidth; // num + job.ParH = this.Width; // den + } + return job; } @@ -948,9 +951,15 @@ namespace HandBrakeWPF.ViewModels ? string.Empty : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, dispWidth, result.OutputHeight, this.ParWidth, this.ParHeight); + if (changedField != ChangedPictureField.DisplayWidth) + { + this.Task.DisplayWidth = (int)dispWidth; + } + // Step 4, Force an update on all the UI elements. this.NotifyOfPropertyChange(() => this.Width); this.NotifyOfPropertyChange(() => this.Height); + this.NotifyOfPropertyChange(() => this.DisplayWidth); this.NotifyOfPropertyChange(() => this.ParWidth); this.NotifyOfPropertyChange(() => this.ParHeight); this.NotifyOfPropertyChange(() => this.CropTop); @@ -1006,8 +1015,8 @@ namespace HandBrakeWPF.ViewModels this.HeightControlEnabled = true; this.ShowCustomAnamorphicControls = true; this.ShowModulus = true; - this.ShowDisplaySize = false; - this.ShowKeepAR = false; + this.ShowDisplaySize = true; + this.ShowKeepAR = true; break; } } diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml index b0ed03da9..c6e19a89b 100644 --- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml @@ -90,17 +90,19 @@