diff options
author | sr55 <[email protected]> | 2016-04-09 14:46:54 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2016-04-09 14:46:54 +0100 |
commit | fc3324c8fa6c0aaa37c89d8d0bf098092d705932 (patch) | |
tree | 6789acc002fdd809e8327eb2d42bed9f440cf89e /win/CS/HandBrake.ApplicationServices/Interop | |
parent | ca2fc63cfd6a47920492bc96c3efd7e207af817d (diff) |
WinGui: Use Mixdowns from LibHBand sanitise the choices. The GUI no longer shows invalid mixdowns.
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
3 files changed, 17 insertions, 69 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs index 67f1c5483..9de57c2be 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs @@ -392,6 +392,22 @@ namespace HandBrake.ApplicationServices.Interop }
/// <summary>
+ /// Determines if a mixdown is available for a given track and encoder.
+ /// </summary>
+ /// <param name="mixdown">
+ /// The mixdown to evaluate.
+ /// </param>
+ /// <param name="encoder">
+ /// The encoder to evaluate.
+ /// </param>
+ /// <param name="channelLayout">channel layout of the source track</param>
+ /// <returns>True if available.</returns>
+ public static bool MixdownIsSupported(HBMixdown mixdown, HBAudioEncoder encoder, int channelLayout)
+ {
+ return HBFunctions.hb_mixdown_is_supported(mixdown.Id, (uint)encoder.Id, (uint)channelLayout) > 0;
+ }
+
+ /// <summary>
/// Determines if DRC can be applied to the given track with the given encoder.
/// </summary>
/// <param name="trackNumber">
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs index d77825fa6..8ad95d173 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs @@ -35,7 +35,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Presets public string AudioEncoder { get; set; }
/// <summary>
- /// Gets or sets the audio mixdown.
+ /// Gets or sets the audio mixdown. (ShortName)
/// </summary>
public string AudioMixdown { get; set; }
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs deleted file mode 100644 index 66a2d4e1a..000000000 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs +++ /dev/null @@ -1,68 +0,0 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="Mixdown.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>
-// Defines the Mixdown type.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Model.Encoding
-{
- using System.ComponentModel.DataAnnotations;
- using HandBrake.ApplicationServices.Attributes;
-
- /// <summary>
- /// The Audio Mixdown Enumeration
- /// </summary>
- public enum Mixdown
- {
- [Display(Name = "Dolby Pro Logic II")]
- [ShortName("dpl2")]
- DolbyProLogicII = 0,
-
- [Display(Name = "None")]
- [ShortName("none")]
- None,
-
- [Display(Name = "Automatic")]
- [ShortName("none")]
- Auto,
-
- [Display(Name = "Mono")]
- [ShortName("mono")]
- Mono,
-
- [Display(Name = "Mono (Left Only)")]
- [ShortName("left_only")]
- LeftOnly,
-
- [Display(Name = "Mono (Right Only)")]
- [ShortName("right_only")]
- RightOnly,
-
- [Display(Name = "Stereo")]
- [ShortName("stereo")]
- Stereo,
-
- [Display(Name = "Dolby Surround")]
- [ShortName("dpl1")]
- DolbySurround,
-
- [Display(Name = "5.1 Channels")]
- [ShortName("5point1")]
- FivePoint1Channels,
-
- [Display(Name = "6.1 Channels")]
- [ShortName("6point1")]
- SixPoint1Channels,
-
- [Display(Name = "7.1 Channels")]
- [ShortName("7point1")]
- SevenPoint1Channels,
-
- [Display(Name = "7.1 (5F/2R/LFE)")]
- [ShortName("5_2_lfe")]
- Five_2_LFE,
- }
-}
|