summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorScott <[email protected]>2015-09-26 21:29:34 +0100
committerScott <[email protected]>2015-09-26 21:30:33 +0100
commitc19ea798a23bfea7aba509309bef9168ece09836 (patch)
tree72c318fc971208bfcb0149bd98efef6a63f85926 /win/CS/HandBrakeWPF
parenta6cf5c5fd4b4c23ad3998ff270162768ce9ae6e7 (diff)
App Services Modelling Tidy Up
Making event objects immutable. Making Libhb constructs internal to the library. We should expose this with a managed api if we need it outside the library. (Part 1)
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj1
-rw-r--r--win/CS/HandBrakeWPF/Helpers/PictureSize.cs2
-rw-r--r--win/CS/HandBrakeWPF/Helpers/Validate.cs39
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs1
4 files changed, 42 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index 808b3d015..fa2b4bf5a 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -155,6 +155,7 @@
<Compile Include="EventArgs\SettingChangedEventArgs.cs" />
<Compile Include="Exceptions\GeneralApplicationException.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
+ <Compile Include="Helpers\Validate.cs" />
<Compile Include="Model\Audio\AudioTrackDefaultsMode.cs" />
<Compile Include="Model\Audio\AudioBehaviourModes.cs" />
<Compile Include="Model\Audio\AudioBehaviours.cs" />
diff --git a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs
index 12a994914..5090339b5 100644
--- a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs
+++ b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs
@@ -184,7 +184,7 @@ namespace HandBrakeWPF.Helpers
keep = settingMode,
maxWidth = job.MaxWidth,
maxHeight = job.MaxHeight,
- mode = (int)(hb_anamorphic_mode_t)job.AnamorphicMode,
+ mode = (int)job.AnamorphicMode,
modulus = job.Modulus.HasValue ? job.Modulus.Value : 16,
geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW }}
};
diff --git a/win/CS/HandBrakeWPF/Helpers/Validate.cs b/win/CS/HandBrakeWPF/Helpers/Validate.cs
new file mode 100644
index 000000000..7d307dfbc
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Helpers/Validate.cs
@@ -0,0 +1,39 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Validate.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 validate.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Helpers
+{
+ using System;
+
+ /// <summary>
+ /// The validate.
+ /// </summary>
+ public class Validate
+ {
+ /// <summary>
+ /// The not null.
+ /// </summary>
+ /// <param name="item">
+ /// The item.
+ /// </param>
+ /// <param name="message">
+ /// The message.
+ /// </param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the input object is null
+ /// </exception>
+ public static void NotNull(object item, string message)
+ {
+ if (item == null)
+ {
+ throw new ArgumentException(message);
+ }
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
index bf456c859..10037fc55 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
@@ -36,6 +36,7 @@ namespace HandBrakeWPF.Services.Encode.Factories
using PointToPointMode = HandBrakeWPF.Services.Encode.Model.Models.PointToPointMode;
using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles;
using SubtitleTrack = HandBrakeWPF.Services.Encode.Model.Models.SubtitleTrack;
+ using Validate = HandBrakeWPF.Helpers.Validate;
/// <summary>
/// This factory takes the internal EncodeJob object and turns it into a set of JSON models