diff options
Diffstat (limited to 'win/CS')
34 files changed, 591 insertions, 265 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs index 320b96f1b..0d1998a59 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs @@ -11,12 +11,14 @@ namespace HandBrake.ApplicationServices.Services {
using System;
using System.Diagnostics;
+ using System.Globalization;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Base;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
+ using HandBrake.Interop.EventArgs;
using HandBrake.Interop.Interfaces;
using HandBrake.Interop.Model;
@@ -174,8 +176,8 @@ namespace HandBrake.ApplicationServices.Services {
this.IsEncoding = false;
this.instance.StopEncode();
- }
- catch(Exception)
+ }
+ catch (Exception)
{
// Do Nothing.
}
@@ -239,7 +241,7 @@ namespace HandBrake.ApplicationServices.Services /// <param name="e">
/// The Interop.EncodeProgressEventArgs.
/// </param>
- private void InstanceEncodeProgress(object sender, Interop.EncodeProgressEventArgs e)
+ private void InstanceEncodeProgress(object sender, Interop.EventArgs.EncodeProgressEventArgs e)
{
EncodeProgressEventArgs args = new EncodeProgressEventArgs
{
@@ -256,7 +258,7 @@ namespace HandBrake.ApplicationServices.Services if (this.WindowsSeven.IsWindowsSeven)
{
int percent;
- int.TryParse(Math.Round(e.FractionComplete).ToString(), out percent);
+ int.TryParse(Math.Round(e.FractionComplete).ToString(CultureInfo.InvariantCulture), out percent);
this.WindowsSeven.SetTaskBarProgress(percent);
}
@@ -271,7 +273,7 @@ namespace HandBrake.ApplicationServices.Services /// <param name="e">
/// The e.
/// </param>
- private void InstanceEncodeCompleted(object sender, Interop.EncodeCompletedEventArgs e)
+ private void InstanceEncodeCompleted(object sender, Interop.EventArgs.EncodeCompletedEventArgs e)
{
this.IsEncoding = false;
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs index c3598d922..8dfb5ca12 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs @@ -20,10 +20,11 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
+ using HandBrake.Interop.EventArgs;
using HandBrake.Interop.Interfaces;
using AudioTrack = HandBrake.ApplicationServices.Parsing.Audio;
- using ScanProgressEventArgs = HandBrake.Interop.ScanProgressEventArgs;
+ using ScanProgressEventArgs = HandBrake.Interop.EventArgs.ScanProgressEventArgs;
using Size = System.Drawing.Size;
/// <summary>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs index 00fc4e4e8..1dc2a1e74 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs @@ -17,12 +17,15 @@ namespace HandBrake.Interop using HandBrake.Interop.SourceData;
using HandBrake.Interop.Model;
+ /// <summary>
+ /// The converters.
+ /// </summary>
public static class Converters
{
/// <summary>
/// Video Frame Rates
/// </summary>
- private static Dictionary<double, int> vrates = new Dictionary<double, int>
+ private static readonly Dictionary<double, int> VideoRates = new Dictionary<double, int>
{
{5, 5400000},
{10, 2700000},
@@ -52,12 +55,12 @@ namespace HandBrake.Interop /// </exception>
public static int FramerateToVrate(double framerate)
{
- if (!vrates.ContainsKey(framerate))
+ if (!VideoRates.ContainsKey(framerate))
{
throw new ArgumentException("Framerate not recognized.", "framerate");
}
- return vrates[framerate];
+ return VideoRates[framerate];
}
/// <summary>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/EncodeCompletedEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/EncodeCompletedEventArgs.cs index aa71b3a14..2169c6e4d 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/EncodeCompletedEventArgs.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/EncodeCompletedEventArgs.cs @@ -7,9 +7,9 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.Interop
+namespace HandBrake.Interop.EventArgs
{
- using System;
+ using System;
/// <summary>
/// Encode Completed Event Args
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/EncodeProgressEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/EncodeProgressEventArgs.cs index 73802fafd..9e2883e3b 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/EncodeProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/EncodeProgressEventArgs.cs @@ -7,11 +7,11 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.Interop
+namespace HandBrake.Interop.EventArgs
{
- using System;
+ using System;
- /// <summary>
+ /// <summary>s
/// Encode Progress Event Args
/// </summary>
public class EncodeProgressEventArgs : EventArgs
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/MessageLoggedEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/MessageLoggedEventArgs.cs index fd33c9ef3..0649c52f4 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/MessageLoggedEventArgs.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/MessageLoggedEventArgs.cs @@ -7,11 +7,11 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.Interop
+namespace HandBrake.Interop.EventArgs
{
- using System;
+ using System;
- /// <summary>
+ /// <summary>
/// The Message Logged Event Args
/// </summary>
public class MessageLoggedEventArgs : EventArgs
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/ScanProgressEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs index ce20a4f9d..b342c8f12 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/ScanProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs @@ -7,9 +7,9 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.Interop
+namespace HandBrake.Interop.EventArgs
{
- using System;
+ using System;
/// <summary>
/// The Scan Progress Event Args
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index a2bf8cef9..0a1c8a32c 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -17,6 +17,7 @@ namespace HandBrake.Interop using System.Runtime.InteropServices;
using System.Windows.Media.Imaging;
+ using HandBrake.Interop.EventArgs;
using HandBrake.Interop.HbLib;
using HandBrake.Interop.Interfaces;
using HandBrake.Interop.Model;
@@ -124,7 +125,7 @@ namespace HandBrake.Interop /// <summary>
/// Fires when a scan has completed.
/// </summary>
- public event EventHandler<EventArgs> ScanCompleted;
+ public event EventHandler<System.EventArgs> ScanCompleted;
/// <summary>
/// Fires for progress updates when encoding.
@@ -785,7 +786,7 @@ namespace HandBrake.Interop if (this.ScanCompleted != null)
{
- this.ScanCompleted(this, new EventArgs());
+ this.ScanCompleted(this, new System.EventArgs());
}
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj index 3fbeace49..6de4a9adb 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj @@ -125,8 +125,8 @@ </ItemGroup>
<ItemGroup>
<Compile Include="Converters.cs" />
- <Compile Include="EncodeCompletedEventArgs.cs" />
- <Compile Include="EncodeProgressEventArgs.cs" />
+ <Compile Include="EventArgs\EncodeCompletedEventArgs.cs" />
+ <Compile Include="EventArgs\EncodeProgressEventArgs.cs" />
<Compile Include="HandBrakeUtils.cs" />
<Compile Include="HandBrakeInstance.cs" />
<Compile Include="HbLib\HBFunctions.cs" />
@@ -144,7 +144,7 @@ <Compile Include="Language.cs" />
<Compile Include="LanguageCodes.cs" />
<Compile Include="MarshalingConstants.cs" />
- <Compile Include="MessageLoggedEventArgs.cs" />
+ <Compile Include="EventArgs\MessageLoggedEventArgs.cs" />
<Compile Include="Model\Cropping.cs" />
<Compile Include="Model\EncodeJob.cs" />
<Compile Include="Model\Encoders.cs" />
@@ -179,7 +179,7 @@ <Compile Include="Model\VideoRangeType.cs" />
<Compile Include="NativeList.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ScanProgressEventArgs.cs" />
+ <Compile Include="EventArgs\ScanProgressEventArgs.cs" />
<Compile Include="SourceData\AudioCodec.cs" />
<Compile Include="SourceData\AudioTrack.cs" />
<Compile Include="SourceData\Chapter.cs" />
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs index 6fde37c57..568e41a31 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs @@ -12,6 +12,8 @@ namespace HandBrake.Interop using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
+
+ using HandBrake.Interop.EventArgs;
using HandBrake.Interop.HbLib;
using HandBrake.Interop.Model;
using HandBrake.Interop.Model.Encoding;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs index 4d6a127bd..1b0f8b354 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs @@ -13,6 +13,7 @@ namespace HandBrake.Interop.Interfaces using System.Collections.Generic;
using System.Windows.Media.Imaging;
+ using HandBrake.Interop.EventArgs;
using HandBrake.Interop.Model;
using HandBrake.Interop.SourceData;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs index de73dd607..8bf68b2e1 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs @@ -106,12 +106,9 @@ namespace HandBrake.Interop IntPtr nativeListInternal = Marshal.AllocHGlobal(capacity * intSize);
returnList.AllocatedMemory.Add(nativeListInternal);
- hb_list_s nativeListStruct = new hb_list_s();
- nativeListStruct.items = nativeListInternal;
- nativeListStruct.items_alloc = capacity;
- nativeListStruct.items_count = 0;
+ hb_list_s nativeListStruct = new hb_list_s { items = nativeListInternal, items_alloc = capacity, items_count = 0 };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
@@ -135,12 +132,14 @@ namespace HandBrake.Interop Marshal.WriteIntPtr(nativeListInternal, i * intSize, list[i]);
}
- hb_list_s nativeListStruct = new hb_list_s();
- nativeListStruct.items = nativeListInternal;
- nativeListStruct.items_alloc = list.Count;
- nativeListStruct.items_count = list.Count;
+ hb_list_s nativeListStruct = new hb_list_s
+ {
+ items = nativeListInternal,
+ items_alloc = list.Count,
+ items_count = list.Count
+ };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
@@ -169,12 +168,14 @@ namespace HandBrake.Interop Marshal.WriteIntPtr(nativeListInternal, i * intSize, itemPtr);
}
- hb_list_s nativeListStruct = new hb_list_s();
- nativeListStruct.items = nativeListInternal;
- nativeListStruct.items_alloc = list.Count;
- nativeListStruct.items_count = list.Count;
+ hb_list_s nativeListStruct = new hb_list_s
+ {
+ items = nativeListInternal,
+ items_alloc = list.Count,
+ items_count = list.Count
+ };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/LanguageCodes.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/LanguageCodes.cs index 373dcb816..7fbb7be1f 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/LanguageCodes.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/LanguageCodes.cs @@ -10,6 +10,7 @@ namespace HandBrake.Interop
{
using System.Collections.Generic;
+ using System.Linq;
/// <summary>
/// Contains utilities for converting language codes.
@@ -232,14 +233,7 @@ namespace HandBrake.Interop {
get
{
- List<Language> languages = new List<Language>();
-
- foreach (string languageCode in LanguageMap.Keys)
- {
- languages.Add(new Language(languageCode));
- }
-
- return languages;
+ return LanguageMap.Keys.Select(languageCode => new Language(languageCode)).ToList();
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/MarshalingConstants.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/MarshalingConstants.cs index 82948f05a..05261251a 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/MarshalingConstants.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/MarshalingConstants.cs @@ -9,7 +9,10 @@ namespace HandBrake.Interop
{
- public static class MarshalingConstants
+ /// <summary>
+ /// The marshaling constants.
+ /// </summary>
+ public static class MarshalingConstants
{
#if X64
public const int JobPaddingBytes = 49264;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/BitrateLimits.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/BitrateLimits.cs index 8e6a49582..ed9905960 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/BitrateLimits.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/BitrateLimits.cs @@ -1,15 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="BitrateLimits.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="BitrateLimits.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>
+// Defines the BitrateLimits type.
+// </summary>
// -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.Interop.Model -{ - public class BitrateLimits - { - public int Low { get; set; } - - public int High { get; set; } +{
+ /// <summary>
+ /// The bitrate limits.
+ /// </summary>
+ public class BitrateLimits + {
+ /// <summary>
+ /// Gets or sets the low.
+ /// </summary>
+ public int Low { get; set; }
+
+ /// <summary>
+ /// Gets or sets the high.
+ /// </summary>
+ public int High { get; set; } } } diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs index 80c28c383..9b6ed825e 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs @@ -9,84 +9,162 @@ namespace HandBrake.Interop.Model
{
- using System;
- using System.Collections.Generic;
- using System.Xml.Serialization;
-
- using HandBrake.Interop.Model.Encoding;
-
- public class EncodeJob
- {
- public SourceType SourceType { get; set; }
- public string SourcePath { get; set; }
-
- /// <summary>
- /// Gets or sets the 1-based index of the title to encode.
- /// </summary>
- public int Title { get; set; }
-
- /// <summary>
- /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
- /// </summary>
- public int Angle { get; set; }
-
- public VideoRangeType RangeType { get; set; }
- public int ChapterStart { get; set; }
- public int ChapterEnd { get; set; }
-
- public double SecondsStart { get; set; }
- public double SecondsEnd { get; set; }
-
- public int FramesStart { get; set; }
- public int FramesEnd { get; set; }
-
- /// <summary>
- /// Gets or sets the list of chosen audio tracks (1-based)
- /// </summary>
- public List<int> ChosenAudioTracks { get; set; }
- public Subtitles Subtitles { get; set; }
- public bool UseDefaultChapterNames { get; set; }
- public List<string> CustomChapterNames { get; set; }
-
- public string OutputPath { get; set; }
-
- public EncodingProfile EncodingProfile { get; set; }
-
- // The length of video to encode.
- [XmlIgnore]
- public TimeSpan Length { get; set; }
-
- [XmlElement("Length")]
- public string XmlLength
- {
- get { return this.Length.ToString(); }
- set { this.Length = TimeSpan.Parse(value); }
- }
-
- public EncodeJob Clone()
- {
- EncodeJob clone = new EncodeJob
- {
- SourceType = this.SourceType,
- SourcePath = this.SourcePath,
- Title = this.Title,
- Angle = this.Angle,
- RangeType = this.RangeType,
- ChapterStart = this.ChapterStart,
- ChapterEnd = this.ChapterEnd,
- SecondsStart = this.SecondsStart,
- SecondsEnd = this.SecondsEnd,
- FramesStart = this.FramesStart,
- FramesEnd = this.FramesEnd,
- ChosenAudioTracks = new List<int>(this.ChosenAudioTracks),
- Subtitles = this.Subtitles,
- UseDefaultChapterNames = this.UseDefaultChapterNames,
- OutputPath = this.OutputPath,
- EncodingProfile = this.EncodingProfile,
- Length = this.Length
- };
-
- return clone;
- }
- }
-}
+ using System;
+ using System.Collections.Generic;
+ using System.Xml.Serialization;
+
+ using HandBrake.Interop.Model.Encoding;
+
+ /// <summary>
+ /// The encode job.
+ /// </summary>
+ public class EncodeJob
+ {
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
+ /// </summary>
+ public int Angle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the chapter end.
+ /// </summary>
+ public int ChapterEnd { get; set; }
+
+ /// <summary>
+ /// Gets or sets the chapter start.
+ /// </summary>
+ public int ChapterStart { get; set; }
+
+ /// <summary>
+ /// Gets or sets the list of chosen audio tracks (1-based)
+ /// </summary>
+ public List<int> ChosenAudioTracks { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom chapter names.
+ /// </summary>
+ public List<string> CustomChapterNames { get; set; }
+
+ /// <summary>
+ /// Gets or sets the encoding profile.
+ /// </summary>
+ public EncodingProfile EncodingProfile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the frames end.
+ /// </summary>
+ public int FramesEnd { get; set; }
+
+ /// <summary>
+ /// Gets or sets the frames start.
+ /// </summary>
+ public int FramesStart { get; set; }
+
+ /// <summary>
+ /// Gets or sets the length. The length of video to encode.
+ /// </summary>
+ [XmlIgnore]
+ public TimeSpan Length { get; set; }
+
+ /// <summary>
+ /// Gets or sets the output path.
+ /// </summary>
+ public string OutputPath { get; set; }
+
+ /// <summary>
+ /// Gets or sets the range type.
+ /// </summary>
+ public VideoRangeType RangeType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the seconds end.
+ /// </summary>
+ public double SecondsEnd { get; set; }
+
+ /// <summary>
+ /// Gets or sets the seconds start.
+ /// </summary>
+ public double SecondsStart { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source path.
+ /// </summary>
+ public string SourcePath { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source type.
+ /// </summary>
+ public SourceType SourceType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subtitles.
+ /// </summary>
+ public Subtitles Subtitles { get; set; }
+
+ /// <summary>
+ /// Gets or sets the 1-based index of the title to encode.
+ /// </summary>
+ public int Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether use default chapter names.
+ /// </summary>
+ public bool UseDefaultChapterNames { get; set; }
+
+ /// <summary>
+ /// Gets or sets the xml length.
+ /// </summary>
+ [XmlElement("Length")]
+ public string XmlLength
+ {
+ get
+ {
+ return this.Length.ToString();
+ }
+ set
+ {
+ this.Length = TimeSpan.Parse(value);
+ }
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// The clone.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="EncodeJob"/>.
+ /// </returns>
+ public EncodeJob Clone()
+ {
+ var clone = new EncodeJob
+ {
+ SourceType = this.SourceType,
+ SourcePath = this.SourcePath,
+ Title = this.Title,
+ Angle = this.Angle,
+ RangeType = this.RangeType,
+ ChapterStart = this.ChapterStart,
+ ChapterEnd = this.ChapterEnd,
+ SecondsStart = this.SecondsStart,
+ SecondsEnd = this.SecondsEnd,
+ FramesStart = this.FramesStart,
+ FramesEnd = this.FramesEnd,
+ ChosenAudioTracks = new List<int>(this.ChosenAudioTracks),
+ Subtitles = this.Subtitles,
+ UseDefaultChapterNames = this.UseDefaultChapterNames,
+ OutputPath = this.OutputPath,
+ EncodingProfile = this.EncodingProfile,
+ Length = this.Length
+ };
+
+ return clone;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs index a5406a70a..9f877cd9b 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoders.cs @@ -2,6 +2,9 @@ // <copyright file="Encoders.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 encoders.
+// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Model
@@ -9,17 +12,35 @@ namespace HandBrake.Interop.Model using System;
using System.Collections.Generic;
using System.Linq;
- using System.Runtime.InteropServices;
+
using HandBrake.Interop.HbLib;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.SourceData;
- public static class Encoders
+ /// <summary>
+ /// The encoders.
+ /// </summary>
+ public static class Encoders
{
- private static List<HBAudioEncoder> audioEncoders;
- private static List<HBVideoEncoder> videoEncoders;
- private static List<HBMixdown> mixdowns;
- private static List<int> audioBitrates;
+ /// <summary>
+ /// The audio encoders.
+ /// </summary>
+ private static List<HBAudioEncoder> audioEncoders;
+
+ /// <summary>
+ /// The video encoders.
+ /// </summary>
+ private static List<HBVideoEncoder> videoEncoders;
+
+ /// <summary>
+ /// The mixdowns.
+ /// </summary>
+ private static List<HBMixdown> mixdowns;
+
+ /// <summary>
+ /// The audio bitrates.
+ /// </summary>
+ private static List<int> audioBitrates;
/// <summary>
/// Gets a list of supported audio encoders.
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/RangeLimits.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/RangeLimits.cs index 6055e8eed..2c30b2b44 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/RangeLimits.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/RangeLimits.cs @@ -1,16 +1,41 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="RangeLimits.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> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.Interop.Model -{ - public class RangeLimits - { - public float Low { get; set; } - public float High { get; set; } - public float Granularity { get; set; } - public bool Ascending { get; set; } - } -} +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="RangeLimits.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 range limits.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.Interop.Model
+{
+ /// <summary>
+ /// The range limits.
+ /// </summary>
+ public class RangeLimits
+ {
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ascending.
+ /// </summary>
+ public bool Ascending { get; set; }
+
+ /// <summary>
+ /// Gets or sets the granularity.
+ /// </summary>
+ public float Granularity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the high.
+ /// </summary>
+ public float High { get; set; }
+
+ /// <summary>
+ /// Gets or sets the low.
+ /// </summary>
+ public float Low { get; set; }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Size.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Size.cs index a06894cc5..dcc58e0e3 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Size.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Size.cs @@ -9,15 +9,42 @@ namespace HandBrake.Interop.Model
{
- public class Size
- {
- public Size(int width, int height)
- {
- this.Width = width;
- this.Height = height;
- }
+ /// <summary>
+ /// The size.
+ /// </summary>
+ public class Size
+ {
+ #region Constructors and Destructors
- public int Width { get; set; }
- public int Height { get; set; }
- }
-}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Size"/> class.
+ /// </summary>
+ /// <param name="width">
+ /// The width.
+ /// </param>
+ /// <param name="height">
+ /// The height.
+ /// </param>
+ public Size(int width, int height)
+ {
+ this.Width = width;
+ this.Height = height;
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceSubtitle.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceSubtitle.cs index 13344dd58..2912dec1e 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceSubtitle.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceSubtitle.cs @@ -9,25 +9,54 @@ namespace HandBrake.Interop.Model
{
- public class SourceSubtitle
- {
- /// <summary>
- /// Gets or sets the 1-based subtitle track number. 0 means foreign audio search.
- /// </summary>
- public int TrackNumber { get; set; }
- public bool Default { get; set; }
- public bool Forced { get; set; }
- public bool BurnedIn { get; set; }
-
- public SourceSubtitle Clone()
- {
- return new SourceSubtitle
- {
- TrackNumber = this.TrackNumber,
- Default = this.Default,
- Forced = this.Forced,
- BurnedIn = this.BurnedIn
- };
- }
- }
-}
+ /// <summary>
+ /// The source subtitle.
+ /// </summary>
+ public class SourceSubtitle
+ {
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a value indicating whether burned in.
+ /// </summary>
+ public bool BurnedIn { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether default.
+ /// </summary>
+ public bool Default { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether forced.
+ /// </summary>
+ public bool Forced { get; set; }
+
+ /// <summary>
+ /// Gets or sets the 1-based subtitle track number. 0 means foreign audio search.
+ /// </summary>
+ public int TrackNumber { get; set; }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// The clone.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="SourceSubtitle"/>.
+ /// </returns>
+ public SourceSubtitle Clone()
+ {
+ return new SourceSubtitle
+ {
+ TrackNumber = this.TrackNumber,
+ Default = this.Default,
+ Forced = this.Forced,
+ BurnedIn = this.BurnedIn
+ };
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceType.cs index 9ea7a07af..e5a49bcd1 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceType.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SourceType.cs @@ -9,11 +9,29 @@ namespace HandBrake.Interop.Model
{
- public enum SourceType
- {
- None = 0,
- File,
- VideoFolder,
- Dvd
- }
+ /// <summary>
+ /// The source type.
+ /// </summary>
+ public enum SourceType
+ {
+ /// <summary>
+ /// The none.
+ /// </summary>
+ None = 0,
+
+ /// <summary>
+ /// The file.
+ /// </summary>
+ File,
+
+ /// <summary>
+ /// The video folder.
+ /// </summary>
+ VideoFolder,
+
+ /// <summary>
+ /// The dvd.
+ /// </summary>
+ Dvd
+ }
}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SrtSubtitle.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SrtSubtitle.cs index 945cc236a..46cc45f57 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SrtSubtitle.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/SrtSubtitle.cs @@ -9,24 +9,60 @@ namespace HandBrake.Interop.Model
{
- public class SrtSubtitle
- {
- public bool Default { get; set; }
- public string FileName { get; set; }
- public string LanguageCode { get; set; }
- public string CharacterCode { get; set; }
- public int Offset { get; set; }
-
- public SrtSubtitle Clone()
- {
- return new SrtSubtitle
- {
- Default = this.Default,
- FileName = this.FileName,
- LanguageCode = this.LanguageCode,
- CharacterCode = this.CharacterCode,
- Offset = this.Offset
- };
- }
- }
-}
+ /// <summary>
+ /// The srt subtitle.
+ /// </summary>
+ public class SrtSubtitle
+ {
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the character code.
+ /// </summary>
+ public string CharacterCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether default.
+ /// </summary>
+ public bool Default { get; set; }
+
+ /// <summary>
+ /// Gets or sets the file name.
+ /// </summary>
+ public string FileName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language code.
+ /// </summary>
+ public string LanguageCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the offset.
+ /// </summary>
+ public int Offset { get; set; }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// The clone.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="SrtSubtitle"/>.
+ /// </returns>
+ public SrtSubtitle Clone()
+ {
+ return new SrtSubtitle
+ {
+ Default = this.Default,
+ FileName = this.FileName,
+ LanguageCode = this.LanguageCode,
+ CharacterCode = this.CharacterCode,
+ Offset = this.Offset
+ };
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Subtitles.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Subtitles.cs index 4289375c0..843d0d442 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Subtitles.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Subtitles.cs @@ -11,9 +11,23 @@ namespace HandBrake.Interop.Model {
using System.Collections.Generic;
+ /// <summary>
+ /// The subtitles.
+ /// </summary>
public class Subtitles
- {
- public List<SrtSubtitle> SrtSubtitles { get; set; }
- public List<SourceSubtitle> SourceSubtitles { get; set; }
- }
-}
+ {
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the source subtitles.
+ /// </summary>
+ public List<SourceSubtitle> SourceSubtitles { get; set; }
+
+ /// <summary>
+ /// Gets or sets the srt subtitles.
+ /// </summary>
+ public List<SrtSubtitle> SrtSubtitles { get; set; }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs index 2a42928a5..a99005e77 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs @@ -11,15 +11,27 @@ namespace HandBrake.Interop.Model {
using System.ComponentModel.DataAnnotations;
+ /// <summary>
+ /// The video range type.
+ /// </summary>
public enum VideoRangeType
- {
- [Display(Name = "Chapters")]
- Chapters,
+ {
+ /// <summary>
+ /// The chapters.
+ /// </summary>
+ [Display(Name = "Chapters")]
+ Chapters,
- [Display(Name = "Seconds")]
- Seconds,
+ /// <summary>
+ /// The seconds.
+ /// </summary>
+ [Display(Name = "Seconds")]
+ Seconds,
- [Display(Name = "Frames")]
- Frames
- }
-}
+ /// <summary>
+ /// The frames.
+ /// </summary>
+ [Display(Name = "Frames")]
+ Frames
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioCodec.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioCodec.cs index ad797c53d..dce947311 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioCodec.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioCodec.cs @@ -9,21 +9,45 @@ namespace HandBrake.Interop.SourceData
{
- // Only contains 2 real codecs at the moment as those are what we care about. More will be added later.
- public enum AudioCodec
- {
- Ac3,
+ /// <summary>
+ /// The audio codec.
+ /// Only contains 2 real codecs at the moment as those are what we care about. More will be added later.
+ /// </summary>
+ public enum AudioCodec
+ {
+ /// <summary>
+ /// The ac 3.
+ /// </summary>
+ Ac3,
- Dts,
+ /// <summary>
+ /// The dts.
+ /// </summary>
+ Dts,
- DtsHD,
+ /// <summary>
+ /// The dts hd.
+ /// </summary>
+ DtsHD,
- Mp3,
+ /// <summary>
+ /// The mp 3.
+ /// </summary>
+ Mp3,
- Aac,
+ /// <summary>
+ /// The aac.
+ /// </summary>
+ Aac,
- Other,
+ /// <summary>
+ /// The other.
+ /// </summary>
+ Other,
+ /// <summary>
+ /// The flac.
+ /// </summary>
Flac
- }
-}
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioTrack.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioTrack.cs index 2e78951da..e20ff3003 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioTrack.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/AudioTrack.cs @@ -90,16 +90,23 @@ namespace HandBrake.Interop.SourceData return this.GetDisplayString(true);
}
- private string GetDisplayString(bool includeTrackNumber)
- {
- if (includeTrackNumber)
+ /// <summary>
+ /// The get display string.
+ /// </summary>
+ /// <param name="includeTrackNumber">
+ /// The include track number.
+ /// </param>
+ /// <returns>
+ /// The <see cref="string"/>.
+ /// </returns>
+ private string GetDisplayString(bool includeTrackNumber)
+ {
+ if (includeTrackNumber)
{
return this.TrackNumber + " " + this.Description;
}
- else
- {
- return this.Description;
- }
- }
+
+ return this.Description;
+ }
}
}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs index 49d2e2b85..efec79d75 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs @@ -10,6 +10,7 @@ namespace HandBrake.Interop.SourceData
{
using System;
+ using System.Globalization;
/// <summary>
/// An object representing a Chapter aosciated with a Title, in a DVD
@@ -32,7 +33,7 @@ namespace HandBrake.Interop.SourceData /// <returns>A string formatted as: {chapter #}</returns>
public override string ToString()
{
- return this.ChapterNumber.ToString();
+ return this.ChapterNumber.ToString(CultureInfo.InvariantCulture);
}
}
}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/InputType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/InputType.cs index a00e084bb..aec194533 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/InputType.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/InputType.cs @@ -11,6 +11,9 @@ namespace HandBrake.Interop.SourceData {
using System.ComponentModel.DataAnnotations;
+ /// <summary>
+ /// The input type.
+ /// </summary>
public enum InputType
{
[Display(Name = "File")]
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs index a8ddd8b2f..570bc174e 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs @@ -48,7 +48,10 @@ namespace HandBrake.Interop.SourceData return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.SubtitleSource);
}
- public string Display
+ /// <summary>
+ /// Gets the display.
+ /// </summary>
+ public string Display
{
get
{
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleSource.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleSource.cs index f0a0b0a38..e169e8882 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleSource.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleSource.cs @@ -9,7 +9,10 @@ namespace HandBrake.Interop.SourceData
{
- public enum SubtitleSource
+ /// <summary>
+ /// The subtitle source.
+ /// </summary>
+ public enum SubtitleSource
{
VobSub,
SRT,
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleType.cs index e419c4451..422f9001d 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleType.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/SubtitleType.cs @@ -9,7 +9,10 @@ namespace HandBrake.Interop.SourceData
{
- public enum SubtitleType
+ /// <summary>
+ /// The subtitle type.
+ /// </summary>
+ public enum SubtitleType
{
Picture,
Text
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs index fbe8e8532..57201e847 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs @@ -140,7 +140,7 @@ namespace HandBrake.Interop.SourceData {
get
{
- return (int)Math.Ceiling(((double)this.Duration.TotalSeconds) * this.Framerate);
+ return (int)Math.Ceiling(this.Duration.TotalSeconds * this.Framerate);
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs index 084005d68..11246230c 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Utilities.cs @@ -11,6 +11,9 @@ namespace HandBrake.Interop {
using HandBrake.Interop.Model.Encoding;
+ /// <summary>
+ /// The utilities.
+ /// </summary>
public static class Utilities
{
/// <summary>
@@ -23,6 +26,7 @@ namespace HandBrake.Interop /// The b.
/// </param>
/// <returns>
+ /// The greatest common factor
/// </returns>
public static int GreatestCommonFactor(int a, int b)
{
@@ -40,10 +44,8 @@ namespace HandBrake.Interop {
return GreatestCommonFactor(a % b, b);
}
- else
- {
- return GreatestCommonFactor(a, b % a);
- }
+
+ return GreatestCommonFactor(a, b % a);
}
/// <summary>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/libgcc_s_sjlj-1.dll b/win/CS/HandBrake.Interop/HandBrakeInterop/libgcc_s_sjlj-1.dll Binary files differdeleted file mode 100644 index b86e5dfe9..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/libgcc_s_sjlj-1.dll +++ /dev/null |