diff options
author | sr55 <[email protected]> | 2015-05-03 17:18:59 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-05-03 17:18:59 +0000 |
commit | 0be4e18bacefa6b7bc63731b4a004a6ff772af20 (patch) | |
tree | 405ba4add7d0086d363a44e00a6b8a7ddc1c0163 /win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs | |
parent | 6689ba81c2919ef34d85da357d4b56b90507824b (diff) |
WinGui: Some Model Re-factoring by RandomEngy
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7151 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs index 7a00bb8e9..aad5df21c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs @@ -20,23 +20,18 @@ namespace HandBrake.ApplicationServices.Interop using HandBrake.ApplicationServices.Interop.Json.Shared;
using HandBrake.ApplicationServices.Services.Logging;
using HandBrake.ApplicationServices.Services.Logging.Model;
-
- using Newtonsoft.Json;
-
- /// <summary>
- /// HandBrake Interop Utilities
- /// </summary>
- public static class HandBrakeUtils
- {
- /// <summary>
- /// Estimated overhead in bytes for each frame in output container.
- /// </summary>
- internal const int ContainerOverheadPerFrame = 6;
-
- /// <summary>
- /// The callback for log messages from HandBrake.
- /// </summary>
- private static LoggingCallback loggingCallback;
+ + using Newtonsoft.Json; + + /// <summary> + /// HandBrake Interop Utilities + /// </summary> + public static class HandBrakeUtils + { + /// <summary> + /// The callback for log messages from HandBrake. + /// </summary> + private static LoggingCallback loggingCallback; /// <summary>
/// The callback for error messages from HandBrake.
@@ -294,25 +289,25 @@ namespace HandBrake.ApplicationServices.Interop string x264Settings = Marshal.PtrToStringAnsi(ptr);
- return x264Settings;
- }
-
- /// <summary>
- /// Gets the final size and PAR of the video, given anamorphic inputs.
- /// </summary>
- /// <param name="anamorphicGeometry">Anamorphic inputs.</param>
- /// <returns>The final size and PAR of the video.</returns>
- public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry)
- {
- string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
- LogHelper.LogMessage(new LogMessage(encode, LogMessageType.encodeJson, LogLevel.debug));
- IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode));
- string result = Marshal.PtrToStringAnsi(json);
- return JsonConvert.DeserializeObject<Geometry>(result);
- }
-
- /// <summary>
- /// Sends the message logged event to any registered listeners.
+ return x264Settings; + } + + /// <summary> + /// Gets the final size and PAR of the video, given anamorphic inputs. + /// </summary> + /// <param name="anamorphicGeometry">Anamorphic inputs.</param> + /// <returns>The final size and PAR of the video.</returns> + public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry) + { + string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); + LogHelper.LogMessage(new LogMessage(encode, LogMessageType.encodeJson, LogLevel.debug)); + IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode)); + string result = Marshal.PtrToStringAnsi(json); + return JsonConvert.DeserializeObject<Geometry>(result); + } + + /// <summary> + /// Sends the message logged event to any registered listeners. /// </summary>
/// <param name="message">
/// The message to send.
|