summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/Functions/PresetLoader.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/Converters.cs6
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/EnumHelper.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs1
-rw-r--r--win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/VideoEncoder.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs1
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs3
-rw-r--r--win/CS/frmQueue.Designer.cs4
-rw-r--r--win/CS/frmQueue.cs16
12 files changed, 41 insertions, 40 deletions
diff --git a/win/CS/Functions/PresetLoader.cs b/win/CS/Functions/PresetLoader.cs
index b3c213469..5e95cfcf2 100644
--- a/win/CS/Functions/PresetLoader.cs
+++ b/win/CS/Functions/PresetLoader.cs
@@ -13,6 +13,10 @@ namespace Handbrake.Functions
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop.Model.Encoding;
+
+ using Anamorphic = HandBrake.ApplicationServices.Model.Encoding.Anamorphic;
+ using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
/// <summary>
/// Load a preset into the main Window
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:
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
index f0faac2ba..0f993c09c 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
@@ -19,6 +19,9 @@ namespace HandBrake.Interop.Model.Encoding
[Display(Name = "MPEG-4 (FFMpeg)")]
FFMpeg,
+ [Display(Name = "MPEG-2 (FFMpeg)")]
+ FFMpeg2,
+
[Display(Name = "VP3 (Theora)")]
Theora
}
diff --git a/win/CS/frmQueue.Designer.cs b/win/CS/frmQueue.Designer.cs
index a1dcb886c..5a4924325 100644
--- a/win/CS/frmQueue.Designer.cs
+++ b/win/CS/frmQueue.Designer.cs
@@ -377,8 +377,8 @@ namespace Handbrake
this.lbl_encodesPending.Size = new System.Drawing.Size(115, 17);
this.lbl_encodesPending.Text = "0 encode(s) pending";
this.lbl_encodesPending.ToolTipText = "- Displays the number of jobs remaining to process.\r\n- Displays the time for the " +
- "current processing session. \r\n (Note, this is reset every time you press encode" +
- ", including after a pause)";
+ "current processing session. \r\n (Note, this is reset every time you press encode" +
+ ", including after a pause)";
//
// OpenFile
//
diff --git a/win/CS/frmQueue.cs b/win/CS/frmQueue.cs
index 2d94d266c..6bc7081f5 100644
--- a/win/CS/frmQueue.cs
+++ b/win/CS/frmQueue.cs
@@ -21,9 +21,12 @@ namespace Handbrake
using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
+ using HandBrake.Interop.Model.Encoding;
using Model;
+ using AudioEncoder = HandBrake.ApplicationServices.Model.Encoding.AudioEncoder;
+
/// <summary>
/// The Queue Window
/// </summary>
@@ -354,14 +357,14 @@ namespace Handbrake
item.SubItems.Add(chapters); // Chapters
item.SubItems.Add(queueItem.Source); // Source
item.SubItems.Add(queueItem.Destination); // Destination
- item.SubItems.Add(EnumHelper<VideoEncoder>.GetDescription(parsed.VideoEncoder));
+ item.SubItems.Add(EnumHelper<VideoEncoder>.GetDisplayValue(parsed.VideoEncoder));
// Display The Audio Track Information
string audio = string.Empty;
foreach (AudioTrack track in parsed.AudioTracks)
{
if (audio != string.Empty)
- audio += ", " + track.Encoder;
+ audio += ", " + EnumHelper<AudioEncoder>.GetDescription(track.Encoder);
else
audio = EnumHelper<AudioEncoder>.GetDescription(track.Encoder);
}
@@ -429,7 +432,7 @@ namespace Handbrake
foreach (AudioTrack track in parsed.AudioTracks)
{
if (audio != string.Empty)
- audio += ", " + track.Encoder;
+ audio += ", " + EnumHelper<AudioEncoder>.GetDescription(track.Encoder);
else
audio = EnumHelper<AudioEncoder>.GetDescription(track.Encoder);
}
@@ -438,8 +441,11 @@ namespace Handbrake
lbl_encodeStatus.Text = "Encoding ...";
lbl_source.Text = queue.QueueManager.LastProcessedJob.Source + "(Title: " + title + " Chapters: " + chapterlbl + ")";
lbl_dest.Text = queue.QueueManager.LastProcessedJob.Destination;
- lbl_encodeOptions.Text = "Video: " + parsed.VideoEncoder + " Audio: " + audio + Environment.NewLine +
- "x264 Options: " + parsed.AdvancedEncoderOptions;
+ lbl_encodeOptions.Text = string.Format("Video: {0}, Audio: {1}\nx264 Options: {2}",
+ EnumHelper<VideoEncoder>.GetDisplayValue(parsed.VideoEncoder),
+ audio,
+ parsed.AdvancedEncoderOptions);
+
}
catch (Exception)
{