summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-06-26 21:30:37 +0100
committersr55 <[email protected]>2020-06-26 21:30:37 +0100
commitd97eb4f9a23dd8dd6019b0d3e2121294d8bb7dea (patch)
tree8e517e51417b734ba3eefce28a268fc427237686 /win/CS/HandBrakeWPF
parentc57e68f0902a93a79907829758a1b7feed670d64 (diff)
WinGui: Experimental new Dimensions Tab Design. (Part 1 of Several). Adding the Resolution Limit on display and removing upscale limitations. (These will come back in some less restrictive than current form later) #2437
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs16
-rw-r--r--win/CS/HandBrakeWPF/Converters/Picture/ResolutionLimitConverter.cs49
-rw-r--r--win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs42
-rw-r--r--win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs2
-rw-r--r--win/CS/HandBrakeWPF/Model/Picture/ResLimit.cs23
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs90
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx30
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs4
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs123
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs166
-rw-r--r--win/CS/HandBrakeWPF/Utilities/EnumHelper.cs17
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs149
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs211
-rw-r--r--win/CS/HandBrakeWPF/Views/AddPresetView.xaml4
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml130
15 files changed, 451 insertions, 605 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
index 20c833cdd..aeaf153f2 100644
--- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
@@ -20,7 +20,6 @@ namespace HandBrakeWPF.Converters
using HandBrakeWPF.Services.Queue.Model;
using HandBrakeWPF.Utilities;
using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat;
- using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
/// <summary>
/// Enum Combo Converter
@@ -40,11 +39,6 @@ namespace HandBrakeWPF.Converters
return EnumHelper<VideoEncoder>.GetEnumDisplayValues(typeof(VideoEncoder));
}
- if (value is IEnumerable<PresetPictureSettingsMode>)
- {
- return EnumHelper<PresetPictureSettingsMode>.GetEnumDisplayValues(typeof(PresetPictureSettingsMode));
- }
-
if (value is IEnumerable<Detelecine>)
{
return EnumHelper<Detelecine>.GetEnumDisplayValues(typeof(Detelecine));
@@ -101,11 +95,6 @@ namespace HandBrakeWPF.Converters
return EnumHelper<VideoEncoder>.GetDisplay((VideoEncoder)value);
}
- if (targetType == typeof(PresetPictureSettingsMode) || value.GetType() == typeof(PresetPictureSettingsMode))
- {
- return EnumHelper<PresetPictureSettingsMode>.GetDisplay((PresetPictureSettingsMode)value);
- }
-
if (targetType == typeof(Detelecine) || value.GetType() == typeof(Detelecine))
{
return EnumHelper<Detelecine>.GetDisplay((Detelecine)value);
@@ -176,11 +165,6 @@ namespace HandBrakeWPF.Converters
return EnumHelper<VideoEncoder>.GetValue(value.ToString());
}
- if (targetType == typeof(PresetPictureSettingsMode) || value.GetType() == typeof(PresetPictureSettingsMode))
- {
- return EnumHelper<PresetPictureSettingsMode>.GetValue(value.ToString());
- }
-
if (targetType == typeof(Denoise) || value.GetType() == typeof(Denoise))
{
return EnumHelper<Denoise>.GetValue(value.ToString());
diff --git a/win/CS/HandBrakeWPF/Converters/Picture/ResolutionLimitConverter.cs b/win/CS/HandBrakeWPF/Converters/Picture/ResolutionLimitConverter.cs
new file mode 100644
index 000000000..c54296294
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Picture/ResolutionLimitConverter.cs
@@ -0,0 +1,49 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ResolutionLimitConverter.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>
+
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Picture
+{
+ using System;
+ using System.ComponentModel;
+ using System.Globalization;
+ using System.Linq;
+ using System.Windows.Data;
+
+ using HandBrakeWPF.Model.Picture;
+ using HandBrakeWPF.Utilities;
+
+ public class ResolutionLimitConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && value.GetType() == typeof(BindingList<PictureSettingsResLimitModes>))
+ {
+ return
+ new BindingList<string>(
+ EnumHelper<PictureSettingsResLimitModes>.GetEnumDisplayValues(typeof(PictureSettingsResLimitModes)).ToList());
+ }
+
+ if (value != null && value.GetType() == typeof(PictureSettingsResLimitModes))
+ {
+ return EnumHelper<PictureSettingsResLimitModes>.GetDisplay((PictureSettingsResLimitModes)value);
+ }
+
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ string name = value as string;
+ if (!string.IsNullOrEmpty(name))
+ {
+ return EnumHelper<PictureSettingsResLimitModes>.GetValue(name);
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs b/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs
new file mode 100644
index 000000000..877550470
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/Picture/PictureSettingsResLimitModes.cs
@@ -0,0 +1,42 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PictureSettingsResLimitModes.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>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Picture
+{
+ using HandBrake.Interop.Attributes;
+
+ using HandBrakeWPF.Properties;
+
+ public enum PictureSettingsResLimitModes
+ {
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_8K")]
+ [ResLimit(7680, 4320)]
+ Size8K,
+
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_4K")]
+ [ResLimit(3840, 2160)]
+ Size4K,
+
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_1080p")]
+ [ResLimit(1920, 1080)]
+ Size1080p,
+
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_720p")]
+ [ResLimit(1280, 720)]
+ Size720p,
+
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_576p")]
+ [ResLimit(720, 576)]
+ Size576p,
+
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_480p")]
+ [ResLimit(720, 480)]
+ Size480p,
+
+ [DisplayName(typeof(Resources), "PictureSettingsResLimitModes_custom")]
+ Custom,
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs b/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs
index 517da08ee..d4d2845c8 100644
--- a/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs
+++ b/win/CS/HandBrakeWPF/Model/Picture/PresetPictureSettingsMode.cs
@@ -16,7 +16,7 @@ namespace HandBrakeWPF.Model.Picture
/// <summary>
/// Picture Settings Mode when adding presets
/// </summary>
- public enum PresetPictureSettingsMode
+ public enum PresetPictureSettingsMode2
{
[DisplayName(typeof(Resources), "PresetPictureSettingsMode_None")]
None = 0,
diff --git a/win/CS/HandBrakeWPF/Model/Picture/ResLimit.cs b/win/CS/HandBrakeWPF/Model/Picture/ResLimit.cs
new file mode 100644
index 000000000..392b9d7a3
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/Picture/ResLimit.cs
@@ -0,0 +1,23 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ResLimit.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>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Picture
+{
+ using System;
+
+ public class ResLimit : Attribute
+ {
+ public ResLimit(int width, int height)
+ {
+ this.Width = width;
+ this.Height = height;
+ }
+
+ public int Width { get; }
+
+ public int Height { get; }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 0213629cc..77aaed9cb 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -3854,6 +3854,69 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to 1080p HD.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_1080p {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_1080p", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 480p NTSC SD.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_480p {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_480p", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 2160p 4K Ultra HD.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_4K {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_4K", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 576p PAL SD.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_576p {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_576p", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 720p HD.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_720p {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_720p", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 4320p 8K Ultra HD.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_8K {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_8K", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Custom.
+ /// </summary>
+ public static string PictureSettingsResLimitModes_custom {
+ get {
+ return ResourceManager.GetString("PictureSettingsResLimitModes_custom", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Anamorphic:.
/// </summary>
public static string PictureSettingsView_Anamorphic {
@@ -3944,6 +4007,24 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Max Height:.
+ /// </summary>
+ public static string PictureSettingsView_MaxHeight {
+ get {
+ return ResourceManager.GetString("PictureSettingsView_MaxHeight", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Max Width:.
+ /// </summary>
+ public static string PictureSettingsView_MaxWidth {
+ get {
+ return ResourceManager.GetString("PictureSettingsView_MaxWidth", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Modulus:.
/// </summary>
public static string PictureSettingsView_Modulus {
@@ -3998,6 +4079,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Resolution Limit:.
+ /// </summary>
+ public static string PictureSettingsView_ResLimit {
+ get {
+ return ResourceManager.GetString("PictureSettingsView_ResLimit", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Right.
/// </summary>
public static string PictureSettingsView_Right {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index d869657b0..e75028c5b 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -2280,4 +2280,34 @@ Please choose a different preset.</value>
<data name="SummaryView_Forced" xml:space="preserve">
<value>Forced</value>
</data>
+ <data name="PictureSettingsResLimitModes_1080p" xml:space="preserve">
+ <value>1080p HD</value>
+ </data>
+ <data name="PictureSettingsResLimitModes_480p" xml:space="preserve">
+ <value>480p NTSC SD</value>
+ </data>
+ <data name="PictureSettingsResLimitModes_4K" xml:space="preserve">
+ <value>2160p 4K Ultra HD</value>
+ </data>
+ <data name="PictureSettingsResLimitModes_576p" xml:space="preserve">
+ <value>576p PAL SD</value>
+ </data>
+ <data name="PictureSettingsResLimitModes_720p" xml:space="preserve">
+ <value>720p HD</value>
+ </data>
+ <data name="PictureSettingsResLimitModes_8K" xml:space="preserve">
+ <value>4320p 8K Ultra HD</value>
+ </data>
+ <data name="PictureSettingsResLimitModes_custom" xml:space="preserve">
+ <value>Custom</value>
+ </data>
+ <data name="PictureSettingsView_MaxHeight" xml:space="preserve">
+ <value>Max Height:</value>
+ </data>
+ <data name="PictureSettingsView_MaxWidth" xml:space="preserve">
+ <value>Max Width:</value>
+ </data>
+ <data name="PictureSettingsView_ResLimit" xml:space="preserve">
+ <value>Resolution Limit:</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 94c66adb1..c6e35cb96 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
@@ -75,7 +75,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.Task.AlignAVStart = importedPreset.AlignAVStart;
/* Picture Settings */
- preset.PictureSettingsMode = (PresetPictureSettingsMode)importedPreset.UsesPictureSettings;
+ // 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 +544,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 = (int)export.PictureSettingsMode;
preset.Default = export.IsDefault;
// Audio
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
index df21ccf9b..c67298c32 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
@@ -17,64 +17,32 @@ namespace HandBrakeWPF.Services.Presets.Model
using HandBrakeWPF.Services.Presets.Interfaces;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
- using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
- /// <summary>
- /// A Preset for encoding with.
- /// </summary>
- public class Preset : PropertyChangedBase, IPresetObject // Delibery not
+ public class Preset : PropertyChangedBase, IPresetObject
{
- #region Constants and Fields
-
- /// <summary>
- /// The is default.
- /// </summary>
private bool isDefault;
private bool isSelected;
- #endregion
-
- /// <summary>
- /// Initializes a new instance of the <see cref="Preset"/> class.
- /// </summary>
public Preset()
{
}
- /// <summary>
- /// Initializes a new instance of the <see cref="Preset"/> class.
- /// </summary>
- /// <param name="preset">
- /// The preset.
- /// </param>
public Preset(Preset preset)
{
this.Category = preset.Category;
this.Description = preset.Description;
this.IsBuildIn = preset.IsBuildIn;
this.Name = preset.Name;
- this.PictureSettingsMode = preset.PictureSettingsMode;
this.Task = new EncodeTask(preset.Task);
this.AudioTrackBehaviours = new AudioBehaviours(preset.AudioTrackBehaviours);
this.SubtitleTrackBehaviours = new SubtitleBehaviours(preset.SubtitleTrackBehaviours);
}
- #region Properties
-
- /// <summary>
- /// Gets or sets the category which the preset resides under
- /// </summary>
public string Category { get; set; }
- /// <summary>
- /// Gets or sets the Description for the preset
- /// </summary>
public string Description { get; set; }
- /// <summary>
- /// Reflects the visual state of this preset.
- /// </summary>
public bool IsExpanded { get; set; }
public string DisplayValue
@@ -88,10 +56,7 @@ namespace HandBrakeWPF.Services.Presets.Model
public bool IsSelected
{
- get
- {
- return this.isSelected;
- }
+ get => this.isSelected;
set
{
this.isSelected = value;
@@ -99,14 +64,8 @@ namespace HandBrakeWPF.Services.Presets.Model
}
}
- /// <summary>
- /// Gets or sets a value indicating whether this is a built in preset
- /// </summary>
public bool IsBuildIn { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether IsDefault.
- /// </summary>
public bool IsDefault
{
get
@@ -120,125 +79,53 @@ namespace HandBrakeWPF.Services.Presets.Model
}
}
- /// <summary>
- /// Gets or sets the preset name
- /// </summary>
public string Name { get; set; }
- /// <summary>
- /// Gets or sets PictureSettingsMode.
- /// Source Maximum, Custom or None
- /// </summary>
- public PresetPictureSettingsMode PictureSettingsMode { get; set; }
-
- /// <summary>
- /// Gets or sets task.
- /// </summary>
public EncodeTask Task { get; set; }
- /// <summary>
- /// Gets or sets the audio track behaviours.
- /// </summary>
public AudioBehaviours AudioTrackBehaviours { get; set; }
- /// <summary>
- /// Gets or sets the subtitle track behaviours.
- /// </summary>
public SubtitleBehaviours SubtitleTrackBehaviours { get; set; }
public bool IsPresetDisabled { get; set; }
- #endregion
-
- #region Public Methods
-
- /// <summary>
- /// Update this preset.
- /// The given parameters should be copy-constructed.
- /// </summary>
- /// <param name="task">
- /// The task.
- /// </param>
- /// <param name="audioBehaviours">
- /// The audio behaviours.
- /// </param>
- /// <param name="subtitleBehaviours">
- /// The subtitle behaviours.
- /// </param>
public void Update(EncodeTask task, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours)
{
- // Copy over Max Width / Height for the following picture settings modes.
- if (this.PictureSettingsMode == PresetPictureSettingsMode.Custom
- || this.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
- {
- task.MaxWidth = this.Task.MaxWidth;
- task.MaxHeight = this.Task.MaxHeight;
- }
-
this.Task = task;
this.AudioTrackBehaviours = new AudioBehaviours(audioBehaviours);
this.SubtitleTrackBehaviours = new SubtitleBehaviours(subtitleBehaviours);
}
- /// <summary>
- /// Override the ToString Method
- /// </summary>
- /// <returns>
- /// The Preset Name
- /// </returns>
public override string ToString()
{
return this.Name;
}
- #endregion
-
- /// <summary>
- /// The equals.
- /// </summary>
- /// <param name="obj">
- /// The obj.
- /// </param>
- /// <returns>
- /// The <see cref="bool"/>.
- /// </returns>
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}
+
if (ReferenceEquals(this, obj))
{
return true;
}
+
if (obj.GetType() != this.GetType())
{
return false;
}
+
return Equals((Preset)obj);
}
- /// <summary>
- /// The get hash code.
- /// </summary>
- /// <returns>
- /// The <see cref="int"/>.
- /// </returns>
public override int GetHashCode()
{
return (this.Name != null ? this.Name.GetHashCode() : 0);
}
- /// <summary>
- /// The equals.
- /// </summary>
- /// <param name="other">
- /// The other.
- /// </param>
- /// <returns>
- /// The <see cref="bool"/>.
- /// </returns>
protected bool Equals(Preset other)
{
return string.Equals(this.Name, other.Name);
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
index 9ee511ca8..c34ca617f 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
@@ -14,11 +14,9 @@ namespace HandBrakeWPF.Services.Presets
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
- using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows;
- using System.Windows.Documents;
using HandBrake.Interop.Interop;
using HandBrake.Interop.Interop.Json.Presets;
@@ -28,11 +26,9 @@ namespace HandBrakeWPF.Services.Presets
using HandBrake.Interop.Utilities;
using HandBrakeWPF.Factories;
- using HandBrakeWPF.Model.Picture;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Encode.Model.Models;
using HandBrakeWPF.Services.Interfaces;
- using HandBrakeWPF.Services.Logging;
using HandBrakeWPF.Services.Logging.Interfaces;
using HandBrakeWPF.Services.Presets.Factories;
using HandBrakeWPF.Services.Presets.Interfaces;
@@ -44,9 +40,6 @@ namespace HandBrakeWPF.Services.Presets
using GeneralApplicationException = HandBrakeWPF.Exceptions.GeneralApplicationException;
using SystemInfo = HandBrake.Interop.Utilities.SystemInfo;
- /// <summary>
- /// The preset service manages HandBrake's presets
- /// </summary>
public class PresetService : IPresetService
{
public const int ForcePresetReset = 3;
@@ -66,9 +59,6 @@ namespace HandBrakeWPF.Services.Presets
this.userSettingService = userSettingService;
}
- /// <summary>
- /// Gets a Collection of presets.
- /// </summary>
public ObservableCollection<IPresetObject> Presets
{
get
@@ -77,9 +67,6 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// Gets the DefaultPreset.
- /// </summary>
public Preset DefaultPreset
{
get
@@ -88,9 +75,6 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// The load.
- /// </summary>
public void Load()
{
// Load the presets from file
@@ -102,20 +86,6 @@ namespace HandBrakeWPF.Services.Presets
return this.Add(preset, false);
}
- /// <summary>
- /// Add a new preset to the system.
- /// Performs an Update if it already exists
- /// </summary>
- /// <param name="preset">
- /// A Preset to add
- /// </param>
- /// <param name="isLoading">
- /// Prevents Saving of presets.
- /// </param>
- /// <returns>
- /// True if added,
- /// False if name already exists
- /// </returns>
public bool Add(Preset preset, bool isLoading)
{
if (!this.CheckIfPresetExists(preset.Name))
@@ -155,12 +125,6 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// The import.
- /// </summary>
- /// <param name="filename">
- /// The filename.
- /// </param>
public void Import(string filename)
{
if (!string.IsNullOrEmpty(filename))
@@ -236,18 +200,6 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// The export.
- /// </summary>
- /// <param name="filename">
- /// The filename.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="configuration">
- /// The configuration.
- /// </param>
public void Export(string filename, Preset preset, HBConfiguration configuration)
{
// TODO Add support for multiple export
@@ -255,19 +207,12 @@ namespace HandBrakeWPF.Services.Presets
HandBrakePresetService.ExportPreset(filename, container);
}
- /// <summary>
- /// Update a preset
- /// </summary>
- /// <param name="update">
- /// The updated preset
- /// </param>
public void Update(Preset update)
{
Preset preset;
if (this.flatPresetDict.TryGetValue(update.Name, out preset))
{
preset.Task = update.Task;
- preset.PictureSettingsMode = update.PictureSettingsMode;
preset.Category = update.Category;
preset.Description = update.Description;
preset.AudioTrackBehaviours = update.AudioTrackBehaviours;
@@ -278,28 +223,12 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// Replace an existing preset with a modified one.
- /// </summary>
- /// <param name="existing">
- /// The existing.
- /// </param>
- /// <param name="replacement">
- /// The replacement.
- /// </param>
public void Replace(Preset existing, Preset replacement)
{
this.Remove(existing);
this.Add(replacement, false);
}
- /// <summary>
- /// Remove a preset with a given name from either the built in or user preset list.
- /// </summary>
- /// <param name="preset">
- /// The Preset to remove
- /// </param>
- /// <returns>True if successfully removed, false otherwise.</returns>
public bool Remove(Preset preset)
{
if (preset == null || preset.IsDefault)
@@ -331,12 +260,6 @@ namespace HandBrakeWPF.Services.Presets
return true;
}
- /// <summary>
- /// Remove a group of presets by category
- /// </summary>
- /// <param name="categoryName">
- /// The Category to remove
- /// </param>
public void RemoveGroup(string categoryName)
{
PresetDisplayCategory category = this.presets.FirstOrDefault(p => p.Category == categoryName) as PresetDisplayCategory;
@@ -365,12 +288,6 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// Set Default Preset
- /// </summary>
- /// <param name="preset">
- /// The name.
- /// </param>
public void SetDefault(Preset preset)
{
// Set IsDefault false for everything.
@@ -385,15 +302,6 @@ namespace HandBrakeWPF.Services.Presets
this.SavePresetFiles();
}
- /// <summary>
- /// Get a Preset
- /// </summary>
- /// <param name="name">
- /// The name of the preset to get
- /// </param>
- /// <returns>
- /// A Preset or null object
- /// </returns>
public Preset GetPreset(string name)
{
Preset preset;
@@ -405,9 +313,6 @@ namespace HandBrakeWPF.Services.Presets
return null;
}
- /// <summary>
- /// Clear Built-in Presets
- /// </summary>
public void ClearBuiltIn()
{
List<IPresetObject> topLevel = new List<IPresetObject>();
@@ -463,18 +368,12 @@ namespace HandBrakeWPF.Services.Presets
}
}
- /// <summary>
- /// Clear all presets
- /// </summary>
public void ClearAll()
{
this.presets.Clear();
this.flatPresetList.Clear();
}
- /// <summary>
- /// Reads the CLI's CLI output format and load's them into the preset List Preset
- /// </summary>
public void UpdateBuiltInPresets()
{
// Clear the current built in Presets and now parse the temporary Presets file.
@@ -507,15 +406,6 @@ namespace HandBrakeWPF.Services.Presets
this.SavePresetFiles();
}
- /// <summary>
- /// Check if the preset "name" exists in either Presets or UserPresets lists.
- /// </summary>
- /// <param name="name">
- /// Name of the preset
- /// </param>
- /// <returns>
- /// True if found
- /// </returns>
public bool CheckIfPresetExists(string name)
{
if (this.flatPresetDict.ContainsKey(name))
@@ -526,15 +416,6 @@ namespace HandBrakeWPF.Services.Presets
return false;
}
- /// <summary>
- /// Returns a value if the preset can be updated / resaved
- /// </summary>
- /// <param name="name">
- /// The name.
- /// </param>
- /// <returns>
- /// True if it's not a built-in preset, false otherwise.
- /// </returns>
public bool CanUpdatePreset(string name)
{
Preset preset;
@@ -546,10 +427,6 @@ namespace HandBrakeWPF.Services.Presets
return true;
}
- /// <summary>
- /// Set the selected preset
- /// </summary>
- /// <param name="selectedPreset">The preset we want to select.</param>
public void SetSelected(Preset selectedPreset)
{
foreach (var item in this.flatPresetList)
@@ -614,18 +491,6 @@ namespace HandBrakeWPF.Services.Presets
return categoriesList;
}
- /// <summary>
- /// Archive the presets file without deleting it.
- /// </summary>
- /// <param name="file">
- /// The filename to archive
- /// </param>
- /// <param name="delete">
- /// True will delete the current presets file.
- /// </param>
- /// <returns>
- /// The archived filename
- /// </returns>
private string ArchivePresetFile(string file, bool delete)
{
try
@@ -661,9 +526,6 @@ namespace HandBrakeWPF.Services.Presets
return "Sorry, the archiving failed.";
}
- /// <summary>
- /// Load in the Built-in and User presets into the collection
- /// </summary>
private void LoadPresets()
{
// First clear the Presets arraylists
@@ -758,13 +620,6 @@ namespace HandBrakeWPF.Services.Presets
preset.IsBuildIn = hbpreset.Type == 0;
preset.IsPresetDisabled = this.IsPresetDisabled(preset);
- // IF we are using Source Max, Set the Max Width / Height values.
- if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
- {
- preset.Task.MaxWidth = preset.Task.Height;
- preset.Task.MaxHeight = preset.Task.Width;
- }
-
this.Add(preset, true);
}
}
@@ -779,21 +634,11 @@ namespace HandBrakeWPF.Services.Presets
preset.IsBuildIn = hbPreset.Type == 1;
preset.IsPresetDisabled = this.IsPresetDisabled(preset);
- // IF we are using Source Max, Set the Max Width / Height values.
- if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
- {
- preset.Task.MaxWidth = preset.Task.Height;
- preset.Task.MaxHeight = preset.Task.Width;
- }
-
this.Add(preset, true);
}
}
}
- /// <summary>
- /// Update the preset files
- /// </summary>
private void SavePresetFiles()
{
try
@@ -870,18 +715,9 @@ namespace HandBrakeWPF.Services.Presets
private Preset ConvertHbPreset(HBPreset hbPreset)
{
- Preset preset = null;
-
- preset = JsonPresetFactory.ImportPreset(hbPreset);
+ Preset preset = JsonPresetFactory.ImportPreset(hbPreset);
preset.Category = UserPresetCatgoryName; // TODO can we get this from the preset?
- // IF we are using Source Max, Set the Max Width / Height values.
- if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
- {
- preset.Task.MaxWidth = preset.Task.Height;
- preset.Task.MaxHeight = preset.Task.Width;
- }
-
return preset;
}
diff --git a/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs b/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs
index ef8583917..fd19a1cf0 100644
--- a/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs
+++ b/win/CS/HandBrakeWPF/Utilities/EnumHelper.cs
@@ -143,6 +143,23 @@ namespace HandBrakeWPF.Utilities
return string.Empty;
}
+ public static T GetAttribute<T, TK>(TK value) where T : Attribute
+ {
+ if (value == null)
+ {
+ return null;
+ }
+
+ FieldInfo fieldInfo = value.GetType().GetField(value.ToString());
+ if (fieldInfo != null)
+ {
+ T[] attributes = (T[])fieldInfo.GetCustomAttributes(typeof(T), false);
+ return (attributes.Length > 0) ? attributes[0] : null;
+ }
+
+ return null;
+ }
+
/// <summary>
/// Return a list of all the enum values.
/// </summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
index d2c5f9452..e7a9235fc 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
@@ -15,8 +15,6 @@ namespace HandBrakeWPF.ViewModels
using Caliburn.Micro;
- using HandBrake.Interop.Interop.Model.Encoding;
-
using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Model.Subtitles;
using HandBrakeWPF.Properties;
@@ -25,12 +23,10 @@ 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;
- using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
/// <summary>
/// The Add Preset View Model
@@ -40,15 +36,14 @@ namespace HandBrakeWPF.ViewModels
private readonly IPresetService presetService;
private readonly IErrorService errorService;
private readonly IWindowManager windowManager;
- private PresetPictureSettingsMode selectedPictureSettingMode;
+ private readonly PresetDisplayCategory addNewCategory = new PresetDisplayCategory(Resources.AddPresetView_AddNewCategory, true, null);
+
private bool showCustomInputs;
- private Title selectedTitle;
private IAudioDefaultsViewModel audioDefaultsViewModel;
private ISubtitlesDefaultsViewModel subtitlesDefaultsViewModel;
private PresetDisplayCategory selectedPresetCategory;
- private readonly PresetDisplayCategory addNewCategory = new PresetDisplayCategory(Resources.AddPresetView_AddNewCategory, true, null);
private bool canAddNewPresetCategory;
/// <summary>
@@ -70,40 +65,15 @@ namespace HandBrakeWPF.ViewModels
this.windowManager = windowManager;
this.Title = Resources.AddPresetView_AddPreset;
this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName };
- this.PictureSettingsModes = EnumHelper<PresetPictureSettingsMode>.GetEnumList();
this.PresetCategories = presetService.GetPresetCategories(true).Union(new List<PresetDisplayCategory> { addNewCategory }).ToList();
this.SelectedPresetCategory = this.PresetCategories.FirstOrDefault(n => n.Category == PresetService.UserPresetCatgoryName);
}
- /// <summary>
- /// Gets the Preset
- /// </summary>
- public Preset Preset { get; private set; }
-
- /// <summary>
- /// Gets or sets PictureSettingsModes.
- /// </summary>
- public IEnumerable<PresetPictureSettingsMode> PictureSettingsModes { get; set; }
-
- /// <summary>
- /// Gets or sets CustomWidth.
- /// </summary>
- public int? CustomWidth { get; set; }
+ public Preset Preset { get; }
- /// <summary>
- /// Gets or sets CustomHeight.
- /// </summary>
- public int? CustomHeight { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether ShowCustomInputs.
- /// </summary>
public bool ShowCustomInputs
{
- get
- {
- return this.showCustomInputs;
- }
+ get => this.showCustomInputs;
set
{
this.showCustomInputs = value;
@@ -115,10 +85,7 @@ namespace HandBrakeWPF.ViewModels
public PresetDisplayCategory SelectedPresetCategory
{
- get
- {
- return this.selectedPresetCategory;
- }
+ get => this.selectedPresetCategory;
set
{
this.selectedPresetCategory = value;
@@ -138,10 +105,7 @@ namespace HandBrakeWPF.ViewModels
public string PresetCategory
{
- get
- {
- return this.Preset.Category;
- }
+ get => this.Preset.Category;
set
{
this.Preset.Category = value;
@@ -151,49 +115,19 @@ namespace HandBrakeWPF.ViewModels
public bool CanAddNewPresetCategory
{
- get
- {
- return this.canAddNewPresetCategory;
- }
+ get => this.canAddNewPresetCategory;
set
{
- if (value == this.canAddNewPresetCategory) return;
+ if (value == this.canAddNewPresetCategory)
+ {
+ return;
+ }
+
this.canAddNewPresetCategory = value;
this.NotifyOfPropertyChange();
}
}
- /// <summary>
- /// Gets or sets SelectedPictureSettingMode.
- /// </summary>
- public PresetPictureSettingsMode SelectedPictureSettingMode
- {
- get
- {
- return this.selectedPictureSettingMode;
- }
- set
- {
- this.selectedPictureSettingMode = value;
- this.ShowCustomInputs = value == PresetPictureSettingsMode.Custom;
- }
- }
-
- /// <summary>
- /// Prepare the Preset window to create a Preset Object later.
- /// </summary>
- /// <param name="task">
- /// The Encode Task.
- /// </param>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="audioBehaviours">
- /// The audio Behaviours.
- /// </param>
- /// <param name="subtitleBehaviours">
- /// The subtitle Behaviours.
- /// </param>
public void Setup(EncodeTask task, Title title, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours)
{
this.Preset.Task = new EncodeTask(task);
@@ -205,28 +139,8 @@ namespace HandBrakeWPF.ViewModels
this.subtitlesDefaultsViewModel = new SubtitlesDefaultsViewModel();
this.subtitlesDefaultsViewModel.SetupLanguages(subtitleBehaviours);
-
- this.selectedTitle = title;
-
- switch (task.Anamorphic)
- {
- default:
- this.SelectedPictureSettingMode = PresetPictureSettingsMode.Custom;
- if (title != null && title.Resolution != null)
- {
- this.CustomWidth = title.Resolution.Width;
- this.CustomHeight = title.Resolution.Height;
- }
- break;
- case Anamorphic.Automatic:
- this.SelectedPictureSettingMode = PresetPictureSettingsMode.SourceMaximum;
- break;
- }
}
- /// <summary>
- /// Add a Preset
- /// </summary>
public void Add()
{
if (string.IsNullOrEmpty(this.Preset.Name))
@@ -250,42 +164,7 @@ namespace HandBrakeWPF.ViewModels
return;
}
}
-
- if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.SourceMaximum && this.selectedTitle == null)
- {
- this.errorService.ShowMessageBox(Resources.AddPresetViewModel_YouMustFirstScanSource, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
- return;
- }
-
- if (this.CustomWidth == null && this.CustomHeight == null && this.SelectedPictureSettingMode == PresetPictureSettingsMode.Custom)
- {
- this.errorService.ShowMessageBox(Resources.AddPresetViewModel_CustomWidthHeightFieldsRequired, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
- return;
- }
-
- this.Preset.PictureSettingsMode = this.SelectedPictureSettingMode;
-
- // Setting W, H, MW and MH
- if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.None)
- {
- this.Preset.Task.MaxHeight = null;
- this.Preset.Task.MaxWidth = null;
- }
-
- if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.Custom)
- {
- this.Preset.Task.MaxWidth = this.CustomWidth;
- this.Preset.Task.MaxHeight = this.CustomHeight;
- this.Preset.Task.Width = null;
- this.Preset.Task.Height = null;
- }
-
- if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.SourceMaximum)
- {
- this.Preset.Task.MaxHeight = null;
- this.Preset.Task.MaxWidth = null;
- }
-
+
// Add the Preset
bool added = this.presetService.Add(this.Preset);
if (!added)
@@ -308,7 +187,7 @@ namespace HandBrakeWPF.ViewModels
public void EditAudioDefaults()
{
this.audioDefaultsViewModel.ResetApplied();
- bool? result = this.windowManager.ShowDialog(this.audioDefaultsViewModel);
+ this.windowManager.ShowDialog(this.audioDefaultsViewModel);
if (audioDefaultsViewModel.IsApplied)
{
this.Preset.AudioTrackBehaviours = this.audioDefaultsViewModel.AudioBehaviours.Clone();
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index b6a1705d5..925d3e269 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -11,6 +11,7 @@ namespace HandBrakeWPF.ViewModels
{
using System;
using System.Collections.Generic;
+ using System.ComponentModel;
using System.Globalization;
using HandBrake.Interop.Interop;
@@ -19,6 +20,7 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.EventArgs;
using HandBrakeWPF.Helpers;
+ using HandBrakeWPF.Model.Picture;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Services.Scan.Model;
@@ -27,7 +29,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.ViewModels.Interfaces;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
- using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
public class PictureSettingsViewModel : ViewModelBase, IPictureSettingsViewModel
{
@@ -48,6 +49,8 @@ namespace HandBrakeWPF.ViewModels
private Title currentTitle;
private Source scannedSource;
+ private PictureSettingsResLimitModes selectedPictureSettingsResLimitMode;
+
public PictureSettingsViewModel(IStaticPreviewViewModel staticPreviewViewModel)
{
this.StaticPreviewViewModel = staticPreviewViewModel;
@@ -156,6 +159,7 @@ namespace HandBrakeWPF.ViewModels
{
this.maxHeight = value;
this.NotifyOfPropertyChange(() => this.MaxHeight);
+ this.SetSelectedPictureSettingsResLimitMode();
}
}
@@ -166,6 +170,7 @@ namespace HandBrakeWPF.ViewModels
{
this.maxWidth = value;
this.NotifyOfPropertyChange(() => this.MaxWidth);
+ this.SetSelectedPictureSettingsResLimitMode();
}
}
@@ -179,6 +184,57 @@ namespace HandBrakeWPF.ViewModels
}
}
+ public BindingList<PictureSettingsResLimitModes> ResolutionLimitModes => new BindingList<PictureSettingsResLimitModes>
+ {
+ 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.maxWidth = limit.Width;
+ this.maxHeight = limit.Height;
+ this.NotifyOfPropertyChange(() => this.MaxWidth);
+ this.NotifyOfPropertyChange(() => this.Height);
+
+ if (this.Width > this.MaxWidth)
+ {
+ this.Width = this.MaxWidth;
+ }
+
+ if (this.Height > this.MaxWidth)
+ {
+ this.Height = this.MaxHeight;
+ }
+ }
+ }
+ }
+
+ public bool IsCustomMaxRes { get; private set; }
+
/* Task Properties */
public int CropBottom
@@ -370,12 +426,6 @@ namespace HandBrakeWPF.ViewModels
{
this.Task = task;
- // Handle built-in presets.
- if (preset.IsBuildIn)
- {
- preset.PictureSettingsMode = PresetPictureSettingsMode.Custom;
- }
-
// Cropping
if (preset.Task.HasCropping)
{
@@ -395,75 +445,41 @@ namespace HandBrakeWPF.ViewModels
this.IsCustomCrop = false;
}
- // Padding
+ // Padding and Rotate Filters
this.PaddingFilter.SetPreset(preset, task);
this.RotateFlipFilter?.SetPreset(preset, task);
-
- // Setup the Picture Sizes
- switch (preset.PictureSettingsMode)
- {
- default:
- case PresetPictureSettingsMode.Custom:
- case PresetPictureSettingsMode.SourceMaximum:
- // Anamorphic Mode
- this.SelectedAnamorphicMode = preset.Task.Anamorphic;
-
- // Modulus
- if (preset.Task.Modulus.HasValue)
- {
- this.SelectedModulus = preset.Task.Modulus;
- }
-
- // Set the Maintain Aspect ratio.
- this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;
-
- // Set the Maximum so libhb can correctly manage the size.
- if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
- {
- this.MaxWidth = this.sourceResolution.Width;
- this.MaxHeight = this.sourceResolution.Height;
- }
- else
- {
- int presetWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;
- int presetHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;
+ // Picture Sizes and Anamorphic
+ this.SelectedAnamorphicMode = preset.Task.Anamorphic;
- this.MaxWidth = presetWidth <= this.sourceResolution.Width ? presetWidth : this.sourceResolution.Width;
- this.MaxHeight = presetHeight <= this.sourceResolution.Height ? presetHeight : this.sourceResolution.Height;
- }
+ // Modulus
+ if (preset.Task.Modulus.HasValue)
+ {
+ this.SelectedModulus = preset.Task.Modulus;
+ }
- // 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));
- int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), this.MaxHeight));
+ // Set the Maintain Aspect ratio.
+ this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;
- // Set the backing fields to avoid triggering recalulation until both are set.
- this.Task.Width = width;
- this.Task.Height = height;
+ // Setup the Maximum Width / Height with sane 4K fallback.
+ this.MaxWidth = preset.Task.MaxWidth ?? 3840;
+ this.MaxHeight = preset.Task.MaxHeight ?? 2160;
- // Trigger a Recalc
- this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);
+ // 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));
+ int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), this.MaxHeight));
- // Update the UI
- this.NotifyOfPropertyChange(() => this.Width);
- this.NotifyOfPropertyChange(() => this.Height);
+ // Set the backing fields to avoid triggering re-calculation until both are set.
+ this.Task.Width = width;
+ this.Task.Height = height;
- break;
- case PresetPictureSettingsMode.None:
- // Do Nothing except reset the Max Width/Height
- this.MaxWidth = this.sourceResolution.Width;
- this.MaxHeight = this.sourceResolution.Height;
- this.SelectedAnamorphicMode = preset.Task.Anamorphic;
+ // Trigger a calculation
+ this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);
- if (this.Width > this.MaxWidth)
- {
- // Trigger a Recalc
- this.Task.Width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth));
- this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);
- }
+ // Update the UI
+ this.NotifyOfPropertyChange(() => this.Width);
+ this.NotifyOfPropertyChange(() => this.Height);
- break;
- }
// Custom Anamorphic
if (preset.Task.Anamorphic == Anamorphic.Custom)
@@ -534,43 +550,15 @@ namespace HandBrakeWPF.ViewModels
this.IsCustomCrop = true;
}
- // Set the Max Width / Height available to the user controls.
- // Preset Max is null for None / SourceMax
- this.MaxWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;
- if (this.sourceResolution.Width < this.MaxWidth)
- {
- this.MaxWidth = this.sourceResolution.Width;
- }
-
- this.MaxHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;
- if (this.sourceResolution.Height < this.MaxHeight)
- {
- this.MaxHeight = this.sourceResolution.Height;
- }
+ // Setup the Maximum Width / Height with sane 4K fallback.
+ this.MaxWidth = preset.Task.MaxWidth ?? 3840;
+ this.MaxHeight = preset.Task.MaxHeight ?? 2160;
// Set the W/H
- if (preset.PictureSettingsMode == PresetPictureSettingsMode.None)
- {
- this.Task.Width = this.GetModulusValue(this.sourceResolution.Width - this.CropLeft - this.CropRight);
- this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);
- }
- else if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
- {
- this.Task.Width = this.GetModulusValue(this.sourceResolution.Width - this.CropLeft - this.CropRight);
- this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);
- this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;
- }
- else
- {
- // Custom
- // Set the Width, and Maintain Aspect ratio. That should calc the Height for us.
- this.Task.Width = this.GetModulusValue(this.sourceResolution.Width - this.CropLeft - this.CropRight);
-
- if (this.SelectedAnamorphicMode != Anamorphic.Loose)
- {
- this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);
- }
- }
+ // Set the width, then check the height doesn't breach the max height and correct if necessary.
+ this.Task.Width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth));
+ this.Task.Height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), this.MaxHeight));
+ this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;
// Set Screen Controls
this.SourceInfo = string.Format(
@@ -627,9 +615,9 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedModulus);
this.NotifyOfPropertyChange(() => this.MaintainAspectRatio);
- // Default the Max Width / Height to 1080p format
- this.MaxHeight = 1080;
- this.MaxWidth = 1920;
+ // Default the Max Width / Height to 4K format
+ this.MaxHeight = 2160;
+ this.MaxWidth = 3480;
}
private PictureSize.PictureSettingsTitle GetPictureTitleInfo()
@@ -834,6 +822,23 @@ namespace HandBrakeWPF.ViewModels
{
return max.HasValue ? (value > max.Value ? max.Value : value) : value;
}
+
+ 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.MaxWidth && resLimit.Height == this.MaxHeight)
+ {
+ this.SelectedPictureSettingsResLimitMode = limit;
+ return;
+ }
+ }
+ }
+ }
}
public enum ChangedPictureField
diff --git a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
index acfe9168c..2dd2b0c6d 100644
--- a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
@@ -84,7 +84,7 @@
<!-- Settings -->
- <TextBlock Grid.Row="4" Margin="0,10,10,0"
+ <!--<TextBlock Grid.Row="4" Margin="0,10,10,0"
Grid.Column="0"
Style="{StaticResource LongToolTipHolder}"
VerticalAlignment="Center"
@@ -113,7 +113,7 @@
Text="X" />
<controls:NumberBox Width="60" Number="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="0,0,0,5"
AllowEmpty="True" />
- </StackPanel>
+ </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"
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
index 3c1a71296..9b7eccaaf 100644
--- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
@@ -3,12 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
- xmlns:Properties="clr-namespace:HandBrakeWPF.Properties">
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ xmlns:picture="clr-namespace:HandBrakeWPF.Converters.Picture">
<UserControl.Resources>
<Converters:BooleanConverter x:Key="boolConverter" />
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
<Converters:BooleanToHiddenVisibilityConverter x:Key="boolToVisHiddenConverter" />
+ <picture:ResolutionLimitConverter x:Key="resolutionLimitConverter" />
<Style TargetType="controls:NumberBox">
<Setter Property="Height" Value="24" />
</Style>
@@ -47,6 +49,12 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@@ -56,80 +64,76 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Width}" Grid.Row="0" Grid.Column="0" />
- <controls:NumberBox Number="{Binding Width, Mode=TwoWay}" UpdateBindingOnTextChange="True" IsEnabled="{Binding WidthControlEnabled}" Grid.Row="0" Grid.Column="1"
- Modulus="{Binding SelectedModulus, Mode=OneWay}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Width}" Minimum="0" Width="60"
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_ResLimit}" Grid.Row="0" Grid.Column="0" />
+ <ComboBox ItemsSource="{Binding ResolutionLimitModes, Converter={StaticResource resolutionLimitConverter}}"
+ SelectedItem="{Binding SelectedPictureSettingsResLimitMode, Converter={StaticResource resolutionLimitConverter}}"
+ Width="150" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" Grid.ColumnSpan="3"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_ResLimit}" />
+
+
+ <!-- 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"
+ 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"
+ Modulus="{Binding SelectedModulus, Mode=OneWay}"
+ Minimum="0" Width="60"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_MaxHeight}" Visibility="{Binding IsCustomMaxRes, Converter={StaticResource boolToVisConverter}}" />
+
+ <!-- Width and Height -->
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Width}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" />
+ <controls:NumberBox Number="{Binding Width, Mode=TwoWay}" UpdateBindingOnTextChange="True" IsEnabled="{Binding WidthControlEnabled}" Grid.Row="2" Grid.Column="1"
+ Modulus="{Binding SelectedModulus, Mode=OneWay}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Width}" Minimum="0" Width="60" Margin="0,5,0,0"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Width}" />
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Height}" Grid.Row="0" Grid.Column="2" />
- <controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" UpdateBindingOnTextChange="True" Grid.Row="0" Grid.Column="3"
- Modulus="{Binding SelectedModulus, Mode=OneWay}"
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Height}" Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" />
+ <controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" UpdateBindingOnTextChange="True" Grid.Row="2" Grid.Column="3"
+ Modulus="{Binding SelectedModulus, Mode=OneWay}" Margin="0,5,0,0"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Height}" Minimum="0" Width="60"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Height}" />
- <CheckBox Content="{x:Static Properties:Resources.PictureSettingsView_KeepAR}" IsChecked="{Binding MaintainAspectRatio}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="4"
- Visibility="{Binding ShowKeepAR, Converter={StaticResource boolToVisHiddenConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_KeepAR}"
- VerticalAlignment="Center" Margin="0,5,0,0" />
-
- </Grid>
-
- <!-- Row 3-->
- <Grid Margin="0,15,5,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" Grid.Row="0" Grid.Column="0" />
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Modulus}" Grid.Row="1" Grid.Column="0"
- Visibility="{Binding ShowModulus, Converter={StaticResource boolToVisConverter}}" />
-
- <ComboBox Width="110" Grid.Row="0" ItemsSource="{Binding AnamorphicModes}" SelectedItem="{Binding SelectedAnamorphicMode}" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
- ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Anamorphic}"
- AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" />
- <ComboBox Width="110" Grid.Row="1" ItemsSource="{Binding ModulusValues}" SelectedItem="{Binding SelectedModulus}"
- Visibility="{Binding ShowModulus, Converter={StaticResource boolToVisConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Modulus}"
- Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
- AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Modulus}"/>
- </Grid>
-
- <!-- Custom Anamoprhic -->
- <Grid Margin="0,15,5,0" Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}" Grid.Row="0" Grid.Column="0" />
- <Label Content="{x:Static Properties:Resources.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" IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}"
- AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}" />
- <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
+ <CheckBox Content="{x:Static Properties:Resources.PictureSettingsView_KeepAR}" IsChecked="{Binding MaintainAspectRatio}" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3"
+ Visibility="{Binding ShowKeepAR, Converter={StaticResource boolToVisHiddenConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_KeepAR}"
+ VerticalAlignment="Center" Margin="0,5,0,10" />
+
+
+ <!-- Anamorphic -->
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" />
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Modulus}" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" Visibility="{Binding ShowModulus, Converter={StaticResource boolToVisConverter}}" />
+
+ <ComboBox Width="110" Grid.Row="4" ItemsSource="{Binding AnamorphicModes}" SelectedItem="{Binding SelectedAnamorphicMode}" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" Grid.ColumnSpan="3"
+ ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Anamorphic}"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" />
+ <ComboBox Width="110" Grid.Row="5" ItemsSource="{Binding ModulusValues}" SelectedItem="{Binding SelectedModulus}" Grid.ColumnSpan="3"
+ Visibility="{Binding ShowModulus, Converter={StaticResource boolToVisConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Modulus}"
+ Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Modulus}"/>
+
+ <!-- Custom Anamorphic -->
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center" Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}"/>
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_PAR}" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center" Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}" />
+
+ <controls:NumberBox Width="60" Number="{Binding DisplayWidth, Mode=TwoWay}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
+ AllowEmpty="False" IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}"
+ AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}"
+ Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}" />
+ <StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}">
<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}"/>
+ 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}"/>
+ IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
+ ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
</StackPanel>
- </Grid>
+ </Grid>
</StackPanel>
- <!-- Crop Panel -->
+ <!-- Crop Panel -->
<TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_RotateAndCrop}" FontSize="12" FontWeight="Bold" Grid.Row="0" Grid.Column="1" Margin="50,5,0,15" />
<Grid Name="CropPanel" Margin="50,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="1">
<Grid.ColumnDefinitions>