diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
8 files changed, 21 insertions, 33 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs index b1d92f5d1..e12639e1d 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs @@ -8,7 +8,11 @@ namespace HandBrake.ApplicationServices.Functions using System;
using System.Text.RegularExpressions;
- using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding;
+
+ using AudioEncoder = HandBrake.ApplicationServices.Model.Encoding.AudioEncoder;
+ using Mixdown = HandBrake.ApplicationServices.Model.Encoding.Mixdown;
+ using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
/// <summary>
/// A class to convert various things to native C# objects
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs b/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs index 657434f31..53d7f6069 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs @@ -7,6 +7,7 @@ namespace HandBrake.ApplicationServices.Functions {
using System;
using System.ComponentModel;
+ using System.ComponentModel.DataAnnotations;
using System.Reflection;
/// <summary>
@@ -36,6 +37,19 @@ namespace HandBrake.ApplicationServices.Functions }
/// <summary>
+ /// Get the Display Value of the Enum Model
+ /// </summary>
+ /// <param name="value">An Enum with Display Attributes</param>
+ /// <returns>A string name</returns>
+ public static string GetDisplayValue(T value)
+ {
+ FieldInfo fieldInfo = value.GetType().GetField(value.ToString());
+ DisplayAttribute[] attributes = (DisplayAttribute[])fieldInfo.GetCustomAttributes(typeof(DisplayAttribute), false);
+
+ return (attributes.Length > 0) ? attributes[0].Name : value.ToString();
+ }
+
+ /// <summary>
/// Get the Enumeration for a given Enum Description
/// </summary>
/// <param name="description">The String description</param>
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs index 70dc8ea9c..8475c9bd2 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs @@ -14,7 +14,6 @@ namespace HandBrake.ApplicationServices.Functions using HandBrake.Interop.Model.Encoding;
using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
- using VideoEncoder = HandBrake.ApplicationServices.Model.Encoding.VideoEncoder;
/// <summary>
/// A Utility Class to Convert a
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index d9fc865ca..58e2b10fe 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -64,6 +64,7 @@ <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
@@ -106,7 +107,6 @@ <Compile Include="Model\EncodeTask.cs" />
<Compile Include="Model\Encoding\OutputFormat.cs" />
<Compile Include="Model\Encoding\SubtitleTrack.cs" />
- <Compile Include="Model\Encoding\VideoEncoder.cs" />
<Compile Include="Model\General\UpdateCheckInformation.cs" />
<Compile Include="Model\General\UpdateCheckResult.cs" />
<Compile Include="Model\ModelBase.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs index 430700ee1..2113c8605 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs @@ -13,7 +13,6 @@ namespace HandBrake.ApplicationServices.Model using Anamorphic = HandBrake.ApplicationServices.Model.Encoding.Anamorphic;
using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
- using VideoEncoder = HandBrake.ApplicationServices.Model.Encoding.VideoEncoder;
/// <summary>
/// An Encode Task
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/VideoEncoder.cs deleted file mode 100644 index 766fa09aa..000000000 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/VideoEncoder.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* VideoEncoder.cs $
- This file is part of the HandBrake source code.
- Homepage: <http://handbrake.fr>.
- It may be used under the terms of the GNU General Public License. */
-
-namespace HandBrake.ApplicationServices.Model.Encoding
-{
- using System.ComponentModel;
-
- /// <summary>
- /// The Video Encoder
- /// </summary>
- public enum VideoEncoder
- {
- [Description("H.264 (x264)")]
- X264 = 0,
-
- [Description("MPEG-4 (FFMpeg)")]
- FFMpeg,
-
- [Description("MPEG-2 (FFMpeg)")]
- FFMpeg2,
-
- [Description("VP3 (Theora)")]
- Theora
- }
-}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs index bea345106..caa40d9b6 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs @@ -554,7 +554,7 @@ namespace HandBrake.ApplicationServices.Utilities // Video Settings
AddEncodeElement(xmlWriter, "VideoAvgBitrate", "string", parsed.VideoBitrate.ToString());
- AddEncodeElement(xmlWriter, "VideoEncoder", "string", EnumHelper<Enum>.GetDescription(parsed.VideoEncoder));
+ AddEncodeElement(xmlWriter, "VideoEncoder", "string", EnumHelper<VideoEncoder>.GetDisplayValue(parsed.VideoEncoder));
AddEncodeElement(xmlWriter, "VideoFramerate", "string", parsed.Framerate.ToString());
AddEncodeElement(xmlWriter, "VideFrameratePFR", "integer", parsed.FramerateMode == FramerateMode.PFR ? "1" : "0");
AddEncodeElement(xmlWriter, "VideoGrayScale", "integer", parsed.Grayscale ? "1" : "0");
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs index 934bc6c41..1567d4d16 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs @@ -18,7 +18,6 @@ namespace HandBrake.ApplicationServices.Utilities using Anamorphic = HandBrake.ApplicationServices.Model.Encoding.Anamorphic;
using AudioEncoder = HandBrake.ApplicationServices.Model.Encoding.AudioEncoder;
using Mixdown = HandBrake.ApplicationServices.Model.Encoding.Mixdown;
- using VideoEncoder = HandBrake.ApplicationServices.Model.Encoding.VideoEncoder;
/*
* TODO:
|