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/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
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs47
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs7
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs7
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs4
13 files changed, 138 insertions, 2 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
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs
index 8fd6bcd07..5d26040a8 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs
@@ -11,15 +11,19 @@ namespace HandBrake.ApplicationServices.Model
{
using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The different scaling modes available in HandBrake
/// </summary>
public enum VideoScaler
{
[Display(Name = "Lanczos (default)")]
+ [ShortName("swscale")]
Lanczos = 0,
[Display(Name = "Bicubic (OpenCL)")]
+ [ShortName("opencl")]
BicubicCl,
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs
index d2ac4d5ac..796ae3cd6 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs
@@ -9,7 +9,7 @@
namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
{
- using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using System.Collections.Generic;
/// <summary>
/// Allowed Passthru Options
@@ -122,6 +122,51 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
/// </summary>
public AudioEncoder AudioEncoderFallback { get; set; }
+ /// <summary>
+ /// Gets the allowed passthru options.
+ /// </summary>
+ public IEnumerable<AudioEncoder> AllowedPassthruOptions
+ {
+ get
+ {
+ List<AudioEncoder> audioEncoders = new List<AudioEncoder>();
+ if (AudioAllowAACPass)
+ {
+ audioEncoders.Add(AudioEncoder.AacPassthru);
+ }
+ if (AudioAllowAC3Pass)
+ {
+ audioEncoders.Add(AudioEncoder.Ac3Passthrough);
+ }
+ if (AudioAllowDTSHDPass)
+ {
+ audioEncoders.Add(AudioEncoder.DtsHDPassthrough);
+ }
+ if (AudioAllowDTSPass)
+ {
+ audioEncoders.Add(AudioEncoder.DtsPassthrough);
+ }
+ if (AudioAllowMP3Pass)
+ {
+ audioEncoders.Add(AudioEncoder.Mp3Passthru);
+ }
+ if (AudioAllowTrueHDPass)
+ {
+ audioEncoders.Add(AudioEncoder.TrueHDPassthrough);
+ }
+ if (AudioAllowFlacPass)
+ {
+ audioEncoders.Add(AudioEncoder.FlacPassthru);
+ }
+ if (AudioAllowEAC3Pass)
+ {
+ audioEncoders.Add(AudioEncoder.EAc3Passthrough);
+ }
+
+ return audioEncoders;
+ }
+ }
+
#endregion
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs
index 1b83f0d40..10b28140b 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoisePreset.cs
@@ -11,27 +11,35 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
{
using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The denoise preset.
/// </summary>
public enum DenoisePreset
{
[Display(Name = "Weak")]
+ [ShortName("weak")]
Weak = 0,
[Display(Name = "Medium")]
+ [ShortName("medium")]
Medium,
[Display(Name = "Strong")]
+ [ShortName("strong")]
Strong,
[Display(Name = "Custom")]
+ [ShortName("custom")]
Custom,
[Display(Name = "Ultralight")] // NLMeans only
+ [ShortName("ultralight")]
Ultralight,
[Display(Name = "Light")] // NLMeans only
+ [ShortName("light")]
Light,
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs
index 745039a35..f58834d81 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/DenoiseTune.cs
@@ -11,24 +11,31 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
{
using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The denoise tune.
/// </summary>
public enum DenoiseTune
{
[Display(Name = "None")]
+ [ShortName("none")]
None = 0,
[Display(Name = "Film")]
+ [ShortName("film")]
Film,
[Display(Name = "Grain")]
+ [ShortName("grain")]
Grain,
[Display(Name = "High Motion")]
+ [ShortName("highmotion")]
HighMotion,
[Display(Name = "Animation")]
+ [ShortName("animation")]
Animation,
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs
index 542fb6b4e..c61abd40b 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/FramerateMode.cs
@@ -9,13 +9,20 @@
namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
{
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The Mode of Video Encoding. CFR, VFR, PFR
/// </summary>
public enum FramerateMode
{
+ [ShortName("cfr")]
CFR = 0,
+
+ [ShortName("pfr")]
PFR,
+
+ [ShortName("vfr")]
VFR
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs
index d36071b73..8f01b3f6b 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/OutputFormat.cs
@@ -12,6 +12,8 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
+ using HandBrake.ApplicationServices.Attributes;
+
/// <summary>
/// The Output format.
/// </summary>
@@ -19,10 +21,12 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models
{
[Description("MP4")]
[Display(Name = "MP4")]
+ [ShortName("av_mp4")]
Mp4 = 0,
[Description("MKV")]
[Display(Name = "MKV")]
+ [ShortName("av_mkv")]
Mkv,
}
}