From d97eb4f9a23dd8dd6019b0d3e2121294d8bb7dea Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 26 Jun 2020 21:30:37 +0100 Subject: 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 --- .../HandBrakeWPF/Services/Presets/Model/Preset.cs | 123 +-------------------- 1 file changed, 5 insertions(+), 118 deletions(-) (limited to 'win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs') 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; - /// - /// A Preset for encoding with. - /// - public class Preset : PropertyChangedBase, IPresetObject // Delibery not + public class Preset : PropertyChangedBase, IPresetObject { - #region Constants and Fields - - /// - /// The is default. - /// private bool isDefault; private bool isSelected; - #endregion - - /// - /// Initializes a new instance of the class. - /// public Preset() { } - /// - /// Initializes a new instance of the class. - /// - /// - /// The preset. - /// 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 - - /// - /// Gets or sets the category which the preset resides under - /// public string Category { get; set; } - /// - /// Gets or sets the Description for the preset - /// public string Description { get; set; } - /// - /// Reflects the visual state of this preset. - /// 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 } } - /// - /// Gets or sets a value indicating whether this is a built in preset - /// public bool IsBuildIn { get; set; } - /// - /// Gets or sets a value indicating whether IsDefault. - /// public bool IsDefault { get @@ -120,125 +79,53 @@ namespace HandBrakeWPF.Services.Presets.Model } } - /// - /// Gets or sets the preset name - /// public string Name { get; set; } - /// - /// Gets or sets PictureSettingsMode. - /// Source Maximum, Custom or None - /// - public PresetPictureSettingsMode PictureSettingsMode { get; set; } - - /// - /// Gets or sets task. - /// public EncodeTask Task { get; set; } - /// - /// Gets or sets the audio track behaviours. - /// public AudioBehaviours AudioTrackBehaviours { get; set; } - /// - /// Gets or sets the subtitle track behaviours. - /// public SubtitleBehaviours SubtitleTrackBehaviours { get; set; } public bool IsPresetDisabled { get; set; } - #endregion - - #region Public Methods - - /// - /// Update this preset. - /// The given parameters should be copy-constructed. - /// - /// - /// The task. - /// - /// - /// The audio behaviours. - /// - /// - /// The subtitle behaviours. - /// 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); } - /// - /// Override the ToString Method - /// - /// - /// The Preset Name - /// public override string ToString() { return this.Name; } - #endregion - - /// - /// The equals. - /// - /// - /// The obj. - /// - /// - /// The . - /// 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); } - /// - /// The get hash code. - /// - /// - /// The . - /// public override int GetHashCode() { return (this.Name != null ? this.Name.GetHashCode() : 0); } - /// - /// The equals. - /// - /// - /// The other. - /// - /// - /// The . - /// protected bool Equals(Preset other) { return string.Equals(this.Name, other.Name); -- cgit v1.2.3