summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs3
-rw-r--r--win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs30
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs9
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx3
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs138
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs75
-rw-r--r--win/CS/HandBrakeWPF/Views/AddPresetView.xaml58
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml4
9 files changed, 205 insertions, 124 deletions
diff --git a/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs b/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs
index 877550470..c9aa7718c 100644
--- a/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs
+++ b/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs
@@ -12,6 +12,9 @@ namespace HandBrakeWPF.Model.Picture
public enum PictureSettingsResLimitModes
{
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_none")]
+ None,
+
[DisplayName(typeof(Resources), "PictureSettingsResLimitModes_8K")]
[ResLimit(7680, 4320)]
Size8K,
diff --git a/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs b/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs
deleted file mode 100644
index d4d2845c8..000000000
--- a/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="PresetPictureSettingsMode.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// Picture Settings Mode when adding presets
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Model.Picture
-{
- using HandBrake.Interop.Attributes;
-
- using HandBrakeWPF.Properties;
-
- /// <summary>
- /// Picture Settings Mode when adding presets
- /// </summary>
- public enum PresetPictureSettingsMode2
- {
- [DisplayName(typeof(Resources), "PresetPictureSettingsMode_None")]
- None = 0,
-
- [DisplayName(typeof(Resources), "PresetPictureSettingsMode_Custom")]
- Custom = 1,
-
- [DisplayName(typeof(Resources), "PresetPictureSettingsMode_SourceMaximum")]
- SourceMaximum = 2,
- }
-} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 77aaed9cb..330db2cb3 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -3917,6 +3917,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to None.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_none {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_none", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Anamorphic:.
/// </summary>
public static string PictureSettingsView_Anamorphic {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index e75028c5b..f514f7535 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -2310,4 +2310,7 @@ Please choose a different preset.</value>
<data name="PictureSettingsView_ResLimit" xml:space="preserve">
<value>Resolution Limit:</value>
</data>
+ <data name="PictureSettingsResLimitModes_none" xml:space="preserve">
+ <value>None</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
index c6e35cb96..e2fa48ce9 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
@@ -71,11 +71,10 @@ namespace HandBrakeWPF.Services.Presets.Factories
/* Output Settings */
preset.Task.OptimizeMP4 = importedPreset.Mp4HttpOptimize;
preset.Task.IPod5GSupport = importedPreset.Mp4iPodCompatible;
- preset.Task.OutputFormat = GetFileFormat(importedPreset.FileFormat.Replace("file", string.Empty).Trim()); // TOOD null check.
+ preset.Task.OutputFormat = GetFileFormat(importedPreset.FileFormat.Replace("file", string.Empty).Trim());
preset.Task.AlignAVStart = importedPreset.AlignAVStart;
/* Picture Settings */
- // preset.PictureSettingsMode = (PresetPictureSettingsMode)importedPreset.UsesPictureSettings;
preset.Task.MaxWidth = importedPreset.PictureWidth.HasValue && importedPreset.PictureWidth.Value > 0 ? importedPreset.PictureWidth.Value : (int?)null;
preset.Task.MaxHeight = importedPreset.PictureHeight.HasValue && importedPreset.PictureHeight.Value > 0 ? importedPreset.PictureHeight.Value : (int?)null;
preset.Task.Cropping = new Cropping(importedPreset.PictureTopCrop, importedPreset.PictureBottomCrop, importedPreset.PictureLeftCrop, importedPreset.PictureRightCrop);
@@ -544,7 +543,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.PresetDescription = export.Description;
preset.PresetName = export.Name;
preset.Type = export.IsBuildIn ? 0 : 1;
- // preset.UsesPictureSettings = (int)export.PictureSettingsMode;
+ preset.UsesPictureSettings = 1; // Set to Custom, Always for the new UI.
preset.Default = export.IsDefault;
// Audio
@@ -595,7 +594,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
// Picture Settings
preset.PictureForceHeight = 0; // TODO
preset.PictureForceWidth = 0; // TODO
- preset.PictureHeight = preset.UsesPictureSettings >= 1 ? export.Task.MaxHeight : 0; // TODO; // TODO
+ preset.PictureHeight = preset.UsesPictureSettings >= 1 ? export.Task.MaxHeight : 0;
preset.PictureItuPAR = false; // TODO Not supported Yet
preset.PictureKeepRatio = export.Task.KeepDisplayAspect;
preset.PictureLeftCrop = export.Task.Cropping.Left;
@@ -612,7 +611,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
}
preset.PictureTopCrop = export.Task.Cropping.Top;
- preset.PictureWidth = preset.UsesPictureSettings >= 1 ? export.Task.MaxWidth : 0; // TODO
+ preset.PictureWidth = preset.UsesPictureSettings >= 1 ? export.Task.MaxWidth : 0;
preset.PictureDARWidth = export.Task.DisplayWidth.HasValue ? (int)export.Task.DisplayWidth.Value : 0;
preset.PictureAutoCrop = !export.Task.HasCropping;
preset.PictureBottomCrop = export.Task.Cropping.Bottom;
diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
index e7a9235fc..fd6c8bdb3 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
@@ -10,12 +10,14 @@
namespace HandBrakeWPF.ViewModels
{
using System.Collections.Generic;
+ using System.ComponentModel;
using System.Linq;
using System.Windows;
using Caliburn.Micro;
using HandBrakeWPF.Model.Audio;
+ using HandBrakeWPF.Model.Picture;
using HandBrakeWPF.Model.Subtitles;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Interfaces;
@@ -23,14 +25,12 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.Services.Presets.Interfaces;
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Services.Scan.Model;
+ using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModels.Interfaces;
using HandBrakeWPF.Views;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
- /// <summary>
- /// The Add Preset View Model
- /// </summary>
public class AddPresetViewModel : ViewModelBase, IAddPresetViewModel
{
private readonly IPresetService presetService;
@@ -39,25 +39,13 @@ namespace HandBrakeWPF.ViewModels
private readonly PresetDisplayCategory addNewCategory = new PresetDisplayCategory(Resources.AddPresetView_AddNewCategory, true, null);
private bool showCustomInputs;
-
private IAudioDefaultsViewModel audioDefaultsViewModel;
private ISubtitlesDefaultsViewModel subtitlesDefaultsViewModel;
-
private PresetDisplayCategory selectedPresetCategory;
private bool canAddNewPresetCategory;
- /// <summary>
- /// Initializes a new instance of the <see cref="AddPresetViewModel"/> class.
- /// </summary>
- /// <param name="presetService">
- /// The Preset Service
- /// </param>
- /// <param name="errorService">
- /// The Error Service
- /// </param>
- /// <param name="windowManager">
- /// The window Manager.
- /// </param>
+ private PictureSettingsResLimitModes selectedPictureSettingsResLimitMode;
+
public AddPresetViewModel(IPresetService presetService, IErrorService errorService, IWindowManager windowManager)
{
this.presetService = presetService;
@@ -67,6 +55,9 @@ namespace HandBrakeWPF.ViewModels
this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName };
this.PresetCategories = presetService.GetPresetCategories(true).Union(new List<PresetDisplayCategory> { addNewCategory }).ToList();
this.SelectedPresetCategory = this.PresetCategories.FirstOrDefault(n => n.Category == PresetService.UserPresetCatgoryName);
+
+ this.CustomHeight = 0;
+ this.CustomWidth = 0;
}
public Preset Preset { get; }
@@ -128,6 +119,58 @@ namespace HandBrakeWPF.ViewModels
}
}
+ public BindingList<PictureSettingsResLimitModes> ResolutionLimitModes => new BindingList<PictureSettingsResLimitModes>
+ {
+ PictureSettingsResLimitModes.None,
+ PictureSettingsResLimitModes.Size8K,
+ PictureSettingsResLimitModes.Size4K,
+ PictureSettingsResLimitModes.Size1080p,
+ PictureSettingsResLimitModes.Size720p,
+ PictureSettingsResLimitModes.Size576p,
+ PictureSettingsResLimitModes.Size480p,
+ PictureSettingsResLimitModes.Custom,
+ };
+
+ public PictureSettingsResLimitModes SelectedPictureSettingsResLimitMode
+ {
+ get => this.selectedPictureSettingsResLimitMode;
+ set
+ {
+ if (value == this.selectedPictureSettingsResLimitMode)
+ {
+ return;
+ }
+
+ this.selectedPictureSettingsResLimitMode = value;
+ this.NotifyOfPropertyChange(() => this.SelectedPictureSettingsResLimitMode);
+
+ this.IsCustomMaxRes = value == PictureSettingsResLimitModes.Custom;
+ this.NotifyOfPropertyChange(() => this.IsCustomMaxRes);
+
+ // Enforce the new limit
+ ResLimit limit = EnumHelper<PictureSettingsResLimitModes>.GetAttribute<ResLimit, PictureSettingsResLimitModes>(value);
+ if (limit != null)
+ {
+ this.CustomWidth = limit.Width;
+ this.CustomHeight = limit.Height;
+ this.NotifyOfPropertyChange(() => this.CustomWidth);
+ this.NotifyOfPropertyChange(() => this.CustomHeight);
+ }
+
+ if (value == PictureSettingsResLimitModes.None)
+ {
+ this.CustomWidth = null;
+ this.CustomHeight = null;
+ }
+ }
+ }
+
+ public bool IsCustomMaxRes { get; private set; }
+
+ public int? CustomWidth { get; set; }
+
+ public int? CustomHeight { get; set; }
+
public void Setup(EncodeTask task, Title title, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours)
{
this.Preset.Task = new EncodeTask(task);
@@ -139,6 +182,14 @@ namespace HandBrakeWPF.ViewModels
this.subtitlesDefaultsViewModel = new SubtitlesDefaultsViewModel();
this.subtitlesDefaultsViewModel.SetupLanguages(subtitleBehaviours);
+
+ // Resolution Limits
+ this.CustomWidth = task.MaxWidth;
+ this.CustomHeight = task.MaxHeight;
+ this.NotifyOfPropertyChange(() => this.CustomWidth);
+ this.NotifyOfPropertyChange(() => this.CustomHeight);
+
+ this.SetSelectedPictureSettingsResLimitMode();
}
public void Add()
@@ -164,7 +215,20 @@ namespace HandBrakeWPF.ViewModels
return;
}
}
-
+
+ if (this.SelectedPictureSettingsResLimitMode != PictureSettingsResLimitModes.None)
+ {
+ if (this.CustomWidth != null)
+ {
+ this.Preset.Task.MaxWidth = this.CustomWidth;
+ }
+
+ if (this.CustomHeight != null)
+ {
+ this.Preset.Task.MaxHeight = this.CustomHeight;
+ }
+ }
+
// Add the Preset
bool added = this.presetService.Add(this.Preset);
if (!added)
@@ -181,9 +245,6 @@ namespace HandBrakeWPF.ViewModels
}
}
- /// <summary>
- /// The edit audio defaults.
- /// </summary>
public void EditAudioDefaults()
{
this.audioDefaultsViewModel.ResetApplied();
@@ -194,9 +255,6 @@ namespace HandBrakeWPF.ViewModels
}
}
- /// <summary>
- /// The edit subtitle defaults.
- /// </summary>
public void EditSubtitleDefaults()
{
this.subtitlesDefaultsViewModel.ResetApplied();
@@ -210,20 +268,40 @@ namespace HandBrakeWPF.ViewModels
}
}
- /// <summary>
- /// Cancel adding a preset
- /// </summary>
public void Cancel()
{
this.Close();
}
- /// <summary>
- /// Close this window.
- /// </summary>
public void Close()
{
this.TryClose();
}
+
+ private void SetSelectedPictureSettingsResLimitMode()
+ {
+ // Look for a matching resolution.
+ foreach (PictureSettingsResLimitModes limit in EnumHelper<PictureSettingsResLimitModes>.GetEnumList())
+ {
+ ResLimit resLimit = EnumHelper<PictureSettingsResLimitModes>.GetAttribute<ResLimit, PictureSettingsResLimitModes>(limit);
+ if (resLimit != null)
+ {
+ if (resLimit.Width == this.CustomWidth && resLimit.Height == this.CustomHeight)
+ {
+ this.SelectedPictureSettingsResLimitMode = limit;
+ return;
+ }
+ }
+ }
+
+ if (this.CustomWidth.HasValue || this.CustomHeight.HasValue)
+ {
+ this.SelectedPictureSettingsResLimitMode = PictureSettingsResLimitModes.Custom;
+ }
+ else
+ {
+ this.SelectedPictureSettingsResLimitMode = PictureSettingsResLimitModes.None;
+ }
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 925d3e269..e8a889357 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -41,8 +41,6 @@ namespace HandBrakeWPF.ViewModels
private bool widthControlEnabled = true;
private bool showModulus;
private bool showDisplaySize;
- private int maxHeight;
- private int maxWidth;
private bool showKeepAr = true;
private DelayedActionProcessor delayedPreviewprocessor = new DelayedActionProcessor();
@@ -152,25 +150,29 @@ namespace HandBrakeWPF.ViewModels
}
}
- public int MaxHeight
+ public int? MaxHeight
{
- get => this.maxHeight;
+ get => this.Task.MaxHeight;
set
{
- this.maxHeight = value;
- this.NotifyOfPropertyChange(() => this.MaxHeight);
- this.SetSelectedPictureSettingsResLimitMode();
+ if (value != this.Task.MaxHeight)
+ {
+ this.Task.MaxHeight = value;
+ this.NotifyOfPropertyChange(() => this.MaxHeight);
+ }
}
}
- public int MaxWidth
+ public int? MaxWidth
{
- get => this.maxWidth;
+ get => this.Task.MaxWidth;
set
{
- this.maxWidth = value;
- this.NotifyOfPropertyChange(() => this.MaxWidth);
- this.SetSelectedPictureSettingsResLimitMode();
+ if (value != this.Task.MaxWidth)
+ {
+ this.Task.MaxWidth = value;
+ this.NotifyOfPropertyChange(() => this.MaxWidth);
+ }
}
}
@@ -210,26 +212,41 @@ namespace HandBrakeWPF.ViewModels
this.IsCustomMaxRes = value == PictureSettingsResLimitModes.Custom;
this.NotifyOfPropertyChange(() => this.IsCustomMaxRes);
-
+
// Enforce the new limit
ResLimit limit = EnumHelper<PictureSettingsResLimitModes>.GetAttribute<ResLimit, PictureSettingsResLimitModes>(value);
+
+ if (value == PictureSettingsResLimitModes.Custom && this.Task.MaxWidth == null && this.Task.MaxHeight == null)
+ {
+ // Default to 4K if null!
+ limit = EnumHelper<PictureSettingsResLimitModes>.GetAttribute<ResLimit, PictureSettingsResLimitModes>(PictureSettingsResLimitModes.Size4K);
+ }
+
if (limit != null)
{
- this.maxWidth = limit.Width;
- this.maxHeight = limit.Height;
- this.NotifyOfPropertyChange(() => this.MaxWidth);
- this.NotifyOfPropertyChange(() => this.Height);
+ this.Task.MaxWidth = limit.Width;
+ this.Task.MaxHeight = limit.Height;
- if (this.Width > this.MaxWidth)
+ if (this.MaxWidth.HasValue && this.Width > this.MaxWidth)
{
- this.Width = this.MaxWidth;
+ this.Width = this.MaxWidth.Value;
}
- if (this.Height > this.MaxWidth)
+ if (this.MaxHeight.HasValue && this.Height > this.MaxHeight)
{
- this.Height = this.MaxHeight;
+ this.Height = this.MaxHeight.Value;
}
}
+
+
+ if (value == PictureSettingsResLimitModes.None)
+ {
+ this.Task.MaxWidth = null;
+ this.Task.MaxHeight = null;
+ }
+
+ this.NotifyOfPropertyChange(() => this.MaxWidth);
+ this.NotifyOfPropertyChange(() => this.MaxHeight);
}
}
@@ -464,6 +481,7 @@ namespace HandBrakeWPF.ViewModels
// Setup the Maximum Width / Height with sane 4K fallback.
this.MaxWidth = preset.Task.MaxWidth ?? 3840;
this.MaxHeight = preset.Task.MaxHeight ?? 2160;
+ this.SetSelectedPictureSettingsResLimitMode();
// Set the width, then check the height doesn't breach the max height and correct if necessary.
int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth));
@@ -497,6 +515,8 @@ namespace HandBrakeWPF.ViewModels
public void UpdateTask(EncodeTask task)
{
this.Task = task;
+ this.SetSelectedPictureSettingsResLimitMode();
+
this.PaddingFilter.UpdateTask(task);
this.RotateFlipFilter?.UpdateTask(task);
@@ -513,6 +533,8 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.DisplayWidth);
this.NotifyOfPropertyChange(() => this.ParWidth);
this.NotifyOfPropertyChange(() => this.ParHeight);
+ this.NotifyOfPropertyChange(() => this.MaxWidth);
+ this.NotifyOfPropertyChange(() => this.MaxHeight);
this.UpdateVisibileControls();
}
@@ -553,6 +575,7 @@ namespace HandBrakeWPF.ViewModels
// Setup the Maximum Width / Height with sane 4K fallback.
this.MaxWidth = preset.Task.MaxWidth ?? 3840;
this.MaxHeight = preset.Task.MaxHeight ?? 2160;
+ this.SetSelectedPictureSettingsResLimitMode();
// Set the W/H
// Set the width, then check the height doesn't breach the max height and correct if necessary.
@@ -618,6 +641,7 @@ namespace HandBrakeWPF.ViewModels
// Default the Max Width / Height to 4K format
this.MaxHeight = 2160;
this.MaxWidth = 3480;
+ this.SetSelectedPictureSettingsResLimitMode();
}
private PictureSize.PictureSettingsTitle GetPictureTitleInfo()
@@ -643,8 +667,8 @@ namespace HandBrakeWPF.ViewModels
Modulus = this.SelectedModulus,
ParW = this.SelectedAnamorphicMode == Anamorphic.None ? 1 : this.ParWidth,
ParH = this.SelectedAnamorphicMode == Anamorphic.None ? 1 : this.ParHeight,
- MaxWidth = this.MaxWidth,
- MaxHeight = this.MaxHeight,
+ MaxWidth = this.MaxWidth.HasValue ? this.MaxWidth.Value : 0,
+ MaxHeight = this.MaxHeight.HasValue ? this.MaxHeight.Value : 0,
KeepDisplayAspect = this.MaintainAspectRatio,
AnamorphicMode = this.SelectedAnamorphicMode,
Crop = new Cropping(this.CropTop, this.CropBottom, this.CropLeft, this.CropRight),
@@ -838,6 +862,11 @@ namespace HandBrakeWPF.ViewModels
}
}
}
+
+ if (this.MaxWidth.HasValue || this.MaxHeight.HasValue)
+ {
+ this.SelectedPictureSettingsResLimitMode = PictureSettingsResLimitModes.Custom;
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
index 2dd2b0c6d..004502374 100644
--- a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
@@ -6,6 +6,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
+ xmlns:picture="clr-namespace:HandBrakeWPF.Converters.Picture"
Title="{Binding Title}"
Width="350"
ResizeMode="NoResize"
@@ -17,6 +18,7 @@
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
+ <picture:ResolutionLimitConverter x:Key="resolutionLimitConverter" />
<Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
@@ -84,42 +86,30 @@
<!-- Settings -->
- <!--<TextBlock Grid.Row="4" Margin="0,10,10,0"
- Grid.Column="0"
- Style="{StaticResource LongToolTipHolder}"
- VerticalAlignment="Center"
- ToolTip="{x:Static Properties:Resources.AddPreset_PictureSizeMode}"
- Text="{x:Static Properties:Resources.AddPresetView_SavePictureSize}" />
- <ComboBox Grid.Row="4" Margin="0,10,0,0"
- Grid.Column="1"
- Width="125"
- HorizontalAlignment="Left" VerticalAlignment="Center"
- ToolTip="{x:Static Properties:Resources.AddPreset_PictureSizeMode}"
- ItemsSource="{Binding PictureSettingsModes,
- Converter={StaticResource enumComboConverter}}"
- SelectedItem="{Binding SelectedPictureSettingMode,
- Converter={StaticResource enumComboConverter}}" />
-
- <StackPanel Grid.Row="5"
- Grid.Column="1"
- Margin="0,10,0,0"
- Orientation="Horizontal"
- Visibility="{Binding ShowCustomInputs,
- Converter={StaticResource boolToVisConverter}}">
- <controls:NumberBox Width="60" Number="{Binding CustomWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="0,0,0,5"
- AllowEmpty="True" />
- <TextBlock Margin="10,0,10,0"
- FontWeight="Bold"
- Text="X" />
- <controls:NumberBox Width="60" Number="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="0,0,0,5"
- AllowEmpty="True" />
- </StackPanel>-->
-
- <TextBlock Text="Audio:" Grid.Row="6" />
- <Button Content="{x:Static Properties:Resources.AudioViewModel_ConfigureDefaults}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Left" Margin="0,5,0,0" Padding="8,2"
+ <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_ResLimit}" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="0,15,0,5" />
+ <ComboBox ItemsSource="{Binding ResolutionLimitModes, Converter={StaticResource resolutionLimitConverter}}"
+ SelectedItem="{Binding SelectedPictureSettingsResLimitMode, Converter={StaticResource resolutionLimitConverter}}"
+ Width="150" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" Margin="0,15,0,5"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_ResLimit}" />
+
+
+ <!-- MAX Width and MAX Height -->
+ <StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal">
+ <controls:NumberBox Number="{Binding CustomWidth, Mode=TwoWay}" UpdateBindingOnTextChange="True"
+ Modulus="2" Minimum="0" Width="60"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_MaxWidth}" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" />
+
+ <TextBlock Text="x" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" VerticalAlignment="Center" Margin="10,0,10,0" />
+ <controls:NumberBox Number="{Binding CustomHeight, Mode=TwoWay}" UpdateBindingOnTextChange="True"
+ Modulus="2" Minimum="0" Width="60"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_MaxHeight}" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" />
+ </StackPanel>
+
+ <TextBlock Text="Audio:" Grid.Row="6" VerticalAlignment="Center" Margin="0,15,0,0" />
+ <Button Content="{x:Static Properties:Resources.AudioViewModel_ConfigureDefaults}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Left" Margin="0,15,0,0" Padding="8,2"
cal:Message.Attach="[Event Click] = [Action EditAudioDefaults]" />
- <TextBlock Text="Subtitles:" Grid.Row="7" />
+ <TextBlock Text="Subtitles:" Grid.Row="7" VerticalAlignment="Center" Margin="0,5,0,0" />
<Button Content="{x:Static Properties:Resources.SubtitlesViewModel_ConfigureDefaults}" Grid.Row="7" Grid.Column="1" HorizontalAlignment="Left" Margin="0,5,0,0" Padding="8,2"
cal:Message.Attach="[Event Click] = [Action EditSubtitleDefaults]" />
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
index 9b7eccaaf..1023bd812 100644
--- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
@@ -73,12 +73,12 @@
<!-- MAX Width and MAX Height -->
<Label Content="{x:Static Properties:Resources.PictureSettingsView_MaxWidth}" Grid.Row="1" Grid.Column="0" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" VerticalAlignment="Center" />
- <controls:NumberBox Number="{Binding Width, Mode=TwoWay}" UpdateBindingOnTextChange="True" IsEnabled="{Binding WidthControlEnabled}" Grid.Row="1" Grid.Column="1"
+ <controls:NumberBox Number="{Binding MaxWidth, Mode=TwoWay}" UpdateBindingOnTextChange="True" Grid.Row="1" Grid.Column="1"
Modulus="{Binding SelectedModulus, Mode=OneWay}" Minimum="0" Width="60"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_MaxWidth}" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" />
<Label Content="{x:Static Properties:Resources.PictureSettingsView_MaxHeight}" Grid.Row="1" Grid.Column="2" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" VerticalAlignment="Center" />
- <controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" UpdateBindingOnTextChange="True" Grid.Row="1" Grid.Column="3"
+ <controls:NumberBox Number="{Binding MaxHeight, Mode=TwoWay}" UpdateBindingOnTextChange="True" Grid.Row="1" Grid.Column="3"
Modulus="{Binding SelectedModulus, Mode=OneWay}"
Minimum="0" Width="60"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_MaxHeight}" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" />