summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/Encode/Model
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/Encode/Model')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/EncodeTask.cs610
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs182
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs395
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/ChapterMarker.cs92
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs34
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs21
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/PointToPointMode.cs31
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleTrack.cs275
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleType.cs38
11 files changed, 1743 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/EncodeTask.cs
new file mode 100644
index 000000000..8748ddbc6
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/EncodeTask.cs
@@ -0,0 +1,610 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="EncodeTask.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>
+// An Encode Task
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Services.Encode.Model
+{
+ using System;
+ using System.Collections.ObjectModel;
+ using System.Linq;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.Interop.Model;
+ using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrake.Interop.Model.Encoding.x265;
+
+ using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
+
+ /// <summary>
+ /// An Encode Task
+ /// </summary>
+ public class EncodeTask : PropertyChangedBase
+ {
+ #region Private Fields
+
+ /// <summary>
+ /// The advanced panel enabled.
+ /// </summary>
+ private bool showAdvancedTab;
+
+ /// <summary>
+ /// The advanced encoder options.
+ /// </summary>
+ private string advancedEncoderOptions;
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EncodeTask"/> class.
+ /// </summary>
+ public EncodeTask()
+ {
+ this.Cropping = new Cropping();
+ this.AudioTracks = new ObservableCollection<AudioTrack>();
+ this.SubtitleTracks = new ObservableCollection<SubtitleTrack>();
+ this.ChapterNames = new ObservableCollection<ChapterMarker>();
+ this.AllowedPassthruOptions = new AllowedPassthru();
+ this.X264Preset = x264Preset.Medium;
+ this.QsvPreset = QsvPreset.Quality;
+ this.H264Profile = x264Profile.None;
+ this.X264Tune = x264Tune.None;
+ this.Modulus = 16;
+
+ this.H265Profile = x265Profile.None;
+ this.X265Preset = x265Preset.VeryFast;
+ this.X265Tune = x265Tune.None;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EncodeTask"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="task">
+ /// The task.
+ /// </param>
+ public EncodeTask(EncodeTask task)
+ {
+ this.AdvancedEncoderOptions = task.AdvancedEncoderOptions;
+ this.AllowedPassthruOptions = new AllowedPassthru(task.AllowedPassthruOptions);
+ this.Anamorphic = task.Anamorphic;
+ this.Angle = task.Angle;
+
+ this.AudioTracks = new ObservableCollection<AudioTrack>();
+ foreach (AudioTrack track in task.AudioTracks)
+ {
+ this.AudioTracks.Add(new AudioTrack(track));
+ }
+
+ this.ChapterNames = new ObservableCollection<ChapterMarker>();
+ foreach (ChapterMarker track in task.ChapterNames)
+ {
+ this.ChapterNames.Add(new ChapterMarker(track));
+ }
+
+ this.ChapterMarkersFilePath = task.ChapterMarkersFilePath;
+ this.Cropping = new Cropping(task.Cropping);
+ this.CustomDecomb = task.CustomDecomb;
+ this.CustomDeinterlace = task.CustomDeinterlace;
+ this.CustomDenoise = task.CustomDenoise;
+ this.CustomDetelecine = task.CustomDetelecine;
+ this.Deblock = task.Deblock;
+ this.Decomb = task.Decomb;
+ this.Deinterlace = task.Deinterlace;
+ this.Denoise = task.Denoise;
+ this.DenoisePreset = task.DenoisePreset;
+ this.DenoiseTune = task.DenoiseTune;
+ this.Destination = task.Destination;
+ this.Detelecine = task.Detelecine;
+ this.DisplayWidth = task.DisplayWidth;
+ this.EndPoint = task.EndPoint;
+ this.Framerate = task.Framerate;
+ this.FramerateMode = task.FramerateMode;
+ this.Grayscale = task.Grayscale;
+ this.HasCropping = task.HasCropping;
+ this.Height = task.Height;
+ this.IncludeChapterMarkers = task.IncludeChapterMarkers;
+ this.IPod5GSupport = task.IPod5GSupport;
+ this.KeepDisplayAspect = task.KeepDisplayAspect;
+ this.MaxHeight = task.MaxHeight;
+ this.MaxWidth = task.MaxWidth;
+ this.Modulus = task.Modulus;
+ this.OptimizeMP4 = task.OptimizeMP4;
+ this.OutputFormat = task.OutputFormat;
+ this.PixelAspectX = task.PixelAspectX;
+ this.PixelAspectY = task.PixelAspectY;
+ this.PointToPointMode = task.PointToPointMode;
+ this.Quality = task.Quality;
+ this.Source = task.Source;
+ this.StartPoint = task.StartPoint;
+
+ this.SubtitleTracks = new ObservableCollection<SubtitleTrack>();
+ foreach (SubtitleTrack subtitleTrack in task.SubtitleTracks)
+ {
+ this.SubtitleTracks.Add(new SubtitleTrack(subtitleTrack));
+ }
+
+ this.Title = task.Title;
+ this.TurboFirstPass = task.TurboFirstPass;
+ this.TwoPass = task.TwoPass;
+ this.VideoBitrate = task.VideoBitrate;
+ this.VideoEncoder = task.VideoEncoder;
+ this.VideoEncodeRateType = task.VideoEncodeRateType;
+ this.Width = task.Width;
+ this.X264Preset = task.X264Preset;
+ this.QsvPreset = task.QsvPreset;
+ this.H264Profile = task.H264Profile;
+ this.X264Tune = task.X264Tune;
+ this.H264Level = task.H264Level;
+ this.FastDecode = task.FastDecode;
+ this.ExtraAdvancedArguments = task.ExtraAdvancedArguments;
+
+ this.PreviewStartAt = task.PreviewStartAt;
+ this.PreviewDuration = task.PreviewDuration;
+
+ this.ShowAdvancedTab = task.ShowAdvancedTab;
+
+ this.X265Preset = task.X265Preset;
+ this.X265Tune = task.X265Tune;
+ this.H265Profile = task.H265Profile;
+ }
+
+ #region Source
+
+ /// <summary>
+ /// Gets or sets Source.
+ /// </summary>
+ public string Source { get; set; }
+
+ /// <summary>
+ /// Gets or sets Title.
+ /// </summary>
+ public int Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Angle
+ /// </summary>
+ public int Angle { get; set; }
+
+ /// <summary>
+ /// Gets or sets PointToPointMode.
+ /// </summary>
+ public PointToPointMode PointToPointMode { get; set; }
+
+ /// <summary>
+ /// Gets or sets StartPoint.
+ /// </summary>
+ public int StartPoint { get; set; }
+
+ /// <summary>
+ /// Gets or sets EndPoint.
+ /// </summary>
+ public int EndPoint { get; set; }
+
+ #endregion
+
+ #region Destination
+
+ /// <summary>
+ /// Gets or sets Destination.
+ /// </summary>
+ public string Destination { get; set; }
+
+ #endregion
+
+ #region Output Settings
+
+ /// <summary>
+ /// Gets or sets OutputFormat.
+ /// </summary>
+ public OutputFormat OutputFormat { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Optimize.
+ /// </summary>
+ public bool OptimizeMP4 { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IPod5GSupport.
+ /// </summary>
+ public bool IPod5GSupport { get; set; }
+
+ #endregion
+
+ #region Picture
+
+ /// <summary>
+ /// Gets or sets Width.
+ /// </summary>
+ public int? Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets Height.
+ /// </summary>
+ public int? Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets MaxWidth.
+ /// </summary>
+ public int? MaxWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets MaxHeight.
+ /// </summary>
+ public int? MaxHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets Cropping.
+ /// </summary>
+ public Cropping Cropping { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether HasCropping.
+ /// </summary>
+ public bool HasCropping { get; set; }
+
+ /// <summary>
+ /// Gets or sets Anamorphic.
+ /// </summary>
+ public Anamorphic Anamorphic { get; set; }
+
+ /// <summary>
+ /// Gets or sets DisplayWidth.
+ /// </summary>
+ public double? DisplayWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether KeepDisplayAspect.
+ /// </summary>
+ public bool KeepDisplayAspect { get; set; }
+
+ /// <summary>
+ /// Gets or sets PixelAspectX.
+ /// </summary>
+ public int PixelAspectX { get; set; }
+
+ /// <summary>
+ /// Gets or sets PixelAspectY.
+ /// </summary>
+ public int PixelAspectY { get; set; }
+
+ /// <summary>
+ /// Gets or sets Modulus.
+ /// </summary>
+ public int? Modulus { get; set; }
+
+ #endregion
+
+ #region Filters
+
+ /// <summary>
+ /// Gets or sets Deinterlace.
+ /// </summary>
+ public Deinterlace Deinterlace { get; set; }
+
+ /// <summary>
+ /// Gets or sets CustomDeinterlace.
+ /// </summary>
+ public string CustomDeinterlace { get; set; }
+
+ /// <summary>
+ /// Gets or sets Decomb.
+ /// </summary>
+ public Decomb Decomb { get; set; }
+
+ /// <summary>
+ /// Gets or sets CustomDecomb.
+ /// </summary>
+ public string CustomDecomb { get; set; }
+
+ /// <summary>
+ /// Gets or sets Detelecine.
+ /// </summary>
+ public Detelecine Detelecine { get; set; }
+
+ /// <summary>
+ /// Gets or sets CustomDetelecine.
+ /// </summary>
+ public string CustomDetelecine { get; set; }
+
+ /// <summary>
+ /// Gets or sets Denoise.
+ /// </summary>
+ public Denoise Denoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise preset.
+ /// </summary>
+ public DenoisePreset DenoisePreset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise tune.
+ /// </summary>
+ public DenoiseTune DenoiseTune { get; set; }
+
+ /// <summary>
+ /// Gets or sets CustomDenoise.
+ /// </summary>
+ public string CustomDenoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets Deblock.
+ /// </summary>
+ public int Deblock { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Grayscale.
+ /// </summary>
+ public bool Grayscale { get; set; }
+
+ #endregion
+
+ #region Video
+
+ /// <summary>
+ /// Gets or sets VideoEncodeRateType.
+ /// </summary>
+ public VideoEncodeRateType VideoEncodeRateType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the VideoEncoder
+ /// </summary>
+ public VideoEncoder VideoEncoder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Video Encode Mode
+ /// </summary>
+ public FramerateMode FramerateMode { get; set; }
+
+ /// <summary>
+ /// Gets or sets Quality.
+ /// </summary>
+ public double? Quality { get; set; }
+
+ /// <summary>
+ /// Gets or sets VideoBitrate.
+ /// </summary>
+ public int? VideoBitrate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether TwoPass.
+ /// </summary>
+ public bool TwoPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether TurboFirstPass.
+ /// </summary>
+ public bool TurboFirstPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets Framerate.
+ /// Null = Same as Source
+ /// </summary>
+ public double? Framerate { get; set; }
+
+ #endregion
+
+ #region Audio
+
+ /// <summary>
+ /// Gets or sets AudioEncodings.
+ /// </summary>
+ public ObservableCollection<AudioTrack> AudioTracks { get; set; }
+
+ /// <summary>
+ /// Gets or sets AllowedPassthruOptions.
+ /// </summary>
+ public AllowedPassthru AllowedPassthruOptions { get; set; }
+
+ #endregion
+
+ #region Subtitles
+
+ /// <summary>
+ /// Gets or sets SubtitleTracks.
+ /// </summary>
+ public ObservableCollection<SubtitleTrack> SubtitleTracks { get; set; }
+
+ #endregion
+
+ #region Chapters
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IncludeChapterMarkers.
+ /// </summary>
+ public bool IncludeChapterMarkers { get; set; }
+
+ /// <summary>
+ /// Gets or sets ChapterMarkersFilePath.
+ /// </summary>
+ public string ChapterMarkersFilePath { get; set; }
+
+ /// <summary>
+ /// Gets or sets ChapterNames.
+ /// </summary>
+ public ObservableCollection<ChapterMarker> ChapterNames { get; set; }
+
+ #endregion
+
+ #region Advanced
+
+ /// <summary>
+ /// Gets or sets AdvancedEncoderOptions.
+ /// </summary>
+ public string AdvancedEncoderOptions
+ {
+ get
+ {
+ return this.advancedEncoderOptions;
+ }
+ set
+ {
+ this.advancedEncoderOptions = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets x264Preset.
+ /// </summary>
+ public x264Preset X264Preset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the qsv preset.
+ /// </summary>
+ public QsvPreset QsvPreset { get; set; }
+
+ /// <summary>
+ /// Gets or sets x264Profile.
+ /// </summary>
+ public x264Profile H264Profile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the x 264 level.
+ /// </summary>
+ public string H264Level { get; set; }
+
+ /// <summary>
+ /// Gets or sets X264Tune.
+ /// </summary>
+ public x264Tune X264Tune { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether fast decode.
+ /// </summary>
+ public bool FastDecode { get; set; }
+
+ /// <summary>
+ /// Gets or sets Extra Advanced Arguments for the Video Tab.
+ /// </summary>
+ public string ExtraAdvancedArguments { get; set; }
+
+ /// <summary>
+ /// Gets or sets x265Preset.
+ /// </summary>
+ public x265Preset X265Preset { get; set; }
+
+ /// <summary>
+ /// Gets or sets x265Profile.
+ /// </summary>
+ public x265Profile H265Profile { get; set; }
+
+ /// <summary>
+ /// Gets or sets X265Tune.
+ /// </summary>
+ public x265Tune X265Tune { get; set; }
+
+ #endregion
+
+ #region Preview
+
+ /// <summary>
+ /// Gets or sets StartAt.
+ /// </summary>
+ public int? PreviewStartAt { get; set; }
+
+ /// <summary>
+ /// Gets or sets Duration.
+ /// </summary>
+ public int? PreviewDuration { get; set; }
+
+ #endregion
+
+ #region Helpers
+
+ /// <summary>
+ /// Gets a value indicating whether M4v extension is required.
+ /// </summary>
+ public bool RequiresM4v
+ {
+ get
+ {
+ if (this.OutputFormat == OutputFormat.Mp4)
+ {
+ bool audio =
+ this.AudioTracks.Any(
+ item =>
+ item.Encoder == AudioEncoder.Ac3Passthrough || item.Encoder == AudioEncoder.Ac3
+ || item.Encoder == AudioEncoder.DtsPassthrough || item.Encoder == AudioEncoder.Passthrough);
+
+ bool subtitles = this.SubtitleTracks.Any(track => track.SubtitleType != SubtitleType.VobSub);
+
+ return audio || subtitles;
+ }
+
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsPreviewEncode.
+ /// </summary>
+ public bool IsPreviewEncode { get; set; }
+
+ /// <summary>
+ /// Gets or sets PreviewEncodeDuration.
+ /// </summary>
+ public int PreviewEncodeDuration { get; set; }
+
+ /// <summary>
+ /// Gets or sets PreviewEncodeStartAt.
+ /// </summary>
+ public string PreviewEncodeStartAt { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether advanced panel enabled.
+ /// </summary>
+ public bool ShowAdvancedTab
+ {
+ get
+ {
+ return this.showAdvancedTab;
+ }
+ set
+ {
+ if (!object.Equals(value, this.showAdvancedTab))
+ {
+ this.showAdvancedTab = value;
+ this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the picture settings desc.
+ /// </summary>
+ public string PictureSettingsDesc
+ {
+ get
+ {
+ string resolution = string.Empty;
+ switch (this.Anamorphic)
+ {
+ case Anamorphic.Strict:
+ resolution = "Anamorphic: Strict";
+ break;
+ case Anamorphic.Loose:
+ resolution = "Anamorphic: Loose, Width: " + this.Width;
+ break;
+ case Anamorphic.Custom:
+ resolution = "Anamorphic: Custom, Resolution: " + this.Width + "x" + this.Height;
+ break;
+ case Anamorphic.None:
+ resolution = "Resolution: " + this.Width + "x" + this.Height;
+ break;
+ }
+
+ return resolution + Environment.NewLine + "Crop Top: " + this.Cropping.Top + ", Botton: " + this.Cropping.Bottom + ", Left: "
+ + this.Cropping.Left + ", Right: " + this.Cropping.Right;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs
new file mode 100644
index 000000000..36c4febab
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs
@@ -0,0 +1,182 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AllowedPassthru.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>
+// Allowed Passthru Options
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using HandBrake.Interop.Model.Encoding;
+
+ /// <summary>
+ /// Allowed Passthru Options
+ /// </summary>
+ public class AllowedPassthru
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The audio allow aac pass.
+ /// </summary>
+ private bool? audioAllowAACPass;
+
+ /// <summary>
+ /// The audio allow a c 3 pass.
+ /// </summary>
+ private bool? audioAllowAC3Pass;
+
+ /// <summary>
+ /// The audio allow dtshd pass.
+ /// </summary>
+ private bool? audioAllowDTSHDPass;
+
+ /// <summary>
+ /// The audio allow dts pass.
+ /// </summary>
+ private bool? audioAllowDTSPass;
+
+ /// <summary>
+ /// The audio allow m p 3 pass.
+ /// </summary>
+ private bool? audioAllowMP3Pass;
+
+ #endregion
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AllowedPassthru"/> class.
+ /// </summary>
+ public AllowedPassthru()
+ {
+ this.AudioAllowAACPass = true;
+ this.AudioAllowAC3Pass = true;
+ this.AudioAllowDTSHDPass = true;
+ this.AudioAllowDTSPass = true;
+ this.AudioAllowMP3Pass = true;
+ this.AudioEncoderFallback = AudioEncoder.Ac3;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AllowedPassthru"/> class.
+ /// </summary>
+ /// <param name="initialValue">
+ /// The initial Value.
+ /// </param>
+ public AllowedPassthru(bool? initialValue)
+ {
+ this.AudioAllowAACPass = initialValue;
+ this.AudioAllowAC3Pass = initialValue;
+ this.AudioAllowDTSHDPass = initialValue;
+ this.AudioAllowDTSPass = initialValue;
+ this.AudioAllowMP3Pass = initialValue;
+ this.AudioEncoderFallback = AudioEncoder.Ac3;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AllowedPassthru"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="initialValue">
+ /// The initial value.
+ /// </param>
+ public AllowedPassthru(AllowedPassthru initialValue)
+ {
+ this.AudioAllowAACPass = initialValue.AudioAllowAACPass;
+ this.AudioAllowAC3Pass = initialValue.AudioAllowAC3Pass;
+ this.AudioAllowDTSHDPass = initialValue.AudioAllowDTSHDPass;
+ this.AudioAllowDTSPass = initialValue.AudioAllowDTSPass;
+ this.AudioAllowMP3Pass = initialValue.AudioAllowMP3Pass;
+ this.AudioEncoderFallback = initialValue.AudioEncoderFallback;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a value indicating whether AudioAllowAACPass.
+ /// </summary>
+ public bool? AudioAllowAACPass
+ {
+ get
+ {
+ return this.audioAllowAACPass ?? true;
+ }
+ set
+ {
+ this.audioAllowAACPass = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether AudioAllowAC3Pass.
+ /// </summary>
+ public bool? AudioAllowAC3Pass
+ {
+ get
+ {
+ return this.audioAllowAC3Pass ?? true;
+ }
+ set
+ {
+ this.audioAllowAC3Pass = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether AudioAllowDTSHDPass.
+ /// </summary>
+ public bool? AudioAllowDTSHDPass
+ {
+ get
+ {
+ return this.audioAllowDTSHDPass ?? true;
+ }
+ set
+ {
+ this.audioAllowDTSHDPass = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether AudioAllowDTSPass.
+ /// </summary>
+ public bool? AudioAllowDTSPass
+ {
+ get
+ {
+ return this.audioAllowDTSPass ?? true;
+ }
+ set
+ {
+ this.audioAllowDTSPass = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether AudioAllowMP3Pass.
+ /// </summary>
+ public bool? AudioAllowMP3Pass
+ {
+ get
+ {
+ return this.audioAllowMP3Pass ?? true;
+ }
+ set
+ {
+ this.audioAllowMP3Pass = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets AudioEncoderFallback.
+ /// </summary>
+ public AudioEncoder AudioEncoderFallback { get; set; }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs
new file mode 100644
index 000000000..992d15a8a
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs
@@ -0,0 +1,395 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioTrack.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>
+// An Audio Track for the Audio Panel
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System;
+ using System.ComponentModel;
+ using System.Globalization;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Services.Scan.Model;
+ using HandBrake.ApplicationServices.Utilities;
+ using HandBrake.Interop.Model.Encoding;
+
+ using Newtonsoft.Json;
+
+ /// <summary>
+ /// An Audio Track for the Audio Panel
+ /// </summary>
+ public class AudioTrack : PropertyChangedBase
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The bitrate.
+ /// </summary>
+ private int bitrate;
+
+ /// <summary>
+ /// The DRC Value
+ /// </summary>
+ private double drc;
+
+ /// <summary>
+ /// The encoder.
+ /// </summary>
+ private AudioEncoder encoder;
+
+ /// <summary>
+ /// The gain value
+ /// </summary>
+ private int gain;
+
+ /// <summary>
+ /// The mix down.
+ /// </summary>
+ private Mixdown mixDown;
+
+ /// <summary>
+ /// The sample rate.
+ /// </summary>
+ private double sampleRate;
+
+ /// <summary>
+ /// The Scanned Audio Track
+ /// </summary>
+ [NonSerialized]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ private Audio scannedTrack;
+
+ /// <summary>
+ /// The is default.
+ /// </summary>
+ private bool isDefault;
+
+ #endregion
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref = "AudioTrack" /> class.
+ /// </summary>
+ public AudioTrack()
+ {
+ // Default Values
+ this.Encoder = AudioEncoder.ffaac;
+ this.MixDown = Mixdown.DolbyProLogicII;
+ this.SampleRate = 48;
+ this.Bitrate = 160;
+ this.DRC = 0;
+ this.ScannedTrack = new Audio();
+ this.TrackName = string.Empty;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioTrack"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="track">
+ /// The track.
+ /// </param>
+ public AudioTrack(AudioTrack track)
+ {
+ this.bitrate = track.Bitrate;
+ this.drc = track.DRC;
+ this.encoder = track.Encoder;
+ this.gain = track.Gain;
+ this.mixDown = track.MixDown;
+ this.sampleRate = track.SampleRate;
+ this.scannedTrack = track.ScannedTrack ?? new Audio();
+ this.TrackName = track.TrackName;
+ }
+
+ #endregion
+
+ #region Public Properties
+
+ /// <summary>
+ /// Gets AudioEncoderDisplayValue.
+ /// </summary>
+ public string AudioEncoderDisplayValue
+ {
+ get
+ {
+ return EnumHelper<AudioEncoder>.GetDisplay(this.Encoder);
+ }
+ }
+
+ /// <summary>
+ /// Gets AudioMixdownDisplayValue.
+ /// </summary>
+ public string AudioMixdownDisplayValue
+ {
+ get
+ {
+ return EnumHelper<Mixdown>.GetDisplay(this.MixDown);
+ }
+ }
+
+ /// <summary>
+ /// Gets the The UI display value for bit rate
+ /// </summary>
+ public string BitRateDisplayValue
+ {
+ get
+ {
+ if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough
+ || this.Encoder == AudioEncoder.DtsHDPassthrough)
+ {
+ return "Auto";
+ }
+
+ return this.Bitrate.ToString();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Audio Bitrate
+ /// </summary>
+ public int Bitrate
+ {
+ get
+ {
+ return this.bitrate;
+ }
+
+ set
+ {
+ this.bitrate = value;
+ this.NotifyOfPropertyChange(() => this.Bitrate);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Dynamic Range Compression
+ /// </summary>
+ public double DRC
+ {
+ get
+ {
+ return this.drc;
+ }
+
+ set
+ {
+ if (!object.Equals(value, this.drc))
+ {
+ this.drc = value;
+ this.NotifyOfPropertyChange(() => this.DRC);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether is default.
+ /// </summary>
+ public bool IsDefault
+ {
+ get
+ {
+ return this.isDefault;
+ }
+ set
+ {
+ this.isDefault = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Audio Encoder
+ /// </summary>
+ public AudioEncoder Encoder
+ {
+ get
+ {
+ return this.encoder;
+ }
+
+ set
+ {
+ this.encoder = value;
+ this.NotifyOfPropertyChange(() => this.Encoder);
+ this.NotifyOfPropertyChange(() => this.IsPassthru);
+ this.NotifyOfPropertyChange(() => this.CannotSetBitrate);
+ this.NotifyOfPropertyChange(() => this.TrackReference);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Gain for the audio track
+ /// </summary>
+ public int Gain
+ {
+ get
+ {
+ return this.gain;
+ }
+
+ set
+ {
+ if (!object.Equals(value, this.gain))
+ {
+ this.gain = value;
+ this.NotifyOfPropertyChange(() => this.Gain);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Audio Mixdown
+ /// </summary>
+ public Mixdown MixDown
+ {
+ get
+ {
+ return this.mixDown;
+ }
+
+ set
+ {
+ this.mixDown = value;
+ this.NotifyOfPropertyChange(() => this.MixDown);
+ this.NotifyOfPropertyChange(() => this.TrackReference);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Audio SampleRate
+ /// </summary>
+ public double SampleRate
+ {
+ get
+ {
+ return this.sampleRate;
+ }
+
+ set
+ {
+ this.sampleRate = value;
+ this.NotifyOfPropertyChange(() => this.SampleRate);
+ this.NotifyOfPropertyChange(() => this.TrackReference);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the The UI display value for sample rate
+ /// </summary>
+ public string SampleRateDisplayValue
+ {
+ get
+ {
+ return this.SampleRate == 0 ? "Auto" : this.SampleRate.ToString(CultureInfo.InvariantCulture);
+ }
+ set
+ {
+ // TODO change this to be a converted field
+ if (string.IsNullOrEmpty(value))
+ {
+ return;
+ }
+
+ double samplerate;
+ double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out samplerate);
+
+ this.SampleRate = samplerate;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Scanned Audio Tracks
+ /// </summary>
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public Audio ScannedTrack
+ {
+ get
+ {
+ return this.scannedTrack;
+ }
+
+ set
+ {
+ this.scannedTrack = value;
+ this.NotifyOfPropertyChange(() => this.ScannedTrack);
+ }
+ }
+
+ /// <summary>
+ /// Gets the Audio Track Name
+ /// </summary>
+ public int? Track
+ {
+ get
+ {
+ if (this.ScannedTrack != null)
+ {
+ return this.ScannedTrack.TrackNumber;
+ }
+
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether IsPassthru.
+ /// </summary>
+ public bool IsPassthru
+ {
+ get
+ {
+ if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough
+ || this.Encoder == AudioEncoder.DtsHDPassthrough || this.Encoder == AudioEncoder.AacPassthru
+ || this.Encoder == AudioEncoder.Mp3Passthru || this.Encoder == AudioEncoder.Passthrough)
+ {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether can set bitrate.
+ /// </summary>
+ public bool CannotSetBitrate
+ {
+ get
+ {
+ return this.IsPassthru || this.Encoder == AudioEncoder.ffflac || this.Encoder == AudioEncoder.ffflac24;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether IsLossless.
+ /// </summary>
+ public bool IsLossless
+ {
+ get
+ {
+ return this.IsPassthru || this.Encoder == AudioEncoder.ffflac || this.Encoder == AudioEncoder.ffflac24;
+ }
+ }
+
+ /// <summary>
+ /// Gets TrackReference.
+ /// </summary>
+ [JsonIgnore]
+ public AudioTrack TrackReference
+ {
+ get { return this; }
+ }
+
+ /// <summary>
+ /// Gets or sets the track name.
+ /// </summary>
+ public string TrackName { get; set; }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/ChapterMarker.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/ChapterMarker.cs
new file mode 100644
index 000000000..1a20379f4
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/ChapterMarker.cs
@@ -0,0 +1,92 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChapterMarker.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 Movie Chapter
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System;
+
+ using Caliburn.Micro;
+
+ /// <summary>
+ /// A Movie Chapter
+ /// </summary>
+ public class ChapterMarker : PropertyChangedBase
+ {
+ /// <summary>
+ /// Backing field for chapter name
+ /// </summary>
+ private string chapterName;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChapterMarker"/> class.
+ /// </summary>
+ public ChapterMarker()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChapterMarker"/> class.
+ /// </summary>
+ /// <param name="number">
+ /// The number.
+ /// </param>
+ /// <param name="name">
+ /// The name.
+ /// </param>
+ /// <param name="duration">
+ /// The duration.
+ /// </param>
+ public ChapterMarker(int number, string name, TimeSpan duration)
+ {
+ this.ChapterName = name;
+ this.ChapterNumber = number;
+ this.Duration = duration;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChapterMarker"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="chapter">
+ /// The chapter.
+ /// </param>
+ public ChapterMarker(ChapterMarker chapter)
+ {
+ this.ChapterName = chapter.ChapterName;
+ this.ChapterNumber = chapter.ChapterNumber;
+ this.Duration = chapter.Duration;
+ }
+
+ /// <summary>
+ /// Gets or sets The number of this Chapter, in regards to it's parent Title
+ /// </summary>
+ public int ChapterNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the duration.
+ /// </summary>
+ public TimeSpan Duration { get; set; }
+
+ /// <summary>
+ /// Gets or sets ChapterName.
+ /// </summary>
+ public string ChapterName
+ {
+ get
+ {
+ return this.chapterName;
+ }
+ set
+ {
+ this.chapterName = value;
+ this.NotifyOfPropertyChange(() => this.ChapterName);
+ }
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs
new file mode 100644
index 000000000..a411d19ae
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DenoisePreset.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>
+// Defines the DenoisePreset type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The denoise preset.
+ /// </summary>
+ public enum DenoisePreset
+ {
+ [Display(Name = "Weak")]
+ Weak = 0,
+
+ [Display(Name = "Medium")]
+ Medium,
+
+ [Display(Name = "Strong")]
+ Strong,
+
+ [Display(Name = "Custom")]
+ Custom,
+
+ [Display(Name = "Ultralight")] // NLMeans only
+ Ultralight,
+
+ [Display(Name = "Light")] // NLMeans only
+ Light,
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs
new file mode 100644
index 000000000..2fd13cfca
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs
@@ -0,0 +1,34 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DenoiseTune.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>
+// Defines the DenoiseTune type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The denoise tune.
+ /// </summary>
+ public enum DenoiseTune
+ {
+ [Display(Name = "None")]
+ None = 0,
+
+ [Display(Name = "Film")]
+ Film,
+
+ [Display(Name = "Grain")]
+ Grain,
+
+ [Display(Name = "High Motion")]
+ HighMotion,
+
+ [Display(Name = "Animation")]
+ Animation,
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs
new file mode 100644
index 000000000..6392578a6
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs
@@ -0,0 +1,21 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="FramerateMode.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>
+// The Mode of Video Encoding. CFR, VFR, PFR
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ /// <summary>
+ /// The Mode of Video Encoding. CFR, VFR, PFR
+ /// </summary>
+ public enum FramerateMode
+ {
+ CFR = 0,
+ PFR,
+ VFR
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs
new file mode 100644
index 000000000..828746f17
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs
@@ -0,0 +1,28 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OutputFormat.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>
+// The Output format.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System.ComponentModel;
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The Output format.
+ /// </summary>
+ public enum OutputFormat
+ {
+ [Description("MP4")]
+ [Display(Name = "MP4")]
+ Mp4 = 0,
+
+ [Description("MKV")]
+ [Display(Name = "MKV")]
+ Mkv,
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/PointToPointMode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/PointToPointMode.cs
new file mode 100644
index 000000000..df0bc437c
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/PointToPointMode.cs
@@ -0,0 +1,31 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PointToPointMode.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>
+// Point to Point Mode
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// Point to Point Mode
+ /// </summary>
+ public enum PointToPointMode
+ {
+ [Display(Name = "Chapters")]
+ Chapters = 0,
+
+ [Display(Name = "Seconds")]
+ Seconds,
+
+ [Display(Name = "Frames")]
+ Frames,
+
+ [Display(Name = "Preview")]
+ Preview,
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleTrack.cs
new file mode 100644
index 000000000..7be5dd3b9
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleTrack.cs
@@ -0,0 +1,275 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleTrack.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>
+// Subtitle Information
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Services.Scan.Model;
+
+ /// <summary>
+ /// Subtitle Information
+ /// </summary>
+ public class SubtitleTrack : PropertyChangedBase
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The burned in backing field.
+ /// </summary>
+ private bool burned;
+
+ /// <summary>
+ /// The is default backing field.
+ /// </summary>
+ private bool isDefault;
+
+ /// <summary>
+ /// The source track.
+ /// </summary>
+ private Subtitle sourceTrack;
+
+ /// <summary>
+ /// Backing field for the srt file name.
+ /// </summary>
+ private string srtFileName;
+
+ /// <summary>
+ /// Backing field for Forced Subs
+ /// </summary>
+ private bool forced;
+
+ #endregion
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitleTrack"/> class.
+ /// </summary>
+ public SubtitleTrack()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitleTrack"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="subtitle">
+ /// The subtitle.
+ /// </param>
+ public SubtitleTrack(SubtitleTrack subtitle)
+ {
+ this.Burned = subtitle.Burned;
+ this.Default = subtitle.Default;
+ this.Forced = subtitle.Forced;
+ this.sourceTrack = subtitle.SourceTrack;
+ this.SrtCharCode = subtitle.SrtCharCode;
+ this.SrtFileName = subtitle.SrtFileName;
+ this.SrtLang = subtitle.SrtLang;
+ this.SrtOffset = subtitle.SrtOffset;
+ this.SrtPath = subtitle.SrtPath;
+ this.SubtitleType = subtitle.SubtitleType;
+ this.SourceTrack = subtitle.SourceTrack;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Burned.
+ /// </summary>
+ public bool Burned
+ {
+ get
+ {
+ return this.burned;
+ }
+
+ set
+ {
+ if (!object.Equals(this.burned, value))
+ {
+ this.burned = value;
+ this.NotifyOfPropertyChange(() => this.Burned);
+
+ if (value)
+ {
+ this.Default = false;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Default.
+ /// </summary>
+ public bool Default
+ {
+ get
+ {
+ return this.isDefault;
+ }
+
+ set
+ {
+ if (!object.Equals(this.isDefault, value))
+ {
+ this.isDefault = value;
+ this.NotifyOfPropertyChange(() => this.Default);
+
+ if (value)
+ {
+ this.Burned = false;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Forced.
+ /// </summary>
+ public bool Forced
+ {
+ get
+ {
+ return this.forced;
+ }
+ set
+ {
+ this.forced = value;
+ this.NotifyOfPropertyChange(() => this.Forced);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SourceTrack.
+ /// </summary>
+ public Subtitle SourceTrack
+ {
+ get
+ {
+ return this.sourceTrack;
+ }
+
+ set
+ {
+ this.sourceTrack = value;
+ this.NotifyOfPropertyChange(() => this.SourceTrack);
+ if (this.sourceTrack != null)
+ {
+ this.Track = this.sourceTrack.ToString();
+ }
+
+ this.NotifyOfPropertyChange(() => this.CanBeBurned);
+ this.NotifyOfPropertyChange(() => this.CanBeForced);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the SRT Character Code
+ /// </summary>
+ public string SrtCharCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the SRT Filename
+ /// </summary>
+ public string SrtFileName
+ {
+ get
+ {
+ return srtFileName;
+ }
+
+ set
+ {
+ srtFileName = value;
+ this.NotifyOfPropertyChange(() => this.IsSrtSubtitle);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the SRT Language
+ /// </summary>
+ public string SrtLang { get; set; }
+
+ /// <summary>
+ /// Gets or sets the SRT Offset
+ /// </summary>
+ public int SrtOffset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Path to the SRT file
+ /// </summary>
+ public string SrtPath { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type of the subtitle
+ /// </summary>
+ public SubtitleType SubtitleType { get; set; }
+
+ /// <summary>
+ /// Gets or sets Track.
+ /// </summary>
+ [Obsolete("Use SourceTrack Instead")]
+ public string Track { get; set; }
+
+ #endregion
+
+ /// <summary>
+ /// Gets a value indicating whether CanForced.
+ /// </summary>
+ public bool CanBeForced
+ {
+ get
+ {
+ if (this.SourceTrack != null)
+ {
+ return this.SourceTrack.CanForce || this.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch;
+ }
+
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether CanBeBurned.
+ /// </summary>
+ public bool CanBeBurned
+ {
+ get
+ {
+ if (this.SourceTrack != null)
+ {
+ return this.SourceTrack.CanBurnIn || this.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch || this.SubtitleType == SubtitleType.SRT;
+ }
+
+ if (this.SubtitleType == SubtitleType.SRT)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this is an SRT subtitle.
+ /// </summary>
+ public bool IsSrtSubtitle
+ {
+ get
+ {
+ return this.SrtFileName != "-" && this.SrtFileName != null;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleType.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleType.cs
new file mode 100644
index 000000000..a249060b5
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/SubtitleType.cs
@@ -0,0 +1,38 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleType.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>
+// Subtitle Type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Model.Encoding
+{
+ using System.ComponentModel;
+
+ /// <summary>
+ /// Subtitle Type.
+ /// </summary>
+ public enum SubtitleType
+ {
+ [Description("SSA")]
+ SSA,
+ [Description("SRT")]
+ SRT,
+ [Description("VobSub")]
+ VobSub,
+ [Description("CC")]
+ CC,
+ [Description("UTF8")]
+ UTF8Sub,
+ [Description("TX3G")]
+ TX3G,
+ [Description("PGS")]
+ PGS,
+ [Description("Unknown")]
+ Unknown,
+ [Description("Foreign Audio Search")]
+ ForeignAudioSearch, // Special Type for Foreign Audio Search
+ }
+} \ No newline at end of file