summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-06-28 19:53:53 +0100
committersr55 <[email protected]>2017-06-28 19:53:53 +0100
commiteb56fbecb9d3b249df1de801ace5141a8d5178ed (patch)
tree44b5a2e44b05421b8754257c50c699633893e689
parentda26ad0dfae416d0cdbd546cae4c067af317c5c5 (diff)
WinGui: Adding support for Custom Anamorphic back. Implements #504
-rw-r--r--win/CS/HandBrakeWPF/Helpers/PictureSize.cs2
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs15
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx7
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs21
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml18
5 files changed, 30 insertions, 33 deletions
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 {
}
/// <summary>
- /// Looks up a localized string similar to PAR Height:.
+ /// Looks up a localized string similar to PAR:.
/// </summary>
- public static string PictureSettingsView_ParH {
+ public static string PictureSettingsView_PAR {
get {
- return ResourceManager.GetString("PictureSettingsView_ParH", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to PAR Width:.
- /// </summary>
- 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 @@
<data name="PictureSettingsView_Output" xml:space="preserve">
<value>Output</value>
</data>
- <data name="PictureSettingsView_ParH" xml:space="preserve">
- <value>PAR Height:</value>
- </data>
- <data name="PictureSettingsView_ParW" xml:space="preserve">
- <value>PAR Width:</value>
+ <data name="PictureSettingsView_PAR" xml:space="preserve">
+ <value>PAR:</value>
</data>
<data name="PictureSettingsView_Right" xml:space="preserve">
<value>Right</value>
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> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose }; // , Anamorphic.Custom TODO Re-enable one the UI is re-worked.
+ return new List<Anamorphic> { 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 @@
</Grid.ColumnDefinitions>
<Label Content="{x:Static Properties:ResourcesUI.PictureSettingsView_DisplayWitdh}" Grid.Row="0" Grid.Column="0" />
- <Label Content="{x:Static Properties:ResourcesUI.PictureSettingsView_ParW}" Grid.Row="1" Grid.Column="0" />
- <Label Content="{x:Static Properties:ResourcesUI.PictureSettingsView_ParH}" Grid.Row="2" Grid.Column="0" />
+ <Label Content="{x:Static Properties:ResourcesUI.PictureSettingsView_PAR}" Grid.Row="1" Grid.Column="0" />
<controls:NumberBox Width="60" Number="{Binding DisplayWidth, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
AllowEmpty="False" />
- <controls:NumberBox Width="60" Number="{Binding ParWidth, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" AllowEmpty="False"
- IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
- ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
- <controls:NumberBox Width="60" Number="{Binding ParHeight, Mode=TwoWay}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" AllowEmpty="False"
- IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
- ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
+ <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
+ <controls:NumberBox Width="60" Number="{Binding ParWidth, Mode=TwoWay}" HorizontalAlignment="Left" AllowEmpty="False"
+ IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
+ ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
+ <TextBlock Text="X" Margin="10,0,10,0" />
+ <controls:NumberBox Width="60" Number="{Binding ParHeight, Mode=TwoWay}" HorizontalAlignment="Left" AllowEmpty="False"
+ IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
+ ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
+ </StackPanel>
</Grid>
</StackPanel>