From d4327b0f304b99a7650b12622b48e6145794ab65 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 16 Feb 2014 18:39:29 +0000 Subject: WinGui: Initial work to refactor the Audio and Subtitle behavioural based automatic track selections. This is not quite complete yet but close enough for gathering feedback. - Simplified UI design that's now available on the "Subtitle" and "Audio" tabs rather than the Options screen. The settings are no longer part of the app preferences. They are now per-preset. Build in presets default to None. - Selected Languages can now be set independently for Audio and Video. - Preferred Language is now part of the Selected Languages list. - Warning: Import/Export of presets still to be implemented. Design may yet change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6036 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Utilities/Converters.cs | 2 +- .../Utilities/LanguageUtilities.cs | 39 +++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Utilities') diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs index 1c6b785bb..9651c6e71 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs @@ -129,7 +129,7 @@ namespace HandBrake.ApplicationServices.Utilities { case Mixdown.Auto: case Mixdown.None: - return "auto"; + return "none"; case Mixdown.Mono: return "mono"; case Mixdown.LeftOnly: diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs index bbfe8f62c..94a1fb201 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs @@ -11,6 +11,7 @@ namespace HandBrake.ApplicationServices.Utilities { using System.Collections.Generic; using System.Collections.Specialized; + using System.Linq; /// /// Language Utilities @@ -248,6 +249,42 @@ namespace HandBrake.ApplicationServices.Utilities } return iso6392Codes; - } + } + + /// + /// The get language codes. + /// + /// + /// The user languages. + /// + /// + /// The . + /// + public static List GetLanguageCodes(IList userLanguages) + { + // Translate to Iso Codes + List iso6392Codes = new List(); + foreach (var item in userLanguages) + { + string isoCode; + if (LanguageUtilities.MapLanguages().TryGetValue(item, out isoCode)) + { + iso6392Codes.Add(isoCode); + } + } + + return iso6392Codes; + } + + /// + /// The get iso codes. + /// + /// + /// The . + /// + public static List GetIsoCodes() + { + return MapLanguages().Values.ToList(); + } } } -- cgit v1.2.3