summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Interop/Json
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-02-28 20:10:51 +0000
committersr55 <[email protected]>2015-02-28 20:10:51 +0000
commit649ff74c60c7d04d53e70bb2826327d1aae96be3 (patch)
tree51e3df9be5962cb52a6398751074e07f8b8d4a46 /win/CS/HandBrake.ApplicationServices/Interop/Json
parent45f6af479741991c494808514c12752cec34c6ce (diff)
WinGui: Moving the Interop Code into the services library. This will allow some modelling simplifications.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6949 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop/Json')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicResult.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs64
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/Geometry.cs33
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/PAR.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/SourceGeometry.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs34
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioList.cs72
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/ChapterList.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs44
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs29
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/FilterList.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs64
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs62
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs57
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Search.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitle.cs29
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleList.cs52
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs74
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/AnamorphicFactory.cs111
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/EncodeFactory.cs516
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/ScanFactory.cs221
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioList.cs52
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/ChapterList.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration2.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Geometry.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs29
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/MetaData.cs18
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/PAR.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleList.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/TitleList.cs105
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs42
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs62
41 files changed, 2386 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs
new file mode 100644
index 000000000..993d54657
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AnamorphicGeometry.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 geometry.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic
+{
+ /// <summary>
+ /// The geometry.
+ /// </summary>
+ internal class AnamorphicGeometry
+ {
+ /// <summary>
+ /// Gets or sets the dest geometry.
+ /// </summary>
+ public DestSettings DestSettings { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source geometry.
+ /// </summary>
+ public SourceGeometry SourceGeometry { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicResult.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicResult.cs
new file mode 100644
index 000000000..ab28a8c32
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicResult.cs
@@ -0,0 +1,32 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AnamorphicResult.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 anamorphic result.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic
+{
+ /// <summary>
+ /// The anamorphic result.
+ /// </summary>
+ internal class AnamorphicResult
+ {
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the par.
+ /// </summary>
+ public PAR PAR { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs
new file mode 100644
index 000000000..f377892e9
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs
@@ -0,0 +1,64 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DestGeometry.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 dest geometry.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The dest geometry.
+ /// </summary>
+ internal class DestSettings
+ {
+ public DestSettings()
+ {
+ this.Geometry = new Geometry();
+ }
+
+ /// <summary>
+ /// Gets or sets the anamorphic mode.
+ /// </summary>
+ public int AnamorphicMode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the crop.
+ /// </summary>
+ public List<int> Crop { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Geometry
+ /// </summary>
+ public Geometry Geometry { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether itu par.
+ /// </summary>
+ public bool ItuPAR { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether keep display aspect.
+ /// </summary>
+ public int Keep { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max height.
+ /// </summary>
+ public int MaxHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max width.
+ /// </summary>
+ public int MaxWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the modulus.
+ /// </summary>
+ public int Modulus { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/Geometry.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/Geometry.cs
new file mode 100644
index 000000000..b70b58f6b
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/Geometry.cs
@@ -0,0 +1,33 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Geometry.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 geometry.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic
+{
+
+ /// <summary>
+ /// The geometry.
+ /// </summary>
+ public class Geometry
+ {
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the par.
+ /// </summary>
+ public PAR PAR { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/PAR.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/PAR.cs
new file mode 100644
index 000000000..895666633
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/PAR.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PAR.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 par.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic
+{
+ /// <summary>
+ /// The par.
+ /// </summary>
+ public class PAR
+ {
+ /// <summary>
+ /// Gets or sets the Number.
+ /// </summary>
+ public int Num { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Denominator.
+ /// </summary>
+ public int Den { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/SourceGeometry.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/SourceGeometry.cs
new file mode 100644
index 000000000..2496093e9
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/SourceGeometry.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceGeometry.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 source geometry.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic
+{
+ /// <summary>
+ /// The source geometry.
+ /// </summary>
+ internal class SourceGeometry
+ {
+ public SourceGeometry()
+ {
+ this.PAR = new PAR();
+ }
+
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the par.
+ /// </summary>
+ public PAR PAR { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs
new file mode 100644
index 000000000..5a2c97066
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs
@@ -0,0 +1,34 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Audio.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 audio.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The audio.
+ /// </summary>
+ public class Audio
+ {
+ /// <summary>
+ /// Gets or sets the audio list.
+ /// </summary>
+ public List<AudioList> AudioList { get; set; }
+
+ /// <summary>
+ /// Gets or sets the copy mask.
+ /// </summary>
+ public int CopyMask { get; set; }
+
+ /// <summary>
+ /// Gets or sets the fallback encoder.
+ /// </summary>
+ public int FallbackEncoder { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioList.cs
new file mode 100644
index 000000000..9e1af92df
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioList.cs
@@ -0,0 +1,72 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioList.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 audio list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The audio list.
+ /// </summary>
+ public class AudioList
+ {
+ /// <summary>
+ /// Gets or sets the bitrate.
+ /// </summary>
+ public int? Bitrate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the compression level.
+ /// </summary>
+ public double? CompressionLevel { get; set; }
+
+ /// <summary>
+ /// Gets or sets the drc.
+ /// </summary>
+ public double DRC { get; set; }
+
+ /// <summary>
+ /// Gets or sets the encoder.
+ /// </summary>
+ public int Encoder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the gain.
+ /// </summary>
+ public double Gain { get; set; }
+
+ /// <summary>
+ /// Gets or sets the mixdown.
+ /// </summary>
+ public int Mixdown { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether normalize mix level.
+ /// </summary>
+ public bool NormalizeMixLevel { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quality.
+ /// </summary>
+ public double? Quality { get; set; }
+
+ /// <summary>
+ /// Gets or sets the samplerate.
+ /// </summary>
+ public int Samplerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Name of the audio track.
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the track.
+ /// </summary>
+ public int Track { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/ChapterList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/ChapterList.cs
new file mode 100644
index 000000000..d58146510
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/ChapterList.cs
@@ -0,0 +1,22 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChapterList.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 chapter list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The chapter list.
+ /// </summary>
+ public class ChapterList
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ public string Name { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs
new file mode 100644
index 000000000..42b3eaa40
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs
@@ -0,0 +1,44 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Destination.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 destination.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The destination.
+ /// </summary>
+ public class Destination
+ {
+ /// <summary>
+ /// Gets or sets the chapter list.
+ /// </summary>
+ public List<ChapterList> ChapterList { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether chapter markers.
+ /// </summary>
+ public bool ChapterMarkers { get; set; }
+
+ /// <summary>
+ /// Gets or sets the file.
+ /// </summary>
+ public string File { get; set; }
+
+ /// <summary>
+ /// Gets or sets the mp 4 options.
+ /// </summary>
+ public Mp4Options Mp4Options { get; set; }
+
+ /// <summary>
+ /// Gets or sets the mux.
+ /// </summary>
+ public int Mux { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs
new file mode 100644
index 000000000..9082ff8a2
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs
@@ -0,0 +1,29 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Filter.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 filter.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The filter.
+ /// </summary>
+ public class Filter
+ {
+ /// <summary>
+ /// Gets or sets the filter list.
+ /// </summary>
+ public List<FilterList> FilterList { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether grayscale.
+ /// </summary>
+ public bool Grayscale { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/FilterList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/FilterList.cs
new file mode 100644
index 000000000..e08a76ba8
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/FilterList.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="FilterList.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 filter list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The filter list.
+ /// </summary>
+ public class FilterList
+ {
+ /// <summary>
+ /// Gets or sets the id.
+ /// </summary>
+ public int ID { get; set; }
+
+ /// <summary>
+ /// Gets or sets the settings.
+ /// </summary>
+ public string Settings { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs
new file mode 100644
index 000000000..7b9a1f953
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs
@@ -0,0 +1,64 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="JsonEncodeObject.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 root object.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+
+ /// <summary>
+ /// The root object.
+ /// </summary>
+ internal class JsonEncodeObject
+ {
+ /// <summary>
+ /// Gets or sets the audio.
+ /// </summary>
+ public Audio Audio { get; set; }
+
+ /// <summary>
+ /// Gets or sets the destination.
+ /// </summary>
+ public Destination Destination { get; set; }
+
+ /// <summary>
+ /// Gets or sets the filter.
+ /// </summary>
+ public Filter Filter { get; set; }
+
+ /// <summary>
+ /// Gets or sets the PAR
+ /// </summary>
+ public PAR PAR { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta data.
+ /// </summary>
+ public MetaData MetaData { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sequence id.
+ /// </summary>
+ public int SequenceID { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source.
+ /// </summary>
+ public Source Source { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subtitle.
+ /// </summary>
+ public Subtitle Subtitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video.
+ /// </summary>
+ public Video Video { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs
new file mode 100644
index 000000000..86f06b8cb
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs
@@ -0,0 +1,62 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="MetaData.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 meta data.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The meta data.
+ /// </summary>
+ public class MetaData
+ {
+ /// <summary>
+ /// Gets or sets the album artist.
+ /// </summary>
+ public string AlbumArtist { get; set; }
+
+ /// <summary>
+ /// Gets or sets the artist.
+ /// </summary>
+ public string Artist { get; set; }
+
+ /// <summary>
+ /// Gets or sets the comment.
+ /// </summary>
+ public string Comment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the composer.
+ /// </summary>
+ public string Composer { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the genre.
+ /// </summary>
+ public string Genre { get; set; }
+
+ /// <summary>
+ /// Gets or sets the long description.
+ /// </summary>
+ public string LongDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the release date.
+ /// </summary>
+ public string ReleaseDate { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs
new file mode 100644
index 000000000..ad12e4e69
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Mp4Options.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 mp 4 options.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The mp 4 options.
+ /// </summary>
+ public class Mp4Options
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether ipod atom.
+ /// </summary>
+ public bool IpodAtom { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether mp 4 optimize.
+ /// </summary>
+ public bool Mp4Optimize { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs
new file mode 100644
index 000000000..50b874501
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs
@@ -0,0 +1,57 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Range.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 range.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The range.
+ /// </summary>
+ public class Range
+ {
+ /// <summary>
+ /// Gets or sets the chapter end.
+ /// </summary>
+ public int? ChapterEnd { get; set; }
+
+ /// <summary>
+ /// Gets or sets the chapter start.
+ /// </summary>
+ public int? ChapterStart { get; set; }
+
+ /// <summary>
+ /// Gets or sets the frame to start.
+ /// </summary>
+ public int? FrameToStart { get; set; }
+
+ /// <summary>
+ /// Gets or sets the frame to stop.
+ /// </summary>
+ public int? FrameToStop { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pts to start.
+ /// </summary>
+ public int? PtsToStart { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pts to stop.
+ /// </summary>
+ public int? PtsToStop { get; set; }
+
+ /// <summary>
+ /// Gets or sets the start at preview.
+ /// </summary>
+ public int? StartAtPreview { get; set; }
+
+ /// <summary>
+ /// Gets or sets the seek points.
+ /// </summary>
+ public int? SeekPoints { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs
new file mode 100644
index 000000000..94229c97b
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs
@@ -0,0 +1,32 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SRT.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 srt.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The srt.
+ /// </summary>
+ public class SRT
+ {
+ /// <summary>
+ /// Gets or sets the codeset.
+ /// </summary>
+ public string Codeset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the filename.
+ /// </summary>
+ public string Filename { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language.
+ /// </summary>
+ public string Language { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Search.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Search.cs
new file mode 100644
index 000000000..8e5625f00
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Search.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Search.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 search.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The search.
+ /// </summary>
+ public class Search
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether burn.
+ /// </summary>
+ public bool Burn { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether default.
+ /// </summary>
+ public bool Default { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether enable.
+ /// </summary>
+ public bool Enable { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether forced.
+ /// </summary>
+ public bool Forced { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs
new file mode 100644
index 000000000..7adc228a9
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs
@@ -0,0 +1,32 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Source.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 source.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The source.
+ /// </summary>
+ public class Source
+ {
+ /// <summary>
+ /// Gets or sets the angle.
+ /// </summary>
+ public int Angle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the range.
+ /// </summary>
+ public Range Range { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title.
+ /// </summary>
+ public int Title { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitle.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitle.cs
new file mode 100644
index 000000000..c5e8d56f7
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitle.cs
@@ -0,0 +1,29 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Subtitle.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 subtitle.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The subtitle.
+ /// </summary>
+ public class Subtitle
+ {
+ /// <summary>
+ /// Gets or sets the search.
+ /// </summary>
+ public Search Search { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subtitle list.
+ /// </summary>
+ public List<SubtitleList> SubtitleList { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleList.cs
new file mode 100644
index 000000000..99781bf29
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleList.cs
@@ -0,0 +1,52 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleList.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 subtitle list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ /// <summary>
+ /// The subtitle list.
+ /// </summary>
+ public class SubtitleList
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether burn.
+ /// </summary>
+ public bool Burn { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether default.
+ /// </summary>
+ public bool Default { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether force.
+ /// </summary>
+ public bool Force { get; set; }
+
+ /// <summary>
+ /// Gets or sets the id.
+ /// </summary>
+ public int ID { get; set; }
+
+ /// <summary>
+ /// Gets or sets the offset.
+ /// </summary>
+ public int Offset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the track.
+ /// </summary>
+ public int Track { get; set; }
+
+ /// <summary>
+ /// Gets or sets the srt.
+ /// </summary>
+ public SRT SRT { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs
new file mode 100644
index 000000000..957f3dfb8
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs
@@ -0,0 +1,74 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Video.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 video.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Encode
+{
+ using System;
+
+ /// <summary>
+ /// The video.
+ /// </summary>
+ public class Video
+ {
+ /// <summary>
+ /// Gets or sets the codec.
+ /// </summary>
+ public int Codec { get; set; }
+
+ /// <summary>
+ /// Gets or sets the level.
+ /// </summary>
+ public string Level { get; set; }
+
+ /// <summary>
+ /// Gets or sets the bitrate for the encode.
+ /// </summary>
+ public int? Bitrate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether two pass.
+ /// </summary>
+ public bool TwoPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Turbo First Pass. For x264/5
+ /// </summary>
+ public bool Turbo { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Colour Matrix Code
+ /// </summary>
+ public int ColorMatrixCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the options.
+ /// </summary>
+ public string Options { get; set; }
+
+ /// <summary>
+ /// Gets or sets the preset.
+ /// </summary>
+ public string Preset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the profile.
+ /// </summary>
+ public string Profile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quality.
+ /// </summary>
+ public double? Quality { get; set; }
+
+ /// <summary>
+ /// Gets or sets the tune.
+ /// </summary>
+ public string Tune { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/AnamorphicFactory.cs
new file mode 100644
index 000000000..9aa335a52
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/AnamorphicFactory.cs
@@ -0,0 +1,111 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AnamorphicFactory.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 Anamorphic factory.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Factories
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Runtime.InteropServices;
+
+ using HandBrake.ApplicationServices.Interop.HbLib;
+ using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+ using HandBrake.ApplicationServices.Interop.Model;
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Interop.Model.Scan;
+
+ using Newtonsoft.Json;
+
+ /// <summary>
+ /// The anamorphic factory.
+ /// </summary>
+ public class AnamorphicFactory
+ {
+ /// <summary>
+ /// The keep setting.
+ /// </summary>
+ public enum KeepSetting
+ {
+ HB_KEEP_WIDTH = 0x01,
+ HB_KEEP_HEIGHT = 0x02,
+ HB_KEEP_DISPLAY_ASPECT = 0x04
+ }
+
+ /// <summary>
+ /// The create geometry.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <param name="title">
+ /// The current title.
+ /// </param>
+ /// <param name="keepWidthOrHeight">
+ /// Keep Width or Height. (Not Display Aspect)
+ /// </param>
+ /// <returns>
+ /// The <see cref="Scan.Geometry"/>.
+ /// </returns>
+ public static Geometry CreateGeometry(EncodeJob job, Title title, KeepSetting keepWidthOrHeight) // Todo remove the need for these objects. Should use simpler objects.
+ {
+ int settingMode = (int)keepWidthOrHeight + (job.KeepDisplayAspect ? 0x04 : 0);
+
+ // Sanatise the Geometry First.
+ AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry
+ {
+ SourceGeometry = new SourceGeometry
+ {
+ Width = title.Resolution.Width,
+ Height = title.Resolution.Height,
+ PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height }
+ },
+ DestSettings = new DestSettings
+ {
+ AnamorphicMode = (int)job.Anamorphic,
+ Geometry = {
+ Width = job.Width, Height = job.Height,
+ PAR = new PAR
+ {
+ Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
+ Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
+ }
+ },
+ Keep = settingMode,
+ Crop = new List<int> { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
+ Modulus = job.Modulus,
+ MaxWidth = job.MaxWidth,
+ MaxHeight = job.MaxHeight,
+ ItuPAR = false
+ }
+ };
+
+ if (job.Anamorphic == Anamorphic.Custom)
+ {
+ anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = job.PixelAspectX, Den = job.PixelAspectY };
+ }
+ else
+ {
+ anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height };
+ }
+
+ string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
+ IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode));
+ string result = Marshal.PtrToStringAnsi(json);
+ AnamorphicResult resultGeometry = JsonConvert.DeserializeObject<AnamorphicResult>(result);
+
+ // Setup the Destination Gemotry.
+ Geometry geometry = new Geometry
+ {
+ Width = resultGeometry.Width,
+ Height = resultGeometry.Height,
+ PAR = resultGeometry.PAR
+ };
+ return geometry;
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/EncodeFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/EncodeFactory.cs
new file mode 100644
index 000000000..083e60884
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/EncodeFactory.cs
@@ -0,0 +1,516 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="EncodeFactory.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 encode factory.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Factories
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.Linq;
+ using System.Runtime.InteropServices;
+ using System.Windows.Media.Animation;
+
+ using HandBrake.ApplicationServices.Interop.HbLib;
+ using HandBrake.ApplicationServices.Interop.Helpers;
+ using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+ using HandBrake.ApplicationServices.Interop.Json.Encode;
+ using HandBrake.ApplicationServices.Interop.Model;
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Interop.Model.Scan;
+
+ using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitle;
+
+ /// <summary>
+ /// This factory takes the internal EncodeJob object and turns it into a set of JSON models
+ /// that can be deserialized by libhb.
+ /// </summary>
+ internal class EncodeFactory
+ {
+ /*
+ * TODO:
+ * 1. OpenCL and HWD Support
+ * 2. Rotate Support
+ */
+
+ /// <summary>
+ /// The create.
+ /// </summary>
+ /// <param name="job">
+ /// The encode job.
+ /// </param>
+ /// <param name="title">
+ /// The title.
+ /// </param>
+ /// <returns>
+ /// The <see cref="JsonEncodeObject"/>.
+ /// </returns>
+ internal static JsonEncodeObject Create(EncodeJob job, Title title)
+ {
+ JsonEncodeObject encode = new JsonEncodeObject
+ {
+ SequenceID = 0,
+ Audio = CreateAudio(job),
+ Destination = CreateDestination(job),
+ Filter = CreateFilter(job, title),
+ PAR = CreatePAR(job, title),
+ MetaData = CreateMetaData(job),
+ Source = CreateSource(job),
+ Subtitle = CreateSubtitle(job),
+ Video = CreateVideo(job)
+ };
+
+ return encode;
+ }
+
+ /// <summary>
+ /// The create source.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Source"/>.
+ /// </returns>
+ private static Source CreateSource(EncodeJob job)
+ {
+ Range range = new Range();
+ switch (job.RangeType)
+ {
+ case VideoRangeType.Chapters:
+ range.ChapterEnd = job.ChapterEnd;
+ range.ChapterStart = job.ChapterStart;
+ break;
+ case VideoRangeType.Seconds:
+ range.PtsToStart = (int)(job.SecondsStart * 90000);
+ range.PtsToStop = (int)((job.SecondsEnd - job.SecondsStart) * 90000);
+ break;
+ case VideoRangeType.Frames:
+ range.FrameToStart = job.FramesStart;
+ range.FrameToStop = job.FramesEnd;
+ break;
+ case VideoRangeType.Preview:
+ range.StartAtPreview = job.StartAtPreview;
+ range.SeekPoints = job.SeekPoints;
+ range.PtsToStop = job.SecondsEnd * 90000;
+ break;
+ }
+
+ Source source = new Source
+ {
+ Title = job.Title,
+ Range = range,
+ Angle = job.Angle
+ };
+ return source;
+ }
+
+ /// <summary>
+ /// The create destination.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Destination"/>.
+ /// </returns>
+ private static Destination CreateDestination(EncodeJob job)
+ {
+ Destination destination = new Destination
+ {
+ File = job.OutputPath,
+ Mp4Options = new Mp4Options
+ {
+ IpodAtom = job.IPod5GSupport,
+ Mp4Optimize = job.Optimize
+ },
+ ChapterMarkers = job.IncludeChapterMarkers,
+ Mux = HBFunctions.hb_container_get_from_name(job.ContainerName),
+ ChapterList = new List<ChapterList>()
+ };
+
+ if (job.UseDefaultChapterNames)
+ {
+ foreach (string item in job.CustomChapterNames)
+ {
+ ChapterList chapter = new ChapterList { Name = item };
+ destination.ChapterList.Add(chapter);
+ }
+ }
+
+ return destination;
+ }
+
+ /// <summary>
+ /// Create the PAR object
+ /// </summary>
+ /// <param name="job">
+ /// The Job
+ /// </param>
+ /// <param name="title">
+ /// The title.
+ /// </param>
+ /// <returns>
+ /// The produced PAR object.
+ /// </returns>
+ private static PAR CreatePAR(EncodeJob job, Title title)
+ {
+ Geometry resultGeometry = AnamorphicFactory.CreateGeometry(job, title, AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH);
+ return new PAR { Num = resultGeometry.PAR.Num, Den = resultGeometry.PAR.Den };
+ }
+
+ /// <summary>
+ /// The create subtitle.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Encode.Subtitle"/>.
+ /// </returns>
+ private static Subtitle CreateSubtitle(EncodeJob job)
+ {
+ Subtitle subtitle = new Subtitle
+ {
+ Search =
+ new Search
+ {
+ Enable = false,
+ Default = false,
+ Burn = false,
+ Forced = false
+ },
+ SubtitleList = new List<SubtitleList>()
+ };
+
+ foreach (SourceSubtitle item in job.Subtitles.SourceSubtitles)
+ {
+ // Handle Foreign Audio Search
+ if (item.TrackNumber == 0)
+ {
+ subtitle.Search.Enable = true;
+ subtitle.Search.Burn = item.BurnedIn;
+ subtitle.Search.Default = item.Default;
+ subtitle.Search.Forced = item.Forced;
+ }
+ else
+ {
+ SubtitleList track = new SubtitleList { Burn = item.BurnedIn, Default = item.Default, Force = item.Forced, ID = item.TrackNumber, Track = (item.TrackNumber - 1) };
+ subtitle.SubtitleList.Add(track);
+ }
+ }
+
+ foreach (SrtSubtitle item in job.Subtitles.SrtSubtitles)
+ {
+ SubtitleList track = new SubtitleList
+ {
+ Track = -1, // Indicates SRT
+ Default = item.Default,
+ Offset = item.Offset,
+ Burn = item.BurnedIn,
+ SRT =
+ new SRT
+ {
+ Filename = item.FileName,
+ Codeset = item.CharacterCode,
+ Language = item.LanguageCode
+ }
+ };
+
+ subtitle.SubtitleList.Add(track);
+ }
+
+ return subtitle;
+ }
+
+ /// <summary>
+ /// The create video.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Video"/>.
+ /// </returns>
+ private static Video CreateVideo(EncodeJob job)
+ {
+ Video video = new Video();
+
+ HBVideoEncoder videoEncoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(e => e.ShortName == job.VideoEncoder);
+ Validate.NotNull(videoEncoder, "Video encoder " + job.VideoEncoder + " not recognized.");
+ if (videoEncoder != null)
+ {
+ video.Codec = videoEncoder.Id;
+ }
+
+ if (!string.IsNullOrEmpty(job.AdvancedOptions))
+ {
+ video.Options = job.AdvancedOptions;
+ }
+ else
+ {
+ video.Level = job.VideoLevel;
+ video.Options = job.VideoOptions;
+ video.Preset = job.VideoPreset;
+ video.Profile = job.VideoProfile;
+ }
+
+ if (job.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality) video.Quality = job.Quality;
+ if (job.VideoEncodeRateType == VideoEncodeRateType.AverageBitrate)
+ {
+ video.Bitrate = job.VideoBitrate;
+ video.TwoPass = job.TwoPass;
+ video.Turbo = job.TurboFirstPass;
+ }
+
+ if (job.VideoTunes != null && job.VideoTunes.Count > 0)
+ {
+ video.Tune = string.Join(",", job.VideoTunes);
+ }
+
+ return video;
+ }
+
+ /// <summary>
+ /// The create audio.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Audio"/>.
+ /// </returns>
+ private static Audio CreateAudio(EncodeJob job)
+ {
+ Audio audio = new Audio();
+
+ if (!string.IsNullOrEmpty(job.AudioEncoderFallback))
+ {
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.AudioEncoderFallback);
+ Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.AudioEncoderFallback);
+ audio.FallbackEncoder = audioEncoder.Id;
+ }
+
+ audio.CopyMask = (int)NativeConstants.HB_ACODEC_ANY;
+
+ audio.AudioList = new List<AudioList>();
+ foreach (AudioEncoding item in job.AudioEncodings)
+ {
+ HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(item.Encoder);
+ Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder);
+
+ HBMixdown mixdown = HandBrakeEncoderHelpers.GetMixdown(item.Mixdown);
+ Validate.NotNull(mixdown, "Unrecognized audio mixdown:" + item.Mixdown);
+
+ AudioList audioTrack = new AudioList
+ {
+ Track = item.InputNumber - 1,
+ DRC = item.Drc,
+ Encoder = encoder.Id,
+ Gain = item.Gain,
+ Mixdown = mixdown.Id,
+ NormalizeMixLevel = false,
+ Samplerate = item.SampleRateRaw,
+ Name = item.Name,
+ };
+
+ if (!item.IsPassthru)
+ {
+ if (item.EncodeRateType == AudioEncodeRateType.Quality)
+ {
+ audioTrack.Quality = item.Quality;
+ }
+
+ if (item.EncodeRateType == AudioEncodeRateType.Compression)
+ {
+ audioTrack.CompressionLevel = item.Compression;
+ }
+
+ if (item.EncodeRateType == AudioEncodeRateType.Bitrate)
+ {
+ audioTrack.Bitrate = item.Bitrate;
+ }
+ }
+
+ audio.AudioList.Add(audioTrack);
+ }
+
+ return audio;
+ }
+
+ /// <summary>
+ /// The create filter.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <param name="title">
+ /// The title.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Filter"/>.
+ /// </returns>
+ private static Filter CreateFilter(EncodeJob job, Title title)
+ {
+ Filter filter = new Filter
+ {
+ FilterList = new List<FilterList>(),
+ Grayscale = job.Grayscale
+ };
+
+ // Detelecine
+ if (job.Detelecine != Detelecine.Off)
+ {
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DETELECINE, Settings = job.CustomDetelecine };
+ filter.FilterList.Add(filterItem);
+ }
+
+ // Decomb
+ if (job.Decomb != Decomb.Off)
+ {
+ string options;
+ if (job.Decomb == Decomb.Fast)
+ {
+ options = "7:2:6:9:1:80";
+ }
+ else if (job.Decomb == Decomb.Bob)
+ {
+ options = "455";
+ }
+ else
+ {
+ options = job.CustomDecomb;
+ }
+
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DECOMB, Settings = options };
+ filter.FilterList.Add(filterItem);
+ }
+
+ // Deinterlace
+ if (job.Deinterlace != Deinterlace.Off)
+ {
+ string options;
+ if (job.Deinterlace == Deinterlace.Fast)
+ {
+ options = "0";
+ }
+ else if (job.Deinterlace == Deinterlace.Slow)
+ {
+ options = "1";
+ }
+ else if (job.Deinterlace == Deinterlace.Slower)
+ {
+ options = "3";
+ }
+ else if (job.Deinterlace == Deinterlace.Bob)
+ {
+ options = "15";
+ }
+ else
+ {
+ options = job.CustomDeinterlace;
+ }
+
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEINTERLACE, Settings = options };
+ filter.FilterList.Add(filterItem);
+ }
+
+ // VFR / CFR
+ int fm = job.ConstantFramerate ? 1 : job.PeakFramerate ? 2 : 0;
+ IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.Framerate.ToString(CultureInfo.InvariantCulture));
+ int vrate = HBFunctions.hb_video_framerate_get_from_name(frameratePrt);
+
+ int num;
+ int den;
+ if (vrate > 0)
+ {
+ num = 27000000;
+ den = vrate;
+ }
+ else
+ {
+ // cfr or pfr flag with no rate specified implies use the title rate.
+ num = title.FramerateNumerator;
+ den = title.FramerateDenominator;
+ }
+
+ string framerateString = string.Format("{0}:{1}:{2}", fm, num, den); // filter_cfr, filter_vrate.num, filter_vrate.den
+
+ FilterList framerateShaper = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_VFR, Settings = framerateString };
+ filter.FilterList.Add(framerateShaper);
+
+ // Deblock
+ if (job.Deblock >= 5)
+ {
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEBLOCK, Settings = job.Deblock.ToString() };
+ filter.FilterList.Add(filterItem);
+ }
+
+ // Denoise
+ if (job.Denoise != Denoise.Off)
+ {
+ hb_filter_ids id = job.Denoise == Denoise.hqdn3d
+ ? hb_filter_ids.HB_FILTER_HQDN3D
+ : hb_filter_ids.HB_FILTER_NLMEANS;
+
+ string settings;
+ if (!string.IsNullOrEmpty(job.CustomDenoise))
+ {
+ settings = job.CustomDenoise;
+ }
+ else
+ {
+ IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)id, job.DenoisePreset, job.DenoiseTune);
+ settings = Marshal.PtrToStringAnsi(settingsPtr);
+ }
+
+ FilterList filterItem = new FilterList { ID = (int)id, Settings = settings };
+ filter.FilterList.Add(filterItem);
+ }
+
+ // CropScale Filter
+ Geometry resultGeometry = AnamorphicFactory.CreateGeometry(job, title, AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH);
+ FilterList cropScale = new FilterList
+ {
+ ID = (int)hb_filter_ids.HB_FILTER_CROP_SCALE,
+ Settings =
+ string.Format(
+ "{0}:{1}:{2}:{3}:{4}:{5}",
+ resultGeometry.Width,
+ resultGeometry.Height,
+ job.Cropping.Top,
+ job.Cropping.Bottom,
+ job.Cropping.Left,
+ job.Cropping.Right)
+ };
+ filter.FilterList.Add(cropScale);
+
+ // Rotate
+ /* TODO NOT SUPPORTED YET. */
+
+ return filter;
+ }
+
+ /// <summary>
+ /// The create meta data.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="MetaData"/>.
+ /// </returns>
+ private static MetaData CreateMetaData(EncodeJob job)
+ {
+ MetaData metaData = new MetaData();
+
+ /* TODO NOT SUPPORTED YET. */
+ return metaData;
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/ScanFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/ScanFactory.cs
new file mode 100644
index 000000000..3cb0cc6c4
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Factories/ScanFactory.cs
@@ -0,0 +1,221 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ScanFactory.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 scan factory.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Factories
+{
+ using System;
+ using System.Collections.Generic;
+
+ using HandBrake.ApplicationServices.Interop.Json.Scan;
+ using HandBrake.ApplicationServices.Interop.Model;
+ using HandBrake.ApplicationServices.Interop.Model.Scan;
+
+ /// <summary>
+ /// This factory takes the JSON objects deserialized from libhb for the scan information
+ /// and converts them into the internal Title objects.
+ /// </summary>
+ internal class ScanFactory
+ {
+ /// <summary>
+ /// The create title set.
+ /// </summary>
+ /// <param name="scan">
+ /// The scan.
+ /// </param>
+ /// <returns>
+ /// The <see cref="IEnumerable"/>.
+ /// </returns>
+ internal static IEnumerable<Title> CreateTitleSet(JsonScanObject scan)
+ {
+ List<Title> titles = new List<Title>();
+
+ if (scan != null)
+ {
+ foreach (TitleList item in scan.TitleList)
+ {
+ Title title = CreateTitle(item);
+
+ if (title.TitleNumber == scan.MainFeature)
+ {
+ title.IsMainFeature = true;
+ }
+
+ titles.Add(title);
+ }
+ }
+
+ return titles;
+ }
+
+ /// <summary>
+ /// The create title.
+ /// </summary>
+ /// <param name="title">
+ /// The title.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Title"/>.
+ /// </returns>
+ private static Title CreateTitle(TitleList title)
+ {
+ Title newTitle = new Title
+ {
+ TitleNumber = title.Index,
+ Playlist = title.Playlist,
+ Resolution = new Size(title.Geometry.Width, title.Geometry.Height),
+ ParVal = new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den),
+ Duration = new TimeSpan(title.Duration.Hours, title.Duration.Minutes, title.Duration.Seconds),
+ AutoCropDimensions = new Cropping
+ {
+ Top = title.Crop[0],
+ Bottom = title.Crop[1],
+ Left = title.Crop[2],
+ Right = title.Crop[3]
+ },
+ AngleCount = title.AngleCount,
+ VideoCodecName = title.VideoCodec,
+ Framerate = ((double)title.FrameRate.Num) / title.FrameRate.Den,
+ FramerateNumerator = title.FrameRate.Num,
+ FramerateDenominator = title.FrameRate.Den,
+ Path = title.Path
+ };
+
+ switch (title.Type)
+ {
+ case 2:
+ newTitle.InputType = InputType.Stream;
+ break;
+ case 0:
+ newTitle.InputType = InputType.Dvd;
+ break;
+ case 1:
+ newTitle.InputType = InputType.Bluray;
+ break;
+ case 3:
+ newTitle.InputType = InputType.FFStream;
+ break;
+ }
+
+ foreach (Subtitle subtitleTrack in CreateSubtitleTracks(title.SubtitleList))
+ {
+ newTitle.Subtitles.Add(subtitleTrack);
+ }
+
+ foreach (AudioTrack audioTrack in CreateAudioTracks(title.AudioList))
+ {
+ newTitle.AudioTracks.Add(audioTrack);
+ }
+
+ foreach (Chapter chapter in CreateChapters(title.ChapterList))
+ {
+ newTitle.Chapters.Add(chapter);
+ }
+
+ return newTitle;
+ }
+
+ /// <summary>
+ /// The create subtitle tracks.
+ /// </summary>
+ /// <param name="subtitles">
+ /// The subtitles.
+ /// </param>
+ /// <returns>
+ /// The <see cref="IEnumerable"/>.
+ /// </returns>
+ private static IEnumerable<Subtitle> CreateSubtitleTracks(IEnumerable<SubtitleList> subtitles)
+ {
+ List<Subtitle> subtiles = new List<Subtitle>();
+
+ int currentSubtitleTrack = 1;
+ foreach (SubtitleList subtitle in subtitles)
+ {
+ Subtitle newSubtitle = new Subtitle
+ {
+ TrackNumber = currentSubtitleTrack,
+ Language = subtitle.Language,
+ LanguageCode = subtitle.LanguageCode,
+ SubtitleSourceInt = subtitle.Source,
+ SubtitleSource = (SubtitleSource)subtitle.Source // TODO Check correct
+ };
+
+ subtiles.Add(newSubtitle);
+
+ currentSubtitleTrack++;
+ }
+
+ return subtiles;
+ }
+
+ /// <summary>
+ /// The create audio tracks.
+ /// </summary>
+ /// <param name="audioTracks">
+ /// The audio tracks.
+ /// </param>
+ /// <returns>
+ /// The <see cref="IEnumerable"/>.
+ /// </returns>
+ private static IEnumerable<AudioTrack> CreateAudioTracks(IEnumerable<AudioList> audioTracks)
+ {
+ List<AudioTrack> tracks = new List<AudioTrack>();
+
+ int currentAudioTrack = 1;
+ foreach (AudioList track in audioTracks)
+ {
+ AudioTrack newAudio = new AudioTrack
+ {
+ TrackNumber = currentAudioTrack,
+ CodecId = Convert.ToUInt32(track.Codec),
+ Language = track.Language,
+ LanguageCode = track.LanguageCode,
+ Description = track.Description,
+ ChannelLayout = (ulong)track.ChannelLayout,
+ SampleRate = track.SampleRate,
+ Bitrate = track.BitRate
+ };
+
+ tracks.Add(newAudio);
+
+ currentAudioTrack++;
+ }
+ return tracks;
+ }
+
+ /// <summary>
+ /// The create chapters.
+ /// </summary>
+ /// <param name="chapters">
+ /// The chapters.
+ /// </param>
+ /// <returns>
+ /// The <see cref="IEnumerable"/>.
+ /// </returns>
+ private static IEnumerable<Chapter> CreateChapters(IEnumerable<ChapterList> chapters)
+ {
+ List<Chapter> tracks = new List<Chapter>();
+
+ int currentTrack = 1;
+ foreach (ChapterList chapter in chapters)
+ {
+ Chapter newChapter = new Chapter
+ {
+ Name = chapter.Name,
+ ChapterNumber = currentTrack,
+ Duration = new TimeSpan(chapter.Duration.Hours, chapter.Duration.Minutes, chapter.Duration.Seconds)
+ };
+
+ tracks.Add(newChapter);
+ currentTrack++;
+ }
+
+ return tracks;
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioList.cs
new file mode 100644
index 000000000..18ad084f3
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioList.cs
@@ -0,0 +1,52 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioList.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 audio list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The audio list.
+ /// </summary>
+ internal class AudioList
+ {
+ /// <summary>
+ /// Gets or sets the bit rate.
+ /// </summary>
+ public int BitRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the channel layout.
+ /// </summary>
+ public int ChannelLayout { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language.
+ /// </summary>
+ public string Language { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language code.
+ /// </summary>
+ public string LanguageCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sample rate.
+ /// </summary>
+ public int SampleRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the codec.
+ /// </summary>
+ public int Codec { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/ChapterList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/ChapterList.cs
new file mode 100644
index 000000000..c4da099e5
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/ChapterList.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChapterList.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 chapter list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The chapter list.
+ /// </summary>
+ internal class ChapterList
+ {
+ /// <summary>
+ /// Gets or sets the duration.
+ /// </summary>
+ public Duration2 Duration { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ public string Name { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs
new file mode 100644
index 000000000..8709dcbdd
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs
@@ -0,0 +1,32 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Color.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 color.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The color.
+ /// </summary>
+ internal class Color
+ {
+ /// <summary>
+ /// Gets or sets the matrix.
+ /// </summary>
+ public int Matrix { get; set; }
+
+ /// <summary>
+ /// Gets or sets the primary.
+ /// </summary>
+ public int Primary { get; set; }
+
+ /// <summary>
+ /// Gets or sets the transfer.
+ /// </summary>
+ public int Transfer { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs
new file mode 100644
index 000000000..7785fff05
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Duration.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 duration.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The duration.
+ /// </summary>
+ internal class Duration
+ {
+ /// <summary>
+ /// Gets or sets the hours.
+ /// </summary>
+ public int Hours { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minutes.
+ /// </summary>
+ public int Minutes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the seconds.
+ /// </summary>
+ public int Seconds { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ticks.
+ /// </summary>
+ public int Ticks { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration2.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration2.cs
new file mode 100644
index 000000000..444ea3e2f
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration2.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Duration2.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 duration 2.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The duration 2.
+ /// </summary>
+ internal class Duration2
+ {
+ /// <summary>
+ /// Gets or sets the hours.
+ /// </summary>
+ public int Hours { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minutes.
+ /// </summary>
+ public int Minutes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the seconds.
+ /// </summary>
+ public int Seconds { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ticks.
+ /// </summary>
+ public int Ticks { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs
new file mode 100644
index 000000000..937738076
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs
@@ -0,0 +1,28 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="FrameRate.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 frame rate.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The frame rate.
+ /// </summary>
+ internal class FrameRate
+ {
+
+ /// <summary>
+ /// Gets or sets the den.
+ /// </summary>
+ public int Den { get; set; }
+
+ /// <summary>
+ /// Gets or sets the num.
+ /// </summary>
+ public int Num { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Geometry.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Geometry.cs
new file mode 100644
index 000000000..9f7bc95d4
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Geometry.cs
@@ -0,0 +1,32 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Geometry.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 geometry.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The geometry.
+ /// </summary>
+ internal class Geometry
+ {
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the par.
+ /// </summary>
+ public PAR PAR { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs
new file mode 100644
index 000000000..397e5ce9e
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs
@@ -0,0 +1,29 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="JsonScanObject.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 root object.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The root object.
+ /// </summary>
+ internal class JsonScanObject
+ {
+ /// <summary>
+ /// Gets or sets the main feature.
+ /// </summary>
+ public int MainFeature { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title list.
+ /// </summary>
+ public List<TitleList> TitleList { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/MetaData.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/MetaData.cs
new file mode 100644
index 000000000..46b312a5a
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/MetaData.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="MetaData.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 meta data.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The meta data.
+ /// </summary>
+ internal class MetaData
+ {
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/PAR.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/PAR.cs
new file mode 100644
index 000000000..bfe647ab8
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/PAR.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PAR.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 par.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The par.
+ /// </summary>
+ internal class PAR
+ {
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Num { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Den { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleList.cs
new file mode 100644
index 000000000..f727fd15e
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleList.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleList.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 subtitle list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ /// <summary>
+ /// The subtitle list.
+ /// </summary>
+ internal class SubtitleList
+ {
+ /// <summary>
+ /// Gets or sets the format.
+ /// </summary>
+ public int Format { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language.
+ /// </summary>
+ public string Language { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language code.
+ /// </summary>
+ public string LanguageCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source.
+ /// </summary>
+ public int Source { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/TitleList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/TitleList.cs
new file mode 100644
index 000000000..b31dd4e05
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/TitleList.cs
@@ -0,0 +1,105 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="TitleList.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 title list.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The title list.
+ /// </summary>
+ internal class TitleList
+ {
+ /// <summary>
+ /// Gets or sets the angle count.
+ /// </summary>
+ public int AngleCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the audio list.
+ /// </summary>
+ public List<AudioList> AudioList { get; set; }
+
+ /// <summary>
+ /// Gets or sets the chapter list.
+ /// </summary>
+ public List<ChapterList> ChapterList { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color.
+ /// </summary>
+ public Color Color { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cropping values
+ /// </summary>
+ public List<int> Crop { get; set; }
+
+ /// <summary>
+ /// Gets or sets the duration.
+ /// </summary>
+ public Duration Duration { get; set; }
+
+ /// <summary>
+ /// Gets or sets the frame rate.
+ /// </summary>
+ public FrameRate FrameRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the geometry.
+ /// </summary>
+ public Geometry Geometry { get; set; }
+
+ /// <summary>
+ /// Gets or sets the index.
+ /// </summary>
+ public int Index { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether interlace detected.
+ /// </summary>
+ public bool InterlaceDetected { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta data.
+ /// </summary>
+ public MetaData MetaData { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the path.
+ /// </summary>
+ public string Path { get; set; }
+
+ /// <summary>
+ /// Gets or sets the playlist.
+ /// </summary>
+ public int Playlist { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subtitle list.
+ /// </summary>
+ public List<SubtitleList> SubtitleList { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type.
+ /// HB_DVD_TYPE, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE
+ /// </summary>
+ public int Type { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video codec.
+ /// </summary>
+ public string VideoCodec { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs
new file mode 100644
index 000000000..b0817a7d2
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="JsonState.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 hand brake state.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.State
+{
+ /// <summary>
+ /// The hand brake state.
+ /// </summary>
+ public class JsonState
+ {
+ /// <summary>
+ /// Gets or sets the scanning.
+ /// </summary>
+ public Scanning Scanning { get; set; }
+
+ /// <summary>
+ /// Gets or sets the working.
+ /// </summary>
+ public Working Working { get; set; }
+
+ /// <summary>
+ /// Gets or sets the work done.
+ /// </summary>
+ public WorkDone WorkDone { get; set; }
+
+ /// <summary>
+ /// Gets or sets the state.
+ /// </summary>
+ public int State { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs
new file mode 100644
index 000000000..033bef017
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs
@@ -0,0 +1,42 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Scanning.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 scanning.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.State
+{
+ /// <summary>
+ /// The scanning.
+ /// </summary>
+ public class Scanning
+ {
+ /// <summary>
+ /// Gets or sets the preview.
+ /// </summary>
+ public int Preview { get; set; }
+
+ /// <summary>
+ /// Gets or sets the preview count.
+ /// </summary>
+ public int PreviewCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the progress.
+ /// </summary>
+ public double Progress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title.
+ /// </summary>
+ public int Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title count.
+ /// </summary>
+ public int TitleCount { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs
new file mode 100644
index 000000000..76f85ba90
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs
@@ -0,0 +1,22 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="WorkDone.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 work done.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.State
+{
+ /// <summary>
+ /// The work done.
+ /// </summary>
+ public class WorkDone
+ {
+ /// <summary>
+ /// Gets or sets the error.
+ /// </summary>
+ public int Error { get; set; }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs
new file mode 100644
index 000000000..9aaebf690
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs
@@ -0,0 +1,62 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Working.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 working.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.State
+{
+ /// <summary>
+ /// The working.
+ /// </summary>
+ public class Working
+ {
+ /// <summary>
+ /// Gets or sets the hours.
+ /// </summary>
+ public int Hours { get; set; }
+
+ /// <summary>
+ /// Gets or sets the job.
+ /// </summary>
+ public int Job { get; set; }
+
+ /// <summary>
+ /// Gets or sets the job count.
+ /// </summary>
+ public int JobCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minutes.
+ /// </summary>
+ public int Minutes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the progress.
+ /// </summary>
+ public double Progress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rate.
+ /// </summary>
+ public double Rate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rate avg.
+ /// </summary>
+ public double RateAvg { get; set; }
+
+ /// <summary>
+ /// Gets or sets the seconds.
+ /// </summary>
+ public int Seconds { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sequence id.
+ /// </summary>
+ public int SequenceID { get; set; }
+ }
+} \ No newline at end of file