diff options
author | sr55 <[email protected]> | 2020-10-04 15:41:07 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2020-10-04 15:41:15 +0100 |
commit | de8f3c5586121dcdf2b3b415464d686b9e58e3d2 (patch) | |
tree | 24d5ad72d02c602f43280295f6d5d5b0e2b56678 /win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs | |
parent | 561977956f39858d81e4786565466e63f8ddd430 (diff) |
HandBrake.Interop: Library cleanup.
- Remove HbFunctions provider class and interface. It's not needed. Interop library will direct call libhb though HBFunctions.cs
- Remove HbFunctionsDirect. Any consumer of the HandBrake API should be using managed calls rather than having to deal with pointers.
- Fix many stylecop warnings and update rulesets around this.
Diffstat (limited to 'win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs')
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs index b96a38c72..32970ecba 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// <copyright file="HandBrakeLanguagesHelper.cs" company="HandBrake Project (http://handbrake.fr)"> +// <copyright file="HandBrakeLanguagesHelper.cs" company="HandBrake Project (https://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> @@ -12,11 +12,8 @@ namespace HandBrake.Interop.Interop using System.Collections.Generic; using HandBrake.Interop.Interop.HbLib; - using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces; using HandBrake.Interop.Interop.Helpers; using HandBrake.Interop.Interop.Model; - using HandBrake.Interop.Interop.Providers; - using HandBrake.Interop.Interop.Providers.Interfaces; /// <summary> /// Contains utilities for converting language codes. @@ -25,14 +22,6 @@ namespace HandBrake.Interop.Interop { private static IList<Language> allLanguages; - private static IHbFunctions hbFunctions; - - static HandBrakeLanguagesHelper() - { - IHbFunctionsProvider hbFunctionsProvider = new HbFunctionsProvider(); - hbFunctions = hbFunctionsProvider.GetHbFunctionsWrapper(); - } - /// <summary> /// Gets a list of all languages. /// </summary> @@ -42,7 +31,7 @@ namespace HandBrake.Interop.Interop { return allLanguages ?? (allLanguages = - InteropUtilities.ToListFromIterator<iso639_lang_t, Language>(hbFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); + InteropUtilities.ToListFromIterator<iso639_lang_t, Language>(HBFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); } } @@ -53,7 +42,7 @@ namespace HandBrake.Interop.Interop /// <returns>Object that describes the language.</returns> public static Language Get(string code) { - iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(hbFunctions.lang_for_code2(code)); + iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(HBFunctions.lang_for_code2(code)); return HandBrakeUnitConversionHelpers.NativeToLanguage(language); } } |