diff options
author | sr55 <[email protected]> | 2014-11-23 21:32:18 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-11-23 21:32:18 +0000 |
commit | c95258591c92e571c25db7a611ae9f3a942b74c2 (patch) | |
tree | 817be812886320a3668a2d2c7611f259ce465142 /win/CS/HandBrakeWPF/Services/Presets | |
parent | c5a04724e91824426cd12802a4ef270d36f2081b (diff) |
WinGui: Move the preset model object into the presets package.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6547 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Presets')
5 files changed, 155 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs index 1efc290e7..7c2a76d60 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs @@ -17,7 +17,7 @@ namespace HandBrakeWPF.Services.Presets.Factories using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
- using HandBrakeWPF.Model.Preset;
+ using HandBrakeWPF.Services.Presets.Model;
/// <summary>
/// Plist Preset Converter
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs index fc098d972..b06df1728 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs @@ -24,8 +24,8 @@ namespace HandBrakeWPF.Services.Presets.Factories using HandBrake.Interop.Model.Encoding.x264;
using HandBrake.Interop.Model.Encoding.x265;
- using HandBrakeWPF.Model.Preset;
using HandBrakeWPF.Services.Presets;
+ using HandBrakeWPF.Services.Presets.Model;
/// <summary>
/// A Factory to translate a Plist object into a Preset.
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs index 90dd855fb..9035eae70 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs @@ -11,7 +11,7 @@ namespace HandBrakeWPF.Services.Presets.Interfaces {
using System.Collections.ObjectModel;
- using HandBrakeWPF.Model.Preset;
+ using HandBrakeWPF.Services.Presets.Model;
/// <summary>
/// The Preset Service Interface
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs new file mode 100644 index 000000000..aa50ec7de --- /dev/null +++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs @@ -0,0 +1,151 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Preset.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>
+// A Preset for encoding with.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Services.Presets.Model
+{
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Model.Audio;
+ using HandBrake.ApplicationServices.Model.Subtitle;
+
+ /// <summary>
+ /// A Preset for encoding with.
+ /// </summary>
+ public class Preset : PropertyChangedBase
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The is default.
+ /// </summary>
+ private bool isDefault;
+
+ #endregion
+
+ #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>
+ /// 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
+ {
+ return this.isDefault;
+ }
+ set
+ {
+ this.isDefault = value;
+ this.NotifyOfPropertyChange(() => this.IsDefault);
+ }
+ }
+
+ /// <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 a value indicating whether use deinterlace.
+ /// </summary>
+ public bool UseDeinterlace { get; set; }
+
+ /// <summary>
+ /// Gets or sets task.
+ /// </summary>
+ public EncodeTask Task { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Picture Filters are used with this preset.
+ /// </summary>
+ public bool UsePictureFilters { get; set; }
+
+ /// <summary>
+ /// Gets or sets The version number which associates this preset with a HB build
+ /// </summary>
+ public string Version { 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; }
+
+ #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 = audioBehaviours;
+ this.SubtitleTrackBehaviours = subtitleBehaviours;
+ }
+
+ /// <summary>
+ /// Override the ToString Method
+ /// </summary>
+ /// <returns>
+ /// The Preset Name
+ /// </returns>
+ public override string ToString()
+ {
+ return this.Name;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index 5afb3cf23..e7a2b8afb 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -23,8 +23,8 @@ namespace HandBrakeWPF.Services.Presets using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Utilities;
- using HandBrakeWPF.Model.Preset;
using HandBrakeWPF.Services.Presets.Interfaces;
+ using HandBrakeWPF.Services.Presets.Model;
/// <summary>
/// The preset service manages HandBrake's presets
|