From: sr55 Date: Tue, 12 Feb 2013 20:37:59 +0000 (+0000) Subject: WinGui: A Stylecop cleanup pass on Interop Library. Note, moved the Eventargs into... X-Git-Tag: 0.9.9~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d72b432378105f191bc7bf6f756bb7a7533dc79a;p=handbrake WinGui: A Stylecop cleanup pass on Interop Library. Note, moved the Eventargs into their own package. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5248 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- 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 /// /// The Interop.EncodeProgressEventArgs. /// - 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 /// /// The e. /// - 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; /// 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; + /// + /// The converters. + /// public static class Converters { /// /// Video Frame Rates /// - private static Dictionary vrates = new Dictionary + private static readonly Dictionary VideoRates = new Dictionary { {5, 5400000}, {10, 2700000}, @@ -52,12 +55,12 @@ namespace HandBrake.Interop /// 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]; } /// diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/EncodeCompletedEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/EncodeCompletedEventArgs.cs similarity index 91% rename from win/CS/HandBrake.Interop/HandBrakeInterop/EncodeCompletedEventArgs.cs rename to 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 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.Interop +namespace HandBrake.Interop.EventArgs { - using System; + using System; /// /// Encode Completed Event Args diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/EncodeProgressEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/EncodeProgressEventArgs.cs similarity index 91% rename from win/CS/HandBrake.Interop/HandBrakeInterop/EncodeProgressEventArgs.cs rename to 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 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.Interop +namespace HandBrake.Interop.EventArgs { - using System; + using System; - /// + /// s /// Encode Progress Event Args /// public class EncodeProgressEventArgs : EventArgs diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/MessageLoggedEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/MessageLoggedEventArgs.cs similarity index 88% rename from win/CS/HandBrake.Interop/HandBrakeInterop/MessageLoggedEventArgs.cs rename to 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 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.Interop +namespace HandBrake.Interop.EventArgs { - using System; + using System; - /// + /// /// The Message Logged Event Args /// public class MessageLoggedEventArgs : EventArgs diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/ScanProgressEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs similarity index 91% rename from win/CS/HandBrake.Interop/HandBrakeInterop/ScanProgressEventArgs.cs rename to 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 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.Interop +namespace HandBrake.Interop.EventArgs { - using System; + using System; /// /// 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 /// /// Fires when a scan has completed. /// - public event EventHandler ScanCompleted; + public event EventHandler ScanCompleted; /// /// 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 @@ - - + + @@ -144,7 +144,7 @@ - + @@ -179,7 +179,7 @@ - + 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; /// /// Contains utilities for converting language codes. @@ -232,14 +233,7 @@ namespace HandBrake.Interop { get { - List languages = new List(); - - 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 + /// + /// The marshaling constants. + /// + 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 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the BitrateLimits type. +// // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.Interop.Model -{ - public class BitrateLimits - { - public int Low { get; set; } - - public int High { get; set; } +{ + /// + /// The bitrate limits. + /// + public class BitrateLimits + { + /// + /// Gets or sets the low. + /// + public int Low { get; set; } + + /// + /// Gets or sets the high. + /// + 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; } - - /// - /// Gets or sets the 1-based index of the title to encode. - /// - public int Title { get; set; } - - /// - /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle. - /// - 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; } - - /// - /// Gets or sets the list of chosen audio tracks (1-based) - /// - public List ChosenAudioTracks { get; set; } - public Subtitles Subtitles { get; set; } - public bool UseDefaultChapterNames { get; set; } - public List 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(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; + + /// + /// The encode job. + /// + public class EncodeJob + { + #region Properties + + /// + /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle. + /// + public int Angle { get; set; } + + /// + /// Gets or sets the chapter end. + /// + public int ChapterEnd { get; set; } + + /// + /// Gets or sets the chapter start. + /// + public int ChapterStart { get; set; } + + /// + /// Gets or sets the list of chosen audio tracks (1-based) + /// + public List ChosenAudioTracks { get; set; } + + /// + /// Gets or sets the custom chapter names. + /// + public List CustomChapterNames { get; set; } + + /// + /// Gets or sets the encoding profile. + /// + public EncodingProfile EncodingProfile { get; set; } + + /// + /// Gets or sets the frames end. + /// + public int FramesEnd { get; set; } + + /// + /// Gets or sets the frames start. + /// + public int FramesStart { get; set; } + + /// + /// Gets or sets the length. The length of video to encode. + /// + [XmlIgnore] + public TimeSpan Length { get; set; } + + /// + /// Gets or sets the output path. + /// + public string OutputPath { get; set; } + + /// + /// Gets or sets the range type. + /// + public VideoRangeType RangeType { get; set; } + + /// + /// Gets or sets the seconds end. + /// + public double SecondsEnd { get; set; } + + /// + /// Gets or sets the seconds start. + /// + public double SecondsStart { get; set; } + + /// + /// Gets or sets the source path. + /// + public string SourcePath { get; set; } + + /// + /// Gets or sets the source type. + /// + public SourceType SourceType { get; set; } + + /// + /// Gets or sets the subtitles. + /// + public Subtitles Subtitles { get; set; } + + /// + /// Gets or sets the 1-based index of the title to encode. + /// + public int Title { get; set; } + + /// + /// Gets or sets a value indicating whether use default chapter names. + /// + public bool UseDefaultChapterNames { get; set; } + + /// + /// Gets or sets the xml length. + /// + [XmlElement("Length")] + public string XmlLength + { + get + { + return this.Length.ToString(); + } + set + { + this.Length = TimeSpan.Parse(value); + } + } + + #endregion + + #region Public Methods + + /// + /// The clone. + /// + /// + /// The . + /// + 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(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 @@ // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // +// +// The encoders. +// // -------------------------------------------------------------------------------------------------------------------- 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 + /// + /// The encoders. + /// + public static class Encoders { - private static List audioEncoders; - private static List videoEncoders; - private static List mixdowns; - private static List audioBitrates; + /// + /// The audio encoders. + /// + private static List audioEncoders; + + /// + /// The video encoders. + /// + private static List videoEncoders; + + /// + /// The mixdowns. + /// + private static List mixdowns; + + /// + /// The audio bitrates. + /// + private static List audioBitrates; /// /// 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 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -------------------------------------------------------------------------------------------------------------------- - -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; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The range limits. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model +{ + /// + /// The range limits. + /// + public class RangeLimits + { + #region Properties + + /// + /// Gets or sets a value indicating whether ascending. + /// + public bool Ascending { get; set; } + + /// + /// Gets or sets the granularity. + /// + public float Granularity { get; set; } + + /// + /// Gets or sets the high. + /// + public float High { get; set; } + + /// + /// Gets or sets the low. + /// + 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; - } + /// + /// The size. + /// + public class Size + { + #region Constructors and Destructors - public int Width { get; set; } - public int Height { get; set; } - } -} + /// + /// Initializes a new instance of the class. + /// + /// + /// The width. + /// + /// + /// The height. + /// + public Size(int width, int height) + { + this.Width = width; + this.Height = height; + } + + #endregion + + #region Properties + + /// + /// Gets or sets the height. + /// + public int Height { get; set; } + + /// + /// Gets or sets the width. + /// + 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 - { - /// - /// Gets or sets the 1-based subtitle track number. 0 means foreign audio search. - /// - 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 - }; - } - } -} + /// + /// The source subtitle. + /// + public class SourceSubtitle + { + #region Properties + + /// + /// Gets or sets a value indicating whether burned in. + /// + public bool BurnedIn { get; set; } + + /// + /// Gets or sets a value indicating whether default. + /// + public bool Default { get; set; } + + /// + /// Gets or sets a value indicating whether forced. + /// + public bool Forced { get; set; } + + /// + /// Gets or sets the 1-based subtitle track number. 0 means foreign audio search. + /// + public int TrackNumber { get; set; } + + #endregion + + #region Public Methods + + /// + /// The clone. + /// + /// + /// The . + /// + 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 - } + /// + /// The source type. + /// + public enum SourceType + { + /// + /// The none. + /// + None = 0, + + /// + /// The file. + /// + File, + + /// + /// The video folder. + /// + VideoFolder, + + /// + /// The dvd. + /// + 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 - }; - } - } -} + /// + /// The srt subtitle. + /// + public class SrtSubtitle + { + #region Properties + + /// + /// Gets or sets the character code. + /// + public string CharacterCode { get; set; } + + /// + /// Gets or sets a value indicating whether default. + /// + public bool Default { get; set; } + + /// + /// Gets or sets the file name. + /// + public string FileName { get; set; } + + /// + /// Gets or sets the language code. + /// + public string LanguageCode { get; set; } + + /// + /// Gets or sets the offset. + /// + public int Offset { get; set; } + + #endregion + + #region Public Methods + + /// + /// The clone. + /// + /// + /// The . + /// + 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; + /// + /// The subtitles. + /// public class Subtitles - { - public List SrtSubtitles { get; set; } - public List SourceSubtitles { get; set; } - } -} + { + #region Properties + + /// + /// Gets or sets the source subtitles. + /// + public List SourceSubtitles { get; set; } + + /// + /// Gets or sets the srt subtitles. + /// + public List 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; + /// + /// The video range type. + /// public enum VideoRangeType - { - [Display(Name = "Chapters")] - Chapters, + { + /// + /// The chapters. + /// + [Display(Name = "Chapters")] + Chapters, - [Display(Name = "Seconds")] - Seconds, + /// + /// The seconds. + /// + [Display(Name = "Seconds")] + Seconds, - [Display(Name = "Frames")] - Frames - } -} + /// + /// The frames. + /// + [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, + /// + /// The audio codec. + /// Only contains 2 real codecs at the moment as those are what we care about. More will be added later. + /// + public enum AudioCodec + { + /// + /// The ac 3. + /// + Ac3, - Dts, + /// + /// The dts. + /// + Dts, - DtsHD, + /// + /// The dts hd. + /// + DtsHD, - Mp3, + /// + /// The mp 3. + /// + Mp3, - Aac, + /// + /// The aac. + /// + Aac, - Other, + /// + /// The other. + /// + Other, + /// + /// The flac. + /// 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) + /// + /// The get display string. + /// + /// + /// The include track number. + /// + /// + /// The . + /// + 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; /// /// An object representing a Chapter aosciated with a Title, in a DVD @@ -32,7 +33,7 @@ namespace HandBrake.Interop.SourceData /// A string formatted as: {chapter #} 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; + /// + /// The input type. + /// 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 + /// + /// Gets the display. + /// + 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 + /// + /// The subtitle source. + /// + 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 + /// + /// The subtitle type. + /// + 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; + /// + /// The utilities. + /// public static class Utilities { /// @@ -23,6 +26,7 @@ namespace HandBrake.Interop /// The b. /// /// + /// The greatest common factor /// 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); } /// diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/libgcc_s_sjlj-1.dll b/win/CS/HandBrake.Interop/HandBrakeInterop/libgcc_s_sjlj-1.dll deleted file mode 100644 index b86e5dfe9..000000000 Binary files a/win/CS/HandBrake.Interop/HandBrakeInterop/libgcc_s_sjlj-1.dll and /dev/null differ