summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-10-08 15:33:37 +0000
committersr55 <[email protected]>2011-10-08 15:33:37 +0000
commitae4e2cc4418c306249b80e7da1af006b5d1d9af2 (patch)
treef0c4bc50f4524aa22d705d9cfc5075860274317c /win/CS/HandBrake.ApplicationServices/Functions
parentf85679b10f531df9a734692058aae734789267e5 (diff)
WinGui: Converters and cli query handling code update for new x264 options.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4273 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Functions')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/Converters.cs117
1 files changed, 116 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
index 34f9db46e..5557d2488 100644
--- a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
+++ b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
@@ -9,6 +9,7 @@ namespace HandBrake.ApplicationServices.Functions
using System.Text.RegularExpressions;
using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding.x264;
using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
@@ -90,6 +91,7 @@ namespace HandBrake.ApplicationServices.Functions
return Mixdown.DolbyProLogicII;
case "6 Channel Discrete":
return Mixdown.SixChannelDiscrete;
+ case "None":
case "Passthru":
return Mixdown.None;
default:
@@ -153,6 +155,8 @@ namespace HandBrake.ApplicationServices.Functions
return "DTS-HD Passthru";
case "ffaac":
return "AAC (ffmpeg)";
+ case "ffflac":
+ return "Flac (ffmpeg)";
default:
return "AAC (faac)";
}
@@ -177,6 +181,8 @@ namespace HandBrake.ApplicationServices.Functions
return AudioEncoder.Vorbis;
case "ac3":
return AudioEncoder.Ac3;
+ case "ffflac":
+ return AudioEncoder.ffflac;
case "copy:ac3":
return AudioEncoder.Ac3Passthrough;
case "copy:dts":
@@ -223,6 +229,8 @@ namespace HandBrake.ApplicationServices.Functions
return AudioEncoder.AacPassthru;
case "MP3 Passthru":
return AudioEncoder.Mp3Passthru;
+ case "Flac (ffmpeg)":
+ return AudioEncoder.ffflac;
default:
return AudioEncoder.Faac;
}
@@ -261,7 +269,8 @@ namespace HandBrake.ApplicationServices.Functions
return "copy:aac";
case AudioEncoder.Mp3Passthru:
return "copy:mp3";
-
+ case AudioEncoder.ffflac:
+ return "ffflac";
default:
return "faac";
}
@@ -325,6 +334,112 @@ namespace HandBrake.ApplicationServices.Functions
#endregion
+ #region x264
+
+ /// <summary>
+ /// Get the x264Preset from a cli parameter
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ /// <returns>
+ /// The x264Preset enum value
+ /// </returns>
+ public static x264Preset Getx264PresetFromCli(string preset)
+ {
+ switch (preset)
+ {
+ case "ultrafast":
+ return x264Preset.Ultrafast;
+ case "superfast":
+ return x264Preset.Superfast;
+ case "veryfast":
+ return x264Preset.VeryFast;
+ case "faster":
+ return x264Preset.Faster;
+ case "fast":
+ return x264Preset.Fast;
+ case "medium":
+ return x264Preset.Medium;
+ case "slow":
+ return x264Preset.Slow;
+ case "slower":
+ return x264Preset.Slower;
+ case "veryslow":
+ return x264Preset.VerySlow;
+ case "placebo":
+ return x264Preset.Placebo;
+ default:
+ return x264Preset.Faster;
+ }
+ }
+
+ /// <summary>
+ /// Get the x264 Profile from the cli
+ /// </summary>
+ /// <param name="profile">
+ /// The preset.
+ /// </param>
+ /// <returns>
+ /// The x264Profile enum value
+ /// </returns>
+ public static x264Profile Getx264ProfileFromCli(string profile)
+ {
+ switch (profile)
+ {
+ case "baseline":
+ return x264Profile.Baseline;
+ case "main":
+ return x264Profile.Main;
+ case "high":
+ return x264Profile.High;
+ case "high10":
+ return x264Profile.High10;
+ case "high422":
+ return x264Profile.High422;
+ case "high444":
+ return x264Profile.High444;
+ default:
+ return x264Profile.Main;
+ }
+ }
+
+ /// <summary>
+ /// Get x264Tune enum from a cli string
+ /// </summary>
+ /// <param name="tune">
+ /// The tune.
+ /// </param>
+ /// <returns>
+ /// The x264Tune enum value
+ /// </returns>
+ public static x264Tune Getx264TuneFromCli(string tune)
+ {
+ switch (tune)
+ {
+ case "film":
+ return x264Tune.Film;
+ case "animation":
+ return x264Tune.Animation;
+ case "grain":
+ return x264Tune.Grain;
+ case "stillimage":
+ return x264Tune.Stillimage;
+ case "psnr":
+ return x264Tune.Psnr;
+ case "ssim":
+ return x264Tune.Ssim;
+ case "fastdecode":
+ return x264Tune.Fastdecode;
+ case "zerolatency":
+ return x264Tune.Zerolatency;
+ default:
+ return x264Tune.Film;
+ }
+ }
+
+ #endregion
+
#region File Format
/// <summary>