summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-07-25 20:29:44 +0100
committersr55 <[email protected]>2016-07-25 20:29:44 +0100
commit96e2f705a48ed96db9172203ade1c6ab30937dde (patch)
tree1aa4554abf2ee1beedf7dfa7e94070b8a96305d3 /win/CS/HandBrakeWPF/Services
parent1903ac850ad0374b765ef3a058570a4bec067115 (diff)
WinGui: Lay the foundation for editing presets with a simple rename window.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs5
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs24
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs9
3 files changed, 38 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs
index 88fd341b0..4cc177a3d 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs
@@ -144,5 +144,10 @@ namespace HandBrakeWPF.Services.Presets.Interfaces
/// <param name="name">Name of the preset</param>
/// <returns>True if found</returns>
bool CheckIfPresetExists(string name);
+
+ /// <summary>
+ /// Replace an existing preset with a modified one.
+ /// </summary>
+ void Replace(Preset existing, Preset replacement);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
index a6190052e..4ecc0c502 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
@@ -35,6 +35,30 @@ namespace HandBrakeWPF.Services.Presets.Model
#endregion
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PropertyChangedBase"/> class.
+ /// Creates an instance of <see cref="T:HandBrakeWPF.Utilities.PropertyChangedBase"/>.
+ /// </summary>
+ public Preset()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PropertyChangedBase"/> class.
+ /// Creates an instance of <see cref="T:HandBrakeWPF.Utilities.PropertyChangedBase"/>.
+ /// </summary>
+ 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>
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
index 55915329b..6c4a48864 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
@@ -254,6 +254,15 @@ namespace HandBrakeWPF.Services.Presets
}
/// <summary>
+ /// Replace an existing preset with a modified one.
+ /// </summary>
+ public void Replace(Preset existing, Preset replacement)
+ {
+ this.Remove(existing);
+ this.Add(replacement);
+ }
+
+ /// <summary>
/// Remove a preset with a given name from either the built in or user preset list.
/// </summary>
/// <param name="preset">