summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Interop
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-05-03 17:29:45 +0000
committersr55 <[email protected]>2015-05-03 17:29:45 +0000
commit99aa2bf7c9bfa34d1bf822d70da22243fbbdd344 (patch)
treeaeda9214568a48dac6fcac2fb8902d73fe8ae378 /win/CS/HandBrake.ApplicationServices/Interop
parent0be4e18bacefa6b7bc63731b4a004a6ff772af20 (diff)
WinGui: Fix Line Endings and (StyleCop)Warnings
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7152 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs20
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs98
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs11
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs11
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs11
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs131
7 files changed, 165 insertions, 121 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs
index 741723329..5c49c5073 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs
@@ -64,14 +64,16 @@ namespace HandBrake.ApplicationServices.Interop.Factories
DestSettings = new DestSettings
{
AnamorphicMode = (int)job.Anamorphic,
- Geometry = {
- Width = job.Width ?? 0, Height = job.Height ?? 0,
- PAR = new PAR
- {
- Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
- Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
- }
- },
+ Geometry =
+ {
+ Width = job.Width ?? 0,
+ Height = job.Height ?? 0,
+ PAR = new PAR
+ {
+ Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
+ Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
+ }
+ },
Keep = settingMode,
Crop = new List<int> { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
Modulus = job.Modulus ?? 16,
@@ -98,7 +100,7 @@ namespace HandBrake.ApplicationServices.Interop.Factories
/// </summary>
/// <param name="settings">The preview settings.</param>
/// <param name="title">Information on the title to consider.</param>
- /// <returns></returns>
+ /// <returns>Geometry Information</returns>
public static Geometry CreateGeometry(PreviewSettings settings, SourceVideoInfo title)
{
int settingMode = settings.KeepDisplayAspect ? 0x04 : 0;
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
index aad5df21c..ccbaee4c1 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
@@ -20,18 +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>
- /// 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.
@@ -223,12 +223,12 @@ namespace HandBrake.ApplicationServices.Interop
public static bool IsH264LevelValid(string level, int width, int height, int fpsNumerator, int fpsDenominator, bool interlaced, bool fakeInterlaced)
{
return HBFunctions.hb_check_h264_level(
- level,
- width,
- height,
- fpsNumerator,
- fpsDenominator,
- interlaced ? 1 : 0,
+ level,
+ width,
+ height,
+ fpsNumerator,
+ fpsDenominator,
+ interlaced ? 1 : 0,
fakeInterlaced ? 1 : 0) == 0;
}
@@ -260,12 +260,12 @@ namespace HandBrake.ApplicationServices.Interop
/// The full x264 options string from the given inputs.
/// </returns>
public static string CreateX264OptionsString(
- string preset,
- IList<string> tunes,
- string extraOptions,
- string profile,
- string level,
- int width,
+ string preset,
+ IList<string> tunes,
+ string extraOptions,
+ string profile,
+ string level,
+ int width,
int height)
{
if (width <= 0)
@@ -279,35 +279,35 @@ namespace HandBrake.ApplicationServices.Interop
}
IntPtr ptr = HBFunctions.hb_x264_param_unparse(
- preset,
- string.Join(",", tunes),
- extraOptions,
- profile,
- level,
- width,
+ preset,
+ string.Join(",", tunes),
+ extraOptions,
+ profile,
+ level,
+ width,
height);
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.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs
index 3a8aedec7..af4ece97e 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs
@@ -1,7 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="SubtitleTrack.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>
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleTrack.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>
+// Represents a subtitle track to encode.
+// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Interop.Json.Encode
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs
index 091f9a4f8..b26baea0e 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs
@@ -1,7 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="SourceAudioTrack.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>
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceAudioTrack.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>
+// An audio track from the source video.
+// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Interop.Json.Scan
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs
index fce479ff1..fb0d84955 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs
@@ -1,7 +1,10 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="SourceChapter.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>
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceChapter.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>
+// The a chapter from a video source.
+// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Interop.Json.Scan
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs
index a748fc99e..62ff64200 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs
@@ -15,12 +15,12 @@ namespace HandBrake.ApplicationServices.Interop.Model
public class BitrateLimits
{
/// <summary>
- /// The inclusive lower limit for the bitrate.
+ /// Gets or sets the inclusive lower limit for the bitrate.
/// </summary>
public int Low { get; set; }
/// <summary>
- /// The inclusive upper limit for the bitrate.
+ /// Gets or sets the inclusive upper limit for the bitrate.
/// </summary>
public int High { get; set; }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
index af1a166ce..bcc7f2714 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
@@ -6,52 +6,85 @@
// The preview settings.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Model.Preview
-{
- using HandBrake.ApplicationServices.Interop.Model.Encoding;
- using HandBrake.ApplicationServices.Services.Encode.Model;
-
- /// <summary>
- /// The preview settings.
- /// </summary>
- public class PreviewSettings
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
- /// </summary>
- public PreviewSettings()
- {
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
- /// </summary>
- /// <param name="task">The task.</param>
- public PreviewSettings(EncodeTask task)
- {
- }
-
- public Cropping Cropping { get; set; }
-
- public int MaxWidth { get; set; }
-
- public int MaxHeight { get; set; }
-
- public bool KeepDisplayAspect { get; set; }
-
- public int TitleNumber { get; set; }
-
- public Anamorphic Anamorphic { get; set; }
-
- public int? Modulus { get; set; }
-
- public int Width { get; set; }
-
- public int Height { get; set; }
-
- public int PixelAspectX { get; set; }
-
- public int PixelAspectY { get; set; }
- }
-}
+
+namespace HandBrake.ApplicationServices.Interop.Model.Preview
+{
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Encode.Model;
+
+ /// <summary>
+ /// The preview settings.
+ /// </summary>
+ public class PreviewSettings
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
+ /// </summary>
+ public PreviewSettings()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
+ /// </summary>
+ /// <param name="task">The task.</param>
+ public PreviewSettings(EncodeTask task)
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the cropping.
+ /// </summary>
+ public Cropping Cropping { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max width.
+ /// </summary>
+ public int MaxWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max height.
+ /// </summary>
+ public int MaxHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether keep display aspect.
+ /// </summary>
+ public bool KeepDisplayAspect { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title number.
+ /// </summary>
+ public int TitleNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the anamorphic.
+ /// </summary>
+ public Anamorphic Anamorphic { get; set; }
+
+ /// <summary>
+ /// Gets or sets the modulus.
+ /// </summary>
+ public int? Modulus { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect x.
+ /// </summary>
+ public int PixelAspectX { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect y.
+ /// </summary>
+ public int PixelAspectY { get; set; }
+ }
+}