diff options
author | RandomEngy <[email protected]> | 2017-11-16 23:02:28 -0800 |
---|---|---|
committer | Scott <[email protected]> | 2017-11-18 14:29:34 +0000 |
commit | 2c5f96a2fdbe7407fd360e424ac43cac0fd3ad26 (patch) | |
tree | 7cf68cacb9d7f20df5d8cd52e3eed489b298c796 /win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs | |
parent | 17a4bb75f924854532636f4e3450ae9f4a4d8c81 (diff) |
Some additions for mixdowns and ability encode from JSON string.
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs index b0e72976a..125c04449 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs @@ -244,6 +244,16 @@ namespace HandBrake.ApplicationServices.Interop return Mixdowns.SingleOrDefault(m => m.ShortName == shortName);
}
+ /// <summary>
+ /// Gets the mixdown with the specified ID.
+ /// </summary>
+ /// <param name="id">The mixdown ID.</param>
+ /// <returns>The requested mixdown.</returns>
+ public static HBMixdown GetMixdown(int id)
+ {
+ return Mixdowns.SingleOrDefault(m => m.Id == id);
+ }
+
/// <summary>
/// Gets the container with the specified short name.
/// </summary>
@@ -489,6 +499,17 @@ namespace HandBrake.ApplicationServices.Interop return Mixdowns.Single(m => m.Id == defaultMixdown);
}
+ /// <summary>
+ /// Sanitizes the given sample rate for the given encoder.
+ /// </summary>
+ /// <param name="encoder">The encoder.</param>
+ /// <param name="sampleRate">The sample rate to sanitize.</param>
+ /// <returns>The sanitized sample rate.</returns>
+ public static int SanitizeSampleRate(HBAudioEncoder encoder, int sampleRate)
+ {
+ return HBFunctions.hb_audio_samplerate_find_closest(sampleRate, (uint)encoder.Id);
+ }
+
/// <summary>
/// Gets the bitrate limits for the given audio codec, sample rate and mixdown.
/// </summary>
|