// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // The hand brake preset service. // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Interop { using System; using System.Collections.Generic; using System.Runtime.InteropServices; using HandBrake.ApplicationServices.Interop.HbLib; using HandBrake.ApplicationServices.Interop.Json.Presets; using HandBrake.ApplicationServices.Services.Logging; using HandBrake.ApplicationServices.Services.Logging.Model; using Newtonsoft.Json; /// /// The hand brake preset service. /// public class HandBrakePresetService { /// /// Initializes static members of the class. /// static HandBrakePresetService() { HBFunctions.hb_presets_builtin_init(); } /// /// The get built in presets. /// /// /// The . /// public static IList GetBuiltInPresets() { IntPtr presets = HBFunctions.hb_presets_builtin_get_json(); string presetJson = Marshal.PtrToStringAnsi(presets); LogHelper.LogMessage(new LogMessage(presetJson, LogMessageType.progressJson, LogLevel.debug)); IList presetList = JsonConvert.DeserializeObject>(presetJson); return presetList; } } }