summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs90
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs19
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs13
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs30
-rw-r--r--win/CS/HandBrake.ApplicationServices/Parsing/Title.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs2
7 files changed, 154 insertions, 3 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index 6f3500d9e..16d8d1694 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -33,6 +33,96 @@ namespace HandBrake.ApplicationServices.Model
}
#region Source
+
+ /// <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.Destination = task.Destination;
+ this.Detelecine = task.Detelecine;
+ this.DisableLibDvdNav = task.DisableLibDvdNav;
+ 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.LargeFile = task.LargeFile;
+ 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.PresetBuildNumber = task.PresetBuildNumber;
+ this.PresetDescription = task.PresetDescription;
+ this.PresetName = task.PresetName;
+ 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.Type = task.Type;
+ this.UsesMaxPictureSettings = task.UsesMaxPictureSettings;
+ this.UsesPictureFilters = task.UsesPictureFilters;
+ this.UsesPictureSettings = task.UsesPictureSettings;
+ this.Verbosity = task.Verbosity;
+ this.VideoBitrate = task.VideoBitrate;
+ this.VideoEncoder = task.VideoEncoder;
+ this.VideoEncodeRateType = task.VideoEncodeRateType;
+ this.Width = task.Width;
+ this.x264Preset = task.x264Preset;
+ this.x264Profile = task.x264Profile;
+ this.X264Tune = task.X264Tune;
+ }
+
/// <summary>
/// Gets or sets Source.
/// </summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
index a892eb119..4b86fc9a1 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
@@ -43,6 +43,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
/// <summary>
/// Initializes a new instance of the <see cref="AllowedPassthru"/> class.
+ /// Copy Constructor
/// </summary>
/// <param name="initialValue">
/// The initial value.
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 3ef786629..4d05591c5 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -83,6 +83,25 @@ namespace HandBrake.ApplicationServices.Model.Encoding
this.ScannedTrack = new Audio();
}
+ /// <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 = new Audio();
+ this.trackName = track.TrackName;
+ }
+
#endregion
#region Public Properties
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs
index 8fb1a5920..88f99008c 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs
@@ -33,6 +33,19 @@ namespace HandBrake.ApplicationServices.Model.Encoding
}
/// <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;
+ }
+
+ /// <summary>
/// Gets or sets The number of this Chapter, in regards to it's parent Title
/// </summary>
public int ChapterNumber { get; set; }
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
index fa7dfd10e..9ad24a1f9 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
@@ -28,8 +28,38 @@ namespace HandBrake.ApplicationServices.Model.Encoding
#endregion
+ /// <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;
+ }
+
#region Public Properties
+
/// <summary>
/// Gets or sets a value indicating whether Burned.
/// </summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
index 4c800f24c..51c2f11c3 100644
--- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
+++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
@@ -245,8 +245,6 @@ namespace HandBrake.ApplicationServices.Parsing
public TimeSpan CalculateDuration(int startPoint, int endPoint)
{
TimeSpan duration = TimeSpan.FromSeconds(0.0);
- startPoint++;
- endPoint++;
if (startPoint != 0 && endPoint != 0 && endPoint <= this.Chapters.Count)
{
for (int i = startPoint; i <= endPoint; i++)
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
index 7c6192636..cc94a3f7d 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
@@ -259,7 +259,7 @@ namespace HandBrake.ApplicationServices.Services
this.readData = new Parser(this.hbProc.StandardError.BaseStream);
this.readData.OnScanProgress += this.OnScanProgress;
this.SouceData = Source.Parse(this.readData);
- this.SouceData.ScanPath = source;
+ this.SouceData.ScanPath = (string)sourcePath;
// Write the Buffer out to file.
using (StreamWriter scanLog = new StreamWriter(dvdInfoPath))