summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Interop
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-07-05 12:12:01 +0000
committersr55 <[email protected]>2015-07-05 12:12:01 +0000
commite32a4681e63cfb7842488842047da1b8f14c72c5 (patch)
tree54314f5debe1d73237d31b24d1e23609c436f946 /win/CS/HandBrake.ApplicationServices/Interop
parent32363c86e5b1847289d9cc0dc741a5f536176225 (diff)
WinGui: Initial Implementation of the json preset export code.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7347 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs19
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs6
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs11
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs13
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs7
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs5
7 files changed, 62 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
index 8d4f34e9e..fcc6d61da 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs
@@ -11,6 +11,7 @@ namespace HandBrake.ApplicationServices.Interop
{
using System;
using System.Collections.Generic;
+ using System.IO;
using System.Runtime.InteropServices;
using HandBrake.ApplicationServices.Interop.HbLib;
@@ -65,5 +66,23 @@ namespace HandBrake.ApplicationServices.Interop
return preset;
}
+
+ /// <summary>
+ /// The export preset.
+ /// </summary>
+ /// <param name="filename">
+ /// The filename.
+ /// </param>
+ /// <param name="container">
+ /// The container.
+ /// </param>
+ public static void ExportPreset(string filename, PresetTransportContainer container)
+ {
+ string preset = JsonConvert.SerializeObject(container, Formatting.Indented);
+ using (StreamWriter writer = new StreamWriter(filename))
+ {
+ writer.Write(preset);
+ }
+ }
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs
index 6bfeadcdd..6112a26a3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs
@@ -19,7 +19,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Presets
/// <summary>
/// Gets or sets the audio copy mask.
/// </summary>
- public List<object> AudioCopyMask { get; set; }
+ public List<string> AudioCopyMask { get; set; }
/// <summary>
/// Gets or sets the audio encoder fallback.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs
index 1fe67db0b..85e240ba9 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs
@@ -11,18 +11,24 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The anamorphic.
/// </summary>
public enum Anamorphic
{
[Display(Name = "None")]
+ [ShortName("none")]
None = 0,
[Display(Name = "Strict")]
+ [ShortName("strict")]
Strict = 1,
[Display(Name = "Loose")]
+ [ShortName("loose")]
Loose = 2,
[Display(Name = "Custom")]
+ [ShortName("custom")]
Custom = 3
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs
index f49ccffc7..58e1003e3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs
@@ -9,15 +9,26 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The decomb.
/// </summary>
public enum Decomb
{
+ [ShortName("off")]
Off = 0,
+
+ [ShortName("default")]
Default = 2,
+
+ [ShortName("fast")]
Fast = 3,
+
+ [ShortName("bob")]
Bob = 4,
+
+ [ShortName("custom")]
Custom = 1
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs
index f5f76b71e..f7b8f0a42 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs
@@ -9,16 +9,29 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The deinterlace.
/// </summary>
public enum Deinterlace
{
+ [ShortName("off")]
Off = 0,
+
+ [ShortName("fast")]
Fast = 2,
+
+ [ShortName("slow")]
Slow = 3,
+
+ [ShortName("slower")]
Slower = 4,
+
+ [ShortName("bob")]
Bob = 5,
+
+ [ShortName("custom")]
Custom = 1
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs
index 1bb510c29..4374372ff 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs
@@ -9,13 +9,20 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The denoise.
/// </summary>
public enum Denoise
{
+ [ShortName("off")]
Off = 0,
+
+ [ShortName("hqdn3d")]
hqdn3d = 1,
+
+ [ShortName("nlmeans")]
NLMeans = 2,
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs
index ff26a394d..f93c754a4 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs
@@ -9,13 +9,18 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The detelecine.
/// </summary>
public enum Detelecine
{
+ [ShortName("off")]
Off = 0,
+ [ShortName("default")]
Default = 2,
+ [ShortName("custom")]
Custom = 1
}
}