diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
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">
|