summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-07-22 10:44:54 +0000
committersr55 <[email protected]>2010-07-22 10:44:54 +0000
commit994b648e3ea1d42951221b9cdb0d2b5f4310b652 (patch)
tree95a33f1f00dd832944f558ca4bdb1f71198bf3d7
parent8fc8e81a0856e8b859e675bf1df055f2d4bfbdac (diff)
WinGui:
- Removed old settings debug tab, Code refactoring and some tweaks to stylecop so it's less noisy. Upgraded to Stylecop 4.4.0 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3452 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/Controls/Filters.cs39
-rw-r--r--win/C#/Controls/PictureSettings.cs16
-rw-r--r--win/C#/Controls/Subtitles.cs33
-rw-r--r--win/C#/Controls/x264Panel.cs10
-rw-r--r--win/C#/Functions/AppcastReader.cs4
-rw-r--r--win/C#/Functions/Main.cs3
-rw-r--r--win/C#/Functions/PresetLoader.cs3
-rw-r--r--win/C#/Functions/Win32.cs99
-rw-r--r--win/C#/HandBrake.5.0.ReSharper379
-rw-r--r--win/C#/HandBrake.ApplicationServices/Functions/Logging.cs1
-rw-r--r--win/C#/HandBrake.ApplicationServices/Functions/Win32.cs99
-rw-r--r--win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj3
-rw-r--r--win/C#/HandBrake.ApplicationServices/Init.cs113
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs4
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs3
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs2
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs2
-rw-r--r--win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs42
-rw-r--r--win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs25
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Encode.cs12
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs11
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs7
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Queue.cs2
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Scan.cs29
-rw-r--r--win/C#/HandBrake.ApplicationServices/Settings.StyleCop15
-rw-r--r--win/C#/HandBrakeCS.5.0.ReSharper388
-rw-r--r--win/C#/HandBrakeCS.csproj2
-rw-r--r--win/C#/HandBrakeCS.csproj.ReSharper3
-rw-r--r--win/C#/HandBrakeCS.sln38
-rw-r--r--win/C#/Presets/PresetsHandler.cs2
-rw-r--r--win/C#/Program.cs12
-rw-r--r--win/C#/Properties/Settings.Designer.cs16
-rw-r--r--win/C#/Properties/Settings.settings3
-rw-r--r--win/C#/Settings.StyleCop45
-rw-r--r--win/C#/app.config3
-rw-r--r--win/C#/frmActivityWindow.cs4
-rw-r--r--win/C#/frmAddPreset.cs3
-rw-r--r--win/C#/frmDownload.cs61
-rw-r--r--win/C#/frmMain.cs96
-rw-r--r--win/C#/frmOptions.Designer.cs31
-rw-r--r--win/C#/frmOptions.cs167
-rw-r--r--win/C#/frmOptions.resx23
-rw-r--r--win/C#/frmQueue.cs2
43 files changed, 552 insertions, 1303 deletions
diff --git a/win/C#/Controls/Filters.cs b/win/C#/Controls/Filters.cs
index 9f75f69d3..1ee72d6c9 100644
--- a/win/C#/Controls/Filters.cs
+++ b/win/C#/Controls/Filters.cs
@@ -8,14 +8,12 @@ namespace Handbrake.Controls
using System;
using System.Windows.Forms;
+ /// <summary>
+ /// The Filters Panel
+ /// </summary>
public partial class Filters : UserControl
{
/// <summary>
- /// The Filter settings have changed
- /// </summary>
- public event EventHandler FilterSettingsChanged;
-
- /// <summary>
/// Initializes a new instance of the <see cref="Filters"/> class.
/// Creates a new instance of Filters
/// </summary>
@@ -29,6 +27,11 @@ namespace Handbrake.Controls
}
/// <summary>
+ /// The Filter settings have changed
+ /// </summary>
+ public event EventHandler FilterSettingsChanged;
+
+ /// <summary>
/// Gets the CLI query for the query generator.
/// </summary>
public string GetCliQuery
@@ -260,6 +263,12 @@ namespace Handbrake.Controls
}
// Controls
+
+ /// <summary>
+ /// Delecine Selected Index Changed
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The EventArgs</param>
private void DropDetelecineSelectedIndexChanged(object sender, EventArgs e)
{
text_customDT.Visible = drop_detelecine.Text == "Custom";
@@ -268,6 +277,11 @@ namespace Handbrake.Controls
this.FilterSettingsChanged(this, new EventArgs());
}
+ /// <summary>
+ /// Decomb Selected Index Changed
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The EventArgs</param>
private void DropDecombSelectedIndexChanged(object sender, EventArgs e)
{
text_customDC.Visible = drop_decomb.Text == "Custom";
@@ -279,6 +293,11 @@ namespace Handbrake.Controls
this.FilterSettingsChanged(this, new EventArgs());
}
+ /// <summary>
+ /// DeInterlace Selected Index Changed
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The EventArgs</param>
private void DropDeinterlaceSelectedIndexChanged(object sender, EventArgs e)
{
text_customDI.Visible = drop_deinterlace.Text == "Custom";
@@ -290,6 +309,11 @@ namespace Handbrake.Controls
this.FilterSettingsChanged(this, new EventArgs());
}
+ /// <summary>
+ /// DeNoise Selected Index Changed
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The EventArgs</param>
private void DropDenoiseSelectedIndexChanged(object sender, EventArgs e)
{
text_customDN.Visible = drop_denoise.Text == "Custom";
@@ -299,6 +323,11 @@ namespace Handbrake.Controls
this.FilterSettingsChanged(this, new EventArgs());
}
+ /// <summary>
+ /// Deblock Changed
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The EventArgs</param>
private void SliderDeblockScroll(object sender, EventArgs e)
{
lbl_deblockVal.Text = slider_deblock.Value == 4 ? "Off" : slider_deblock.Value.ToString();
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs
index e0319a690..534cc0fd5 100644
--- a/win/C#/Controls/PictureSettings.cs
+++ b/win/C#/Controls/PictureSettings.cs
@@ -7,7 +7,6 @@ namespace Handbrake.Controls
{
using System;
using System.Drawing;
- using System.Globalization;
using System.Windows.Forms;
using HandBrake.ApplicationServices.Parsing;
@@ -19,7 +18,6 @@ namespace Handbrake.Controls
/// </summary>
public partial class PictureSettings : UserControl
{
- private readonly CultureInfo culture = new CultureInfo("en-US", false);
private bool preventChangingWidth;
private bool preventChangingHeight;
private bool preventChangingCustom;
@@ -152,9 +150,6 @@ namespace Handbrake.Controls
// Picture Controls
private void TextWidthValueChanged(object sender, EventArgs e)
{
- if (Properties.Settings.Default.disableResCalc)
- return;
-
if (preventChangingWidth)
return;
@@ -214,9 +209,6 @@ namespace Handbrake.Controls
private void TextHeightValueChanged(object sender, EventArgs e)
{
- if (Properties.Settings.Default.disableResCalc)
- return;
-
if (preventChangingHeight)
return;
@@ -277,9 +269,6 @@ namespace Handbrake.Controls
private void CheckKeepArCheckedChanged(object sender, EventArgs e)
{
- if (Properties.Settings.Default.disableResCalc)
- return;
-
// Force TextWidth to recalc height
if (check_KeepAR.Checked)
TextWidthValueChanged(this, new EventArgs());
@@ -298,9 +287,6 @@ namespace Handbrake.Controls
private void UpdownDisplayWidthValueChanged(object sender, EventArgs e)
{
- if (Properties.Settings.Default.disableResCalc)
- return;
-
if (preventChangingDisplayWidth == false && check_KeepAR.CheckState == CheckState.Unchecked)
{
preventChangingCustom = true;
@@ -326,7 +312,7 @@ namespace Handbrake.Controls
// Update value
preventChangingHeight = true;
- text_height.Value = (decimal)modulusHeight;
+ text_height.Value = modulusHeight;
updownParWidth.Value = updownDisplayWidth.Value;
updownParHeight.Value = text_width.Value;
preventChangingHeight = false;
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs
index e923598e7..8baf18eae 100644
--- a/win/C#/Controls/Subtitles.cs
+++ b/win/C#/Controls/Subtitles.cs
@@ -195,7 +195,7 @@ namespace Handbrake.Controls
srtFile = drp_subtitleTracks.SelectedItem.ToString();
srtLangVal = srt_lang.SelectedItem.ToString();
srtCode = srt_charcode.SelectedItem.ToString();
- srtOffsetMs = (int) srt_offset.Value;
+ srtOffsetMs = (int)srt_offset.Value;
if (defaultSub == "Yes") SetNoSrtDefault();
}
else
@@ -210,14 +210,14 @@ namespace Handbrake.Controls
SubtitleInfo track = new SubtitleInfo
{
- Track = trackName,
- Forced = forcedVal,
- Burned = burnedVal,
- Default = defaultSub,
- SrtLang = srtLangVal,
- SrtCharCode = srtCode,
- SrtOffset = srtOffsetMs,
- SrtPath = srtPath,
+ Track = trackName,
+ Forced = forcedVal,
+ Burned = burnedVal,
+ Default = defaultSub,
+ SrtLang = srtLangVal,
+ SrtCharCode = srtCode,
+ SrtOffset = srtOffsetMs,
+ SrtPath = srtPath,
SrtFileName = srtFile
};
@@ -286,7 +286,7 @@ namespace Handbrake.Controls
int c = 0;
if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.ToLower().Contains(".srt"))
- // We have an SRT
+ // We have an SRT
{
foreach (var item in drp_subtitleTracks.Items)
{
@@ -388,7 +388,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].Forced = check_forced.Checked ? "Yes" : "No";
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -411,7 +411,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].Burned = check_burned.Checked ? "Yes" : "No";
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -437,7 +437,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].Default = check_default.Checked ? "Yes" : "No";
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -458,8 +458,7 @@ namespace Handbrake.Controls
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[6].Text = srt_offset.Value.ToString();
lv_subList.Select();
- subList[lv_subList.SelectedIndices[0]].SrtOffset = (int) srt_offset.Value;
- // Update SubList List<SubtitleInfo>
+ subList[lv_subList.SelectedIndices[0]].SrtOffset = (int)srt_offset.Value;
}
/// <summary>
@@ -479,7 +478,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].SrtCharCode = srt_charcode.SelectedItem.ToString();
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -499,7 +498,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].SrtLang = srt_lang.SelectedItem.ToString();
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/* Right Click Menu */
diff --git a/win/C#/Controls/x264Panel.cs b/win/C#/Controls/x264Panel.cs
index 8d223f6ab..f63214b23 100644
--- a/win/C#/Controls/x264Panel.cs
+++ b/win/C#/Controls/x264Panel.cs
@@ -8,6 +8,9 @@ namespace Handbrake.Controls
using System;
using System.Windows.Forms;
+ /// <summary>
+ /// The Advanced Panel
+ /// </summary>
public partial class x264Panel : UserControl
{
/*
@@ -38,7 +41,10 @@ namespace Handbrake.Controls
{
return rtf_x264Query.Text;
}
- set { rtf_x264Query.Text = value; }
+ set
+ {
+ rtf_x264Query.Text = value;
+ }
}
/// <summary>
@@ -999,7 +1005,7 @@ namespace Handbrake.Controls
private void widgetControlChanged(object sender, EventArgs e)
{
- Control changedControlName = (Control) sender;
+ Control changedControlName = (Control)sender;
string controlName = string.Empty;
switch (changedControlName.Name.Trim())
diff --git a/win/C#/Functions/AppcastReader.cs b/win/C#/Functions/AppcastReader.cs
index e6bd64b08..7248ffa78 100644
--- a/win/C#/Functions/AppcastReader.cs
+++ b/win/C#/Functions/AppcastReader.cs
@@ -54,9 +54,7 @@ namespace Handbrake.Functions
Match verShort = Regex.Match(result, @"sparkle:shortVersionString=""(([svn]*)([0-9.\s]*))\""");
this.Build = ver.ToString().Replace("sparkle:version=", string.Empty).Replace("\"", string.Empty);
- this.Version = verShort.ToString().Replace("sparkle:shortVersionString=", string.Empty).Replace("\"",
- string.
- Empty);
+ this.Version = verShort.ToString().Replace("sparkle:shortVersionString=", string.Empty).Replace("\"", string.Empty);
this.DownloadFile = nodeItem["windows"].InnerText;
this.DescriptionUrl = new Uri(nodeItem["sparkle:releaseNotesLink"].InnerText);
}
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 148f8f315..ace2d6853 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -411,6 +411,7 @@ namespace Handbrake.Functions
/// <summary>
/// Recover a queue from file.
/// </summary>
+ /// <param name="encodeQueue"> The IQueue Object</param>
public static void RecoverQueue(IQueue encodeQueue)
{
DialogResult result = DialogResult.None;
@@ -449,7 +450,7 @@ namespace Handbrake.Functions
}
/// <summary>
- /// Checks if this HandBrake is running multiple instances
+ /// Gets a value indicating whether this this application is running in multi instance mode.
/// </summary>
/// <returns>True if the UI has another instance running</returns>
public static bool IsMultiInstance
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs
index 649804914..790d51163 100644
--- a/win/C#/Functions/PresetLoader.cs
+++ b/win/C#/Functions/PresetLoader.cs
@@ -26,9 +26,6 @@ namespace Handbrake.Functions
/// <param name="name">
/// Name of the preset
/// </param>
- /// <param name="pictureSettings">
- /// Save picture settings in the preset
- /// </param>
public static void LoadPreset(frmMain mainWindow, QueryParser presetQuery, string name)
{
#region Source
diff --git a/win/C#/Functions/Win32.cs b/win/C#/Functions/Win32.cs
index a50102688..c2e785075 100644
--- a/win/C#/Functions/Win32.cs
+++ b/win/C#/Functions/Win32.cs
@@ -47,62 +47,13 @@ namespace Handbrake.Functions
public static extern int ExitWindowsEx(int uFlags, int dwReason);
/// <summary>
- /// System Memory Status
- /// </summary>
- public struct MEMORYSTATUS // Unused var's are required here.
- {
- /// <summary>
- /// Unknown
- /// </summary>
- public UInt32 dwLength;
-
- /// <summary>
- /// Memory Load
- /// </summary>
- public UInt32 dwMemoryLoad;
-
- /// <summary>
- /// Total Physical Memory
- /// </summary>
- public UInt32 dwTotalPhys; // Used
-
- /// <summary>
- /// Available Physical Memory
- /// </summary>
- public UInt32 dwAvailPhys;
-
- /// <summary>
- /// Total Page File
- /// </summary>
- public UInt32 dwTotalPageFile;
-
- /// <summary>
- /// Available Page File
- /// </summary>
- public UInt32 dwAvailPageFile;
-
- /// <summary>
- /// Total Virtual Memory
- /// </summary>
- public UInt32 dwTotalVirtual;
-
- /// <summary>
- /// Available Virtual Memory
- /// </summary>
- public UInt32 dwAvailVirtual;
- }
-
- /// <summary>
/// Global Memory Status
/// </summary>
/// <param name="lpBuffer">
/// The lp buffer.
/// </param>
[DllImport("kernel32.dll")]
- public static extern void GlobalMemoryStatus
- (
- ref MEMORYSTATUS lpBuffer
- );
+ public static extern void GlobalMemoryStatus(ref MEMORYSTATUS lpBuffer);
/// <summary>
/// Generate a Console Ctrl Event
@@ -141,7 +92,7 @@ namespace Handbrake.Functions
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
+ public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[FlagsAttribute]
public enum EXECUTION_STATE : uint
@@ -166,5 +117,51 @@ namespace Handbrake.Functions
{
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);
}
+
+ /// <summary>
+ /// System Memory Status
+ /// </summary>
+ public struct MEMORYSTATUS // Unused var's are required here.
+ {
+ /// <summary>
+ /// Unknown
+ /// </summary>
+ public UInt32 dwLength;
+
+ /// <summary>
+ /// Memory Load
+ /// </summary>
+ public UInt32 dwMemoryLoad;
+
+ /// <summary>
+ /// Total Physical Memory
+ /// </summary>
+ public UInt32 dwTotalPhys; // Used
+
+ /// <summary>
+ /// Available Physical Memory
+ /// </summary>
+ public UInt32 dwAvailPhys;
+
+ /// <summary>
+ /// Total Page File
+ /// </summary>
+ public UInt32 dwTotalPageFile;
+
+ /// <summary>
+ /// Available Page File
+ /// </summary>
+ public UInt32 dwAvailPageFile;
+
+ /// <summary>
+ /// Total Virtual Memory
+ /// </summary>
+ public UInt32 dwTotalVirtual;
+
+ /// <summary>
+ /// Available Virtual Memory
+ /// </summary>
+ public UInt32 dwAvailVirtual;
+ }
}
}
diff --git a/win/C#/HandBrake.5.0.ReSharper b/win/C#/HandBrake.5.0.ReSharper
deleted file mode 100644
index 22ca79976..000000000
--- a/win/C#/HandBrake.5.0.ReSharper
+++ /dev/null
@@ -1,379 +0,0 @@
-<Configuration>
- <CodeStyleSettings>
- <ExternalPath IsNull="False">
- </ExternalPath>
- <Sharing>SOLUTION</Sharing>
- <CSharp>
- <FormatSettings>
- <ALIGN_MULTILINE_ARGUMENT>False</ALIGN_MULTILINE_ARGUMENT>
- <BLANK_LINES_AROUND_SINGLE_LINE_FIELD>1</BLANK_LINES_AROUND_SINGLE_LINE_FIELD>
- <BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE>1</BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE>
- <BLANK_LINES_BETWEEN_USING_GROUPS>1</BLANK_LINES_BETWEEN_USING_GROUPS>
- <FORCE_ATTRIBUTE_STYLE>SEPARATE</FORCE_ATTRIBUTE_STYLE>
- <FORCE_FOR_BRACES_STYLE>ALWAYS_ADD</FORCE_FOR_BRACES_STYLE>
- <FORCE_FOREACH_BRACES_STYLE>ALWAYS_ADD</FORCE_FOREACH_BRACES_STYLE>
- <FORCE_IFELSE_BRACES_STYLE>ALWAYS_ADD</FORCE_IFELSE_BRACES_STYLE>
- <FORCE_WHILE_BRACES_STYLE>ALWAYS_ADD</FORCE_WHILE_BRACES_STYLE>
- <INDENT_ANONYMOUS_METHOD_BLOCK>False</INDENT_ANONYMOUS_METHOD_BLOCK>
- <INDENT_EMBRACED_INITIALIZER_BLOCK>False</INDENT_EMBRACED_INITIALIZER_BLOCK>
- <KEEP_BLANK_LINES_IN_CODE>1</KEEP_BLANK_LINES_IN_CODE>
- <KEEP_BLANK_LINES_IN_DECLARATIONS>1</KEEP_BLANK_LINES_IN_DECLARATIONS>
- <KEEP_USER_LINEBREAKS>False</KEEP_USER_LINEBREAKS>
- <MODIFIERS_ORDER IsNull="False">
- <Item>public</Item>
- <Item>protected</Item>
- <Item>internal</Item>
- <Item>private</Item>
- <Item>new</Item>
- <Item>abstract</Item>
- <Item>virtual</Item>
- <Item>override</Item>
- <Item>sealed</Item>
- <Item>static</Item>
- <Item>readonly</Item>
- <Item>extern</Item>
- <Item>unsafe</Item>
- <Item>volatile</Item>
- </MODIFIERS_ORDER>
- <PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE>False</PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE>
- <PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE>False</PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE>
- <PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE>False</PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE>
- <PLACE_TYPE_CONSTRAINTS_ON_SAME_LINE>False</PLACE_TYPE_CONSTRAINTS_ON_SAME_LINE>
- <PLACE_WHILE_ON_NEW_LINE>True</PLACE_WHILE_ON_NEW_LINE>
- <REDUNDANT_THIS_QUALIFIER_STYLE>ALWAYS_USE</REDUNDANT_THIS_QUALIFIER_STYLE>
- <SIMPLE_EMBEDDED_STATEMENT_STYLE>ON_SINGLE_LINE</SIMPLE_EMBEDDED_STATEMENT_STYLE>
- <SPACE_AFTER_TYPECAST_PARENTHESES>False</SPACE_AFTER_TYPECAST_PARENTHESES>
- <SPACE_AROUND_MULTIPLICATIVE_OP>True</SPACE_AROUND_MULTIPLICATIVE_OP>
- <SPACE_BEFORE_SIZEOF_PARENTHESES>False</SPACE_BEFORE_SIZEOF_PARENTHESES>
- <SPACE_BEFORE_TYPEOF_PARENTHESES>False</SPACE_BEFORE_TYPEOF_PARENTHESES>
- <SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES>True</SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES>
- <STICK_COMMENT>False</STICK_COMMENT>
- <WRAP_AFTER_DECLARATION_LPAR>True</WRAP_AFTER_DECLARATION_LPAR>
- <WRAP_AFTER_INVOCATION_LPAR>True</WRAP_AFTER_INVOCATION_LPAR>
- <WRAP_ARGUMENTS_STYLE>CHOP_IF_LONG</WRAP_ARGUMENTS_STYLE>
- <WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT>True</WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT>
- <WRAP_EXTENDS_LIST_STYLE>CHOP_IF_LONG</WRAP_EXTENDS_LIST_STYLE>
- <WRAP_PARAMETERS_STYLE>CHOP_IF_LONG</WRAP_PARAMETERS_STYLE>
- </FormatSettings>
- <UsingsSettings>
- <AddImportsToDeepestScope>True</AddImportsToDeepestScope>
- <QualifiedUsingAtNestedScope>True</QualifiedUsingAtNestedScope>
- </UsingsSettings>
- <Naming2>
- <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
- <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
- <ExceptionName IsNull="False">
- </ExceptionName>
- <OverrideDefaultSettings>True</OverrideDefaultSettings>
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
- <PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
- <PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
- </Naming2>
- <CustomMemberReorderingPatterns><![CDATA[<?xml version="1.0" encoding="utf-8"?>
-<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
-
- <!-- Do not reorder COM interfaces -->
- <Pattern>
- <Match>
- <And Weight="2000">
- <Kind Is="interface"/>
- <HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"
- Inherit="true"/>
- </And>
- </Match>
- </Pattern>
-
- <!-- Do not reorder P/Invoke structs -->
- <Pattern>
- <Match>
- <And Weight="2000">
- <Or>
- <Kind Is="struct"/>
- <Kind Is="class"/>
- </Or>
- <HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"
- Inherit="true"/>
- </And>
- </Match>
- </Pattern>
-
- <!-- Do not reorder P/Invoke classes (called xxxNativeMethods) -->
- <Pattern>
- <Match>
- <And Weight="2000">
- <Kind Is="class"/>
- <Name Is=".*NativeMethods" />
- </And>
- </Match>
- </Pattern>
-
- <!-- StyleCop pattern -->
- <Pattern RemoveAllRegions="true">
- <Match>
- <Or Weight="1000" >
- <Kind Is="class" />
- <Kind Is="struct" />
- <Kind Is="interface"/>
- </Or>
- </Match>
-
- <!-- constants and fields -->
- <Entry>
- <Match>
- <Or>
- <Kind Is="constant"/>
- <Kind Is="field"/>
- </Or>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private"/>
- <Kind Order="constant field"/>
- <Readonly/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Constants and Fields"/>
- </Entry>
-
- <!-- constructors -->
- <Entry>
- <Match>
- <Or Weight="200">
- <Kind Is="constructor"/>
- <Kind Is="destructor"/>
- </Or>
- </Match>
- <Sort>
- <Static/>
- <Kind Order="constructor destructor"/>
- <Access Order="public internal protected-internal protected private"/>
- </Sort>
- <Group Region="Constructors and Destructors"/>
- </Entry>
-
- <!-- delegates -->
- <Entry>
- <Match>
- <Kind Is="delegate"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static />
- <Name/>
- </Sort>
- <Group Region="Delegates"/>
- </Entry>
-
- <!-- events -->
- <Entry>
- <Match>
- <Kind Is="event"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static />
- <Name/>
- </Sort>
- <Group Region="Events"/>
- </Entry>
-
- <!-- enum -->
- <Entry>
- <Match>
- <Kind Is="enum"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- <Group Region="Enums"/>
- </Entry>
-
- <!-- interfaces -->
- <Entry>
- <Match>
- <Kind Is="interface" />
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- <Group Region="Interfaces"/>
- </Entry>
-
- <!-- properties -->
- <Entry>
- <Match>
- <Kind Is="property"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Properties"/>
- </Entry>
-
- <!-- indexers -->
- <Entry>
- <Match>
- <Kind Is="indexer"
- Weight="300" />
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Indexers"/>
- </Entry>
-
- <!-- operator -->
- <Entry>
- <Match>
- <Kind Is="operator"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Operators"/>
- </Entry>
-
- <!-- public methods -->
- <Entry>
- <Match>
- <And>
- <Kind Is="method"/>
- <Access Is="public"/>
- </And>
- </Match>
- <Sort>
- <Access Order="public"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Public Methods"/>
- </Entry>
-
- <!-- Implemented Interfaces -->
- <Entry>
- <Match>
- <And Weight="500">
- <Kind Is="method"/>
- <ImplementsInterface CLRName=".*"/>
- </And>
- </Match>
- <Sort>
- <ImplementsInterface />
- <Access Order="public internal protected-internal protected private"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Implemented Interfaces">
- <ImplementsInterface Region="${ImplementsInterface}" />
- </Group>
- </Entry>
-
- <!-- other methods -->
- <Entry>
- <Match>
- <Kind Is="method"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Methods"/>
- </Entry>
-
- <!-- Nested structs -->
- <Entry>
- <Match>
- <Kind Is="struct"
- Weight="600" />
- </Match>
- <Sort>
- <Static />
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- </Entry>
-
- <!-- Nested classes -->
- <Entry>
- <Match>
- <Kind Is="class"
- Weight="700" />
- </Match>
- <Sort>
- <Static />
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- </Entry>
-
- <!-- all other members -->
- <Entry/>
-
- </Pattern>
-</Patterns>
-]]></CustomMemberReorderingPatterns>
- </CSharp>
- <VB>
- <FormatSettings />
- <ImportsSettings />
- <Naming2>
- <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
- <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
- </Naming2>
- </VB>
- <Web>
- <Naming2 />
- </Web>
- <Xaml>
- <Naming2 />
- </Xaml>
- <XML>
- <FormatSettings />
- </XML>
- <GenerateMemberBody />
- <Naming2>
- <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
- <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
- <ExceptionName IsNull="False">
- </ExceptionName>
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
- <PredefinedRule Inspect="False" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
- <PredefinedRule Inspect="False" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
- <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
- <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
- </Naming2>
- </CodeStyleSettings>
-</Configuration> \ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs
index aba92dbbe..2efab7d97 100644
--- a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs
+++ b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs
@@ -23,6 +23,7 @@ namespace HandBrake.ApplicationServices.Functions
/// <param name="encJob">
/// The Encode Job Object
/// </param>
+ /// <returns>String with the log header</returns>
public static string CreateCliLogHeader(Job encJob)
{
StringBuilder logHeader = new StringBuilder();
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
index a45d7441a..d06144981 100644
--- a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
+++ b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
@@ -47,62 +47,13 @@ namespace HandBrake.ApplicationServices.Functions
public static extern int ExitWindowsEx(int uFlags, int dwReason);
/// <summary>
- /// System Memory Status
- /// </summary>
- public struct MEMORYSTATUS // Unused var's are required here.
- {
- /// <summary>
- /// Unknown
- /// </summary>
- public UInt32 dwLength;
-
- /// <summary>
- /// Memory Load
- /// </summary>
- public UInt32 dwMemoryLoad;
-
- /// <summary>
- /// Total Physical Memory
- /// </summary>
- public UInt32 dwTotalPhys; // Used
-
- /// <summary>
- /// Available Physical Memory
- /// </summary>
- public UInt32 dwAvailPhys;
-
- /// <summary>
- /// Total Page File
- /// </summary>
- public UInt32 dwTotalPageFile;
-
- /// <summary>
- /// Available Page File
- /// </summary>
- public UInt32 dwAvailPageFile;
-
- /// <summary>
- /// Total Virtual Memory
- /// </summary>
- public UInt32 dwTotalVirtual;
-
- /// <summary>
- /// Available Virtual Memory
- /// </summary>
- public UInt32 dwAvailVirtual;
- }
-
- /// <summary>
/// Global Memory Status
/// </summary>
/// <param name="lpBuffer">
/// The lp buffer.
/// </param>
[DllImport("kernel32.dll")]
- public static extern void GlobalMemoryStatus
- (
- ref MEMORYSTATUS lpBuffer
- );
+ public static extern void GlobalMemoryStatus(ref MEMORYSTATUS lpBuffer);
/// <summary>
/// Generate a Console Ctrl Event
@@ -141,7 +92,7 @@ namespace HandBrake.ApplicationServices.Functions
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
+ public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[FlagsAttribute]
public enum EXECUTION_STATE : uint
@@ -166,5 +117,51 @@ namespace HandBrake.ApplicationServices.Functions
{
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);
}
+
+ /// <summary>
+ /// System Memory Status
+ /// </summary>
+ public struct MEMORYSTATUS // Unused var's are required here.
+ {
+ /// <summary>
+ /// Unknown
+ /// </summary>
+ public UInt32 dwLength;
+
+ /// <summary>
+ /// Memory Load
+ /// </summary>
+ public UInt32 dwMemoryLoad;
+
+ /// <summary>
+ /// Total Physical Memory
+ /// </summary>
+ public UInt32 dwTotalPhys; // Used
+
+ /// <summary>
+ /// Available Physical Memory
+ /// </summary>
+ public UInt32 dwAvailPhys;
+
+ /// <summary>
+ /// Total Page File
+ /// </summary>
+ public UInt32 dwTotalPageFile;
+
+ /// <summary>
+ /// Available Page File
+ /// </summary>
+ public UInt32 dwAvailPageFile;
+
+ /// <summary>
+ /// Total Virtual Memory
+ /// </summary>
+ public UInt32 dwTotalVirtual;
+
+ /// <summary>
+ /// Available Virtual Memory
+ /// </summary>
+ public UInt32 dwAvailVirtual;
+ }
}
}
diff --git a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
index 17effbc64..e102010be 100644
--- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
+++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
@@ -75,6 +75,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="ScanProgressEventArgs.cs" />
<Compile Include="EncodeProgressEventArgs.cs" />
<Compile Include="frmExceptionWindow.cs">
<SubType>Form</SubType>
@@ -136,7 +137,7 @@
<EmbeddedResource Include="Resources\copy.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />
+ <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/win/C#/HandBrake.ApplicationServices/Init.cs b/win/C#/HandBrake.ApplicationServices/Init.cs
index e8f2e18af..b1321bc4d 100644
--- a/win/C#/HandBrake.ApplicationServices/Init.cs
+++ b/win/C#/HandBrake.ApplicationServices/Init.cs
@@ -14,63 +14,6 @@ namespace HandBrake.ApplicationServices
public class Init
{
/// <summary>
- /// Setup the Settings used by the applicaiton with this library
- /// </summary>
- /// <param name="versionString">
- /// The version / name of the application that's using this DLL.
- /// </param>
- /// <param name="instanceId">
- /// The Instance ID
- /// </param>
- /// <param name="completionOption">
- /// The completion option.
- /// </param>
- /// <param name="disableDvdNav">
- /// The disable dvd nav.
- /// </param>
- /// <param name="growlEncode">
- /// The growl encode.
- /// </param>
- /// <param name="growlQueue">
- /// The growl queue.
- /// </param>
- /// <param name="processPriority">
- /// The process priority.
- /// </param>
- /// <param name="saveLogPath">
- /// The save log path.
- /// </param>
- /// <param name="saveLogToSpecifiedPath">
- /// The save log to specified path.
- /// </param>
- /// <param name="saveLogWithVideo">
- /// The save log with video.
- /// </param>
- /// <param name="showCliForInGuiEncodeStatus">
- /// The show cli for in gui encode status.
- /// </param>
- /// <param name="preventSleep">
- /// Prevent the system from sleeping
- /// </param>
- public static void SetupSettings(string versionString, int instanceId, string completionOption, bool disableDvdNav,
- bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,
- bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)
- {
- InstanceId = instanceId;
- HandBrakeGuiVersionString = versionString;
- CompletionOption = completionOption;
- DisableDvdNav = disableDvdNav;
- GrowlEncode = growlEncode;
- GrowlQueue = growlQueue;
- ProcessPriority = processPriority;
- SaveLogPath = saveLogPath;
- SaveLogToSpecifiedPath = saveLogToSpecifiedPath;
- SaveLogWithVideo = saveLogWithVideo;
- ShowCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
- PreventSleep = preventSleep;
- }
-
- /// <summary>
/// Gets the Assembly version.
/// </summary>
/// <returns>
@@ -141,5 +84,61 @@ namespace HandBrake.ApplicationServices
/// </summary>
public static bool PreventSleep;
+ /// <summary>
+ /// Setup the Settings used by the applicaiton with this library
+ /// </summary>
+ /// <param name="versionString">
+ /// The version / name of the application that's using this DLL.
+ /// </param>
+ /// <param name="instanceId">
+ /// The Instance ID
+ /// </param>
+ /// <param name="completionOption">
+ /// The completion option.
+ /// </param>
+ /// <param name="disableDvdNav">
+ /// The disable dvd nav.
+ /// </param>
+ /// <param name="growlEncode">
+ /// The growl encode.
+ /// </param>
+ /// <param name="growlQueue">
+ /// The growl queue.
+ /// </param>
+ /// <param name="processPriority">
+ /// The process priority.
+ /// </param>
+ /// <param name="saveLogPath">
+ /// The save log path.
+ /// </param>
+ /// <param name="saveLogToSpecifiedPath">
+ /// The save log to specified path.
+ /// </param>
+ /// <param name="saveLogWithVideo">
+ /// The save log with video.
+ /// </param>
+ /// <param name="showCliForInGuiEncodeStatus">
+ /// The show cli for in gui encode status.
+ /// </param>
+ /// <param name="preventSleep">
+ /// Prevent the system from sleeping
+ /// </param>
+ public static void SetupSettings(string versionString, int instanceId, string completionOption, bool disableDvdNav,
+ bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,
+ bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)
+ {
+ InstanceId = instanceId;
+ HandBrakeGuiVersionString = versionString;
+ CompletionOption = completionOption;
+ DisableDvdNav = disableDvdNav;
+ GrowlEncode = growlEncode;
+ GrowlQueue = growlQueue;
+ ProcessPriority = processPriority;
+ SaveLogPath = saveLogPath;
+ SaveLogToSpecifiedPath = saveLogToSpecifiedPath;
+ SaveLogWithVideo = saveLogWithVideo;
+ ShowCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
+ PreventSleep = preventSleep;
+ }
}
}
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs
index 55cf524a5..4eba0b4c1 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs
@@ -61,6 +61,10 @@ namespace HandBrake.ApplicationServices.Parsing
public static AudioTrack Parse(StringReader output)
{
string audioTrack = output.ReadLine();
+
+ if (audioTrack == null)
+ return null;
+
Match m = Regex.Match(audioTrack, @"^ \+ ([0-9]*), ([A-Za-z0-9,\s]*) \((.*)\) \((.*)\)");
Match track = Regex.Match(audioTrack, @"^ \+ ([0-9]*), ([A-Za-z0-9,\s]*) \((.*)\)"); // ID and Language
Match iso639_2 = Regex.Match(audioTrack, @"iso639-2: ([a-zA-Z]*)\)");
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
index 0545dd1d5..258dcff16 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
@@ -36,8 +36,7 @@ namespace HandBrake.ApplicationServices.Parsing
/// </returns>
public static Chapter Parse(StringReader output)
{
- Match m = Regex.Match(
- output.ReadLine(),
+ Match m = Regex.Match(output.ReadLine(),
@"^ \+ ([0-9]*): cells ([0-9]*)->([0-9]*), ([0-9]*) blocks, duration ([0-9]{2}:[0-9]{2}:[0-9]{2})");
if (m.Success)
{
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
index c7e5a27bb..d9f7e5e69 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
@@ -41,7 +41,7 @@ namespace HandBrake.ApplicationServices.Parsing
while (!output.EndOfStream)
{
- if ((char) output.Peek() == '+')
+ if ((char)output.Peek() == '+')
thisDVD.Titles.AddRange(Title.ParseList(output.ReadToEnd()));
else
output.ReadLine();
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs
index f4cd65768..913ab5fa1 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs
@@ -87,7 +87,7 @@ namespace HandBrake.ApplicationServices.Parsing
public static IEnumerable<Subtitle> ParseList(StringReader output)
{
var subtitles = new List<Subtitle>();
- while ((char) output.Peek() != '+')
+ while ((char)output.Peek() != '+')
{
Subtitle thisSubtitle = Parse(output);
diff --git a/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs b/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..c6ad9aef0
--- /dev/null
+++ b/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs
@@ -0,0 +1,42 @@
+/* AssemblyInfo.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. */
+
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HandBrake")]
+[assembly: AssemblyDescription("HandBrake is a GPL-licensed, multiplatform, multithreaded video transcoder.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HandBrake Team")]
+[assembly: AssemblyProduct("HandBrake")]
+[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5e4e3f97-5252-41f6-aae9-3846f62cbc66")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.9.4.3447")]
+[assembly: NeutralResourcesLanguage("")]
diff --git a/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs b/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs
new file mode 100644
index 000000000..b7e1ccd4a
--- /dev/null
+++ b/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs
@@ -0,0 +1,25 @@
+/* ScanProgressEventArgs.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
+{
+ using System;
+
+ /// <summary>
+ /// Scan Progress Event Args
+ /// </summary>
+ public class ScanProgressEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Gets or sets TotalTitles.
+ /// </summary>
+ public int TotalTitles { get; set; }
+
+ /// <summary>
+ /// Gets or sets CurrentTitle.
+ /// </summary>
+ public int CurrentTitle { get; set; }
+ }
+}
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
index 87b0e0027..ca3f898df 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
@@ -15,7 +15,6 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
@@ -252,14 +251,15 @@ namespace HandBrake.ApplicationServices.Services
SendKeys.Send("^C");
SendKeys.Flush();
- //if (HbProcess != null)
+ /*//if (HbProcess != null)
//{
// HbProcess.StandardInput.AutoFlush = true;
// HbProcess.StandardInput.WriteLine("^c^z");
- //}
+ //}*/
}
/* Helpers */
+
/// <summary>
/// Save a copy of the log to the users desired location or a default location
/// if this feature is enabled in options.
@@ -315,8 +315,6 @@ namespace HandBrake.ApplicationServices.Services
{
IsEncoding = false;
- // ReadFile(null);
-
if (this.EncodeEnded != null)
this.EncodeEnded(this, new EventArgs());
@@ -344,9 +342,6 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// Read the log file
/// </summary>
- /// <param name="n">
- /// The object.
- /// </param>
private void ReadFile()
{
logBuffer = new StringBuilder();
@@ -398,6 +393,7 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// Setup the logging.
/// </summary>
+ /// <param name="encodeJob">The Encode Job Object</param>
private void SetupLogging(Job encodeJob)
{
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs
index 981f3c19e..d82cfbb02 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs
@@ -58,16 +58,6 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
int Count { get; }
/// <summary>
- /// Gets a value indicating whether IsEncoding.
- /// </summary>
- bool IsEncoding { get; }
-
- /// <summary>
- /// Gets ActivityLog.
- /// </summary>
- string ActivityLog { get; }
-
- /// <summary>
/// Adds an item to the queue.
/// </summary>
/// <param name="query">
@@ -122,6 +112,7 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
/// Writes the current state of the queue in the form of a batch (.bat) file.
/// </summary>
/// <param name="file">The location of the file to write the batch file to.</param>
+ /// <returns>True if sucessful</returns>
bool WriteBatchScriptToFile(string file);
/// <summary>
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
index b02b8b06f..63d3aee64 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
@@ -27,7 +27,7 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
/// <summary>
/// Scan process has changed to a new title
/// </summary>
- event EventHandler ScanStatusChanged;
+ event ScanService.ScanProgessStatus ScanStatusChanged;
/// <summary>
/// Gets a value indicating whether IsScanning.
@@ -35,11 +35,6 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
bool IsScanning { get; }
/// <summary>
- /// Gets the Scan Status.
- /// </summary>
- string ScanStatus { get; }
-
- /// <summary>
/// Gets the Souce Data.
/// </summary>
DVD SouceData { get; }
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
index 59c084f1c..3bcbcb7e8 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
@@ -17,7 +17,6 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
@@ -253,6 +252,7 @@ namespace HandBrake.ApplicationServices.Services
/// Writes the current state of the queue in the form of a batch (.bat) file.
/// </summary>
/// <param name="file">The location of the file to write the batch file to.</param>
+ /// <returns>True if successful</returns>
public bool WriteBatchScriptToFile(string file)
{
string queries = string.Empty;
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
index da8d34f7c..76ecbf2b9 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
@@ -61,9 +61,20 @@ namespace HandBrake.ApplicationServices.Services
public event EventHandler ScanCompleted;
/// <summary>
+ /// Scan Progess Status
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The ScanProgressEventArgs.
+ /// </param>
+ public delegate void ScanProgessStatus(object sender, ScanProgressEventArgs e);
+
+ /// <summary>
/// Scan process has changed to a new title
/// </summary>
- public event EventHandler ScanStatusChanged;
+ public event ScanProgessStatus ScanStatusChanged;
/* Properties */
@@ -73,11 +84,6 @@ namespace HandBrake.ApplicationServices.Services
public bool IsScanning { get; private set; }
/// <summary>
- /// Gets the Scan Status.
- /// </summary>
- public string ScanStatus { get; private set; }
-
- /// <summary>
/// Gets the Souce Data.
/// </summary>
public DVD SouceData { get; private set; }
@@ -186,7 +192,7 @@ namespace HandBrake.ApplicationServices.Services
this.hbProc.Start();
this.readData = new Parser(this.hbProc.StandardError.BaseStream);
- this.readData.OnScanProgress += new ScanProgressEventHandler(this.OnScanProgress);
+ this.readData.OnScanProgress += this.OnScanProgress;
this.SouceData = DVD.Parse(this.readData);
// Write the Buffer out to file.
@@ -280,9 +286,14 @@ namespace HandBrake.ApplicationServices.Services
/// <param name="titleCount">the total number of titles</param>
private void OnScanProgress(object sender, int currentTitle, int titleCount)
{
- this.ScanStatus = string.Format("Processing Title: {0} of {1}", currentTitle, titleCount);
+ ScanProgressEventArgs scanProgressEventArgs = new ScanProgressEventArgs
+ {
+ TotalTitles = titleCount,
+ CurrentTitle = currentTitle
+ };
+
if (this.ScanStatusChanged != null)
- this.ScanStatusChanged(this, new EventArgs());
+ this.ScanStatusChanged(this, scanProgressEventArgs);
}
}
} \ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Settings.StyleCop b/win/C#/HandBrake.ApplicationServices/Settings.StyleCop
index 7f55ce6c6..1ca772fff 100644
--- a/win/C#/HandBrake.ApplicationServices/Settings.StyleCop
+++ b/win/C#/HandBrake.ApplicationServices/Settings.StyleCop
@@ -1 +1,14 @@
-<StyleCopSettings Version="4.3" /> \ No newline at end of file
+<StyleCopSettings Version="4.3">
+ <Analyzers>
+ <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.MaintainabilityRules">
+ <Rules>
+ <Rule Name="FieldsMustBePrivate">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
+ </Rules>
+ <AnalyzerSettings />
+ </Analyzer>
+ </Analyzers>
+</StyleCopSettings> \ No newline at end of file
diff --git a/win/C#/HandBrakeCS.5.0.ReSharper b/win/C#/HandBrakeCS.5.0.ReSharper
deleted file mode 100644
index 59f681991..000000000
--- a/win/C#/HandBrakeCS.5.0.ReSharper
+++ /dev/null
@@ -1,388 +0,0 @@
-<Configuration>
- <CodeStyleSettings>
- <ExternalPath IsNull="False">
- </ExternalPath>
- <Sharing>SOLUTION</Sharing>
- <CSharp>
- <FormatSettings>
- <ALIGN_MULTILINE_ARGUMENT>False</ALIGN_MULTILINE_ARGUMENT>
- <BLANK_LINES_AROUND_SINGLE_LINE_FIELD>1</BLANK_LINES_AROUND_SINGLE_LINE_FIELD>
- <BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE>1</BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE>
- <BLANK_LINES_BETWEEN_USING_GROUPS>1</BLANK_LINES_BETWEEN_USING_GROUPS>
- <FORCE_ATTRIBUTE_STYLE>SEPARATE</FORCE_ATTRIBUTE_STYLE>
- <FORCE_FOR_BRACES_STYLE>ALWAYS_ADD</FORCE_FOR_BRACES_STYLE>
- <FORCE_FOREACH_BRACES_STYLE>ALWAYS_ADD</FORCE_FOREACH_BRACES_STYLE>
- <FORCE_IFELSE_BRACES_STYLE>ALWAYS_ADD</FORCE_IFELSE_BRACES_STYLE>
- <FORCE_WHILE_BRACES_STYLE>ALWAYS_ADD</FORCE_WHILE_BRACES_STYLE>
- <INDENT_ANONYMOUS_METHOD_BLOCK>False</INDENT_ANONYMOUS_METHOD_BLOCK>
- <INDENT_EMBRACED_INITIALIZER_BLOCK>False</INDENT_EMBRACED_INITIALIZER_BLOCK>
- <KEEP_BLANK_LINES_IN_CODE>1</KEEP_BLANK_LINES_IN_CODE>
- <KEEP_BLANK_LINES_IN_DECLARATIONS>1</KEEP_BLANK_LINES_IN_DECLARATIONS>
- <KEEP_USER_LINEBREAKS>False</KEEP_USER_LINEBREAKS>
- <MODIFIERS_ORDER IsNull="False">
- <Item>public</Item>
- <Item>protected</Item>
- <Item>internal</Item>
- <Item>private</Item>
- <Item>new</Item>
- <Item>abstract</Item>
- <Item>virtual</Item>
- <Item>override</Item>
- <Item>sealed</Item>
- <Item>static</Item>
- <Item>readonly</Item>
- <Item>extern</Item>
- <Item>unsafe</Item>
- <Item>volatile</Item>
- </MODIFIERS_ORDER>
- <PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE>False</PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE>
- <PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE>False</PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE>
- <PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE>False</PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE>
- <PLACE_TYPE_CONSTRAINTS_ON_SAME_LINE>False</PLACE_TYPE_CONSTRAINTS_ON_SAME_LINE>
- <PLACE_WHILE_ON_NEW_LINE>True</PLACE_WHILE_ON_NEW_LINE>
- <REDUNDANT_THIS_QUALIFIER_STYLE>ALWAYS_USE</REDUNDANT_THIS_QUALIFIER_STYLE>
- <SIMPLE_EMBEDDED_STATEMENT_STYLE>ON_SINGLE_LINE</SIMPLE_EMBEDDED_STATEMENT_STYLE>
- <SPACE_AFTER_TYPECAST_PARENTHESES>False</SPACE_AFTER_TYPECAST_PARENTHESES>
- <SPACE_AROUND_MULTIPLICATIVE_OP>True</SPACE_AROUND_MULTIPLICATIVE_OP>
- <SPACE_BEFORE_SIZEOF_PARENTHESES>False</SPACE_BEFORE_SIZEOF_PARENTHESES>
- <SPACE_BEFORE_TYPEOF_PARENTHESES>False</SPACE_BEFORE_TYPEOF_PARENTHESES>
- <SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES>True</SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES>
- <STICK_COMMENT>False</STICK_COMMENT>
- <WRAP_AFTER_DECLARATION_LPAR>True</WRAP_AFTER_DECLARATION_LPAR>
- <WRAP_AFTER_INVOCATION_LPAR>True</WRAP_AFTER_INVOCATION_LPAR>
- <WRAP_ARGUMENTS_STYLE>CHOP_IF_LONG</WRAP_ARGUMENTS_STYLE>
- <WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT>True</WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT>
- <WRAP_EXTENDS_LIST_STYLE>CHOP_IF_LONG</WRAP_EXTENDS_LIST_STYLE>
- <WRAP_PARAMETERS_STYLE>CHOP_IF_LONG</WRAP_PARAMETERS_STYLE>
- </FormatSettings>
- <UsingsSettings>
- <AddImportsToDeepestScope>True</AddImportsToDeepestScope>
- <QualifiedUsingAtNestedScope>True</QualifiedUsingAtNestedScope>
- </UsingsSettings>
- <Naming2>
- <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
- <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
- <ExceptionName IsNull="False">
- </ExceptionName>
- <OverrideDefaultSettings>True</OverrideDefaultSettings>
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
- <PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
- <PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
- </Naming2>
- <CustomMemberReorderingPatterns><![CDATA[<?xml version="1.0" encoding="utf-8"?>
-<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
-
- <!-- Do not reorder COM interfaces -->
- <Pattern>
- <Match>
- <And Weight="2000">
- <Kind Is="interface"/>
- <HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"
- Inherit="true"/>
- </And>
- </Match>
- </Pattern>
-
- <!-- Do not reorder P/Invoke structs -->
- <Pattern>
- <Match>
- <And Weight="2000">
- <Or>
- <Kind Is="struct"/>
- <Kind Is="class"/>
- </Or>
- <HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"
- Inherit="true"/>
- </And>
- </Match>
- </Pattern>
-
- <!-- Do not reorder P/Invoke classes (called xxxNativeMethods) -->
- <Pattern>
- <Match>
- <And Weight="2000">
- <Kind Is="class"/>
- <Name Is=".*NativeMethods" />
- </And>
- </Match>
- </Pattern>
-
- <!-- StyleCop pattern -->
- <Pattern RemoveAllRegions="true">
- <Match>
- <Or Weight="1000" >
- <Kind Is="class" />
- <Kind Is="struct" />
- <Kind Is="interface"/>
- </Or>
- </Match>
-
- <!-- constants and fields -->
- <Entry>
- <Match>
- <Or>
- <Kind Is="constant"/>
- <Kind Is="field"/>
- </Or>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private"/>
- <Kind Order="constant field"/>
- <Readonly/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Constants and Fields"/>
- </Entry>
-
- <!-- constructors -->
- <Entry>
- <Match>
- <Or Weight="200">
- <Kind Is="constructor"/>
- <Kind Is="destructor"/>
- </Or>
- </Match>
- <Sort>
- <Static/>
- <Kind Order="constructor destructor"/>
- <Access Order="public internal protected-internal protected private"/>
- </Sort>
- <Group Region="Constructors and Destructors"/>
- </Entry>
-
- <!-- delegates -->
- <Entry>
- <Match>
- <Kind Is="delegate"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static />
- <Name/>
- </Sort>
- <Group Region="Delegates"/>
- </Entry>
-
- <!-- events -->
- <Entry>
- <Match>
- <Kind Is="event"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static />
- <Name/>
- </Sort>
- <Group Region="Events"/>
- </Entry>
-
- <!-- enum -->
- <Entry>
- <Match>
- <Kind Is="enum"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- <Group Region="Enums"/>
- </Entry>
-
- <!-- interfaces -->
- <Entry>
- <Match>
- <Kind Is="interface" />
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- <Group Region="Interfaces"/>
- </Entry>
-
- <!-- properties -->
- <Entry>
- <Match>
- <Kind Is="property"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Properties"/>
- </Entry>
-
- <!-- indexers -->
- <Entry>
- <Match>
- <Kind Is="indexer"
- Weight="300" />
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Indexers"/>
- </Entry>
-
- <!-- operator -->
- <Entry>
- <Match>
- <Kind Is="operator"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private" />
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Operators"/>
- </Entry>
-
- <!-- public methods -->
- <Entry>
- <Match>
- <And>
- <Kind Is="method"/>
- <Access Is="public"/>
- </And>
- </Match>
- <Sort>
- <Access Order="public"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Public Methods"/>
- </Entry>
-
- <!-- Implemented Interfaces -->
- <Entry>
- <Match>
- <And Weight="500">
- <Kind Is="method"/>
- <ImplementsInterface CLRName=".*"/>
- </And>
- </Match>
- <Sort>
- <ImplementsInterface />
- <Access Order="public internal protected-internal protected private"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Implemented Interfaces">
- <ImplementsInterface Region="${ImplementsInterface}" />
- </Group>
- </Entry>
-
- <!-- other methods -->
- <Entry>
- <Match>
- <Kind Is="method"/>
- </Match>
- <Sort>
- <Access Order="public internal protected-internal protected private"/>
- <Static/>
- <Name/>
- </Sort>
- <Group Region="Methods"/>
- </Entry>
-
- <!-- Nested structs -->
- <Entry>
- <Match>
- <Kind Is="struct"
- Weight="600" />
- </Match>
- <Sort>
- <Static />
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- </Entry>
-
- <!-- Nested classes -->
- <Entry>
- <Match>
- <Kind Is="class"
- Weight="700" />
- </Match>
- <Sort>
- <Static />
- <Access Order="public internal protected-internal protected private" />
- <Name/>
- </Sort>
- </Entry>
-
- <!-- all other members -->
- <Entry/>
-
- </Pattern>
-</Patterns>
-]]></CustomMemberReorderingPatterns>
- </CSharp>
- <VB>
- <FormatSettings />
- <ImportsSettings />
- <Naming2>
- <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
- <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
- </Naming2>
- </VB>
- <Web>
- <Naming2 />
- </Web>
- <Xaml>
- <Naming2 />
- </Xaml>
- <XML>
- <FormatSettings />
- </XML>
- <FileHeader><![CDATA[/* file.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. */]]></FileHeader>
- <GenerateMemberBody />
- <Naming2>
- <EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
- <EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
- <ExceptionName IsNull="False">
- </ExceptionName>
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
- <PredefinedRule Inspect="False" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
- <PredefinedRule Inspect="False" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
- <PredefinedRule Inspect="False" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
- <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
- <PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
- <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
- <Abbreviation Text="CLI" />
- <Abbreviation Text="DRC" />
- <Abbreviation Text="ID" />
- <Abbreviation Text="MP" />
- <Abbreviation Text="DVD" />
- </Naming2>
- </CodeStyleSettings>
-</Configuration> \ No newline at end of file
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj
index 20cb57342..203886d13 100644
--- a/win/C#/HandBrakeCS.csproj
+++ b/win/C#/HandBrakeCS.csproj
@@ -476,7 +476,7 @@
<Target Name="AfterBuild">
</Target>
-->
- <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />
+ <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />
<PropertyGroup Condition=" '$(Configuration)' == 'Install' ">
<PostBuildEvent>
cd ../../
diff --git a/win/C#/HandBrakeCS.csproj.ReSharper b/win/C#/HandBrakeCS.csproj.ReSharper
deleted file mode 100644
index 9b0507870..000000000
--- a/win/C#/HandBrakeCS.csproj.ReSharper
+++ /dev/null
@@ -1,3 +0,0 @@
-<Configuration>
- <Localizable>No</Localizable>
-</Configuration> \ No newline at end of file
diff --git a/win/C#/HandBrakeCS.sln b/win/C#/HandBrakeCS.sln
deleted file mode 100644
index bde8c131b..000000000
--- a/win/C#/HandBrakeCS.sln
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrakeCS", "HandBrakeCS.csproj", "{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x86 = Debug|x86
- Install|Any CPU = Install|Any CPU
- Install|x86 = Install|x86
- NightlyBuild|Any CPU = NightlyBuild|Any CPU
- NightlyBuild|x86 = NightlyBuild|x86
- Release|Any CPU = Release|Any CPU
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x86.ActiveCfg = Release|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x86.Build.0 = Release|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Any CPU.ActiveCfg = Install|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Any CPU.Build.0 = Install|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x86.ActiveCfg = Install|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x86.Build.0 = Install|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Any CPU.ActiveCfg = NightlyBuild|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Any CPU.Build.0 = NightlyBuild|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x86.ActiveCfg = NightlyBuild|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x86.Build.0 = NightlyBuild|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Any CPU.Build.0 = Release|Any CPU
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x86.ActiveCfg = Release|x86
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/win/C#/Presets/PresetsHandler.cs b/win/C#/Presets/PresetsHandler.cs
index 971a47859..43659b07a 100644
--- a/win/C#/Presets/PresetsHandler.cs
+++ b/win/C#/Presets/PresetsHandler.cs
@@ -46,7 +46,7 @@ namespace Handbrake.Presets
private List<Preset> userPresets = new List<Preset>();
/// <summary>
- /// Last preset added
+ /// Gets or sets the Last preset added
/// </summary>
public Preset LastPresetAdded { get; set; }
diff --git a/win/C#/Program.cs b/win/C#/Program.cs
index 1c428c874..42d9d9b87 100644
--- a/win/C#/Program.cs
+++ b/win/C#/Program.cs
@@ -10,12 +10,12 @@ namespace Handbrake
using System.IO;
using System.Windows.Forms;
+ using Handbrake.Presets;
+
using HandBrake.ApplicationServices;
using Handbrake.Properties;
- using Presets;
-
/// <summary>
/// HandBrake Starts Here
/// </summary>
@@ -24,13 +24,14 @@ namespace Handbrake
/// <summary>
/// The main entry point for the application.
/// </summary>
+ /// <param name="args">Arguments passed in from the shortcut/executable</param>
[STAThread]
public static void Main(string[] args)
{
InstanceId = Process.GetProcessesByName("HandBrake").Length;
// Handle any unhandled exceptions
- AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+ AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
// Attempt to upgrade / keep the users settings between versions
if (Settings.Default.UpdateRequired)
@@ -121,9 +122,6 @@ namespace Handbrake
}
}
-
- public static int InstanceId = 0;
-
-
+ public static int InstanceId;
}
} \ No newline at end of file
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs
index b2f489294..585e2f550 100644
--- a/win/C#/Properties/Settings.Designer.cs
+++ b/win/C#/Properties/Settings.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.1
+// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@ namespace Handbrake.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -397,18 +397,6 @@ namespace Handbrake.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool disableResCalc {
- get {
- return ((bool)(this["disableResCalc"]));
- }
- set {
- this["disableResCalc"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool growlQueue {
get {
return ((bool)(this["growlQueue"]));
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings
index c7e001d5e..af1a7f563 100644
--- a/win/C#/Properties/Settings.settings
+++ b/win/C#/Properties/Settings.settings
@@ -95,9 +95,6 @@
<Setting Name="hb_platform" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
- <Setting Name="disableResCalc" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="growlQueue" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
diff --git a/win/C#/Settings.StyleCop b/win/C#/Settings.StyleCop
index 139f00afe..73638a716 100644
--- a/win/C#/Settings.StyleCop
+++ b/win/C#/Settings.StyleCop
@@ -59,6 +59,11 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="ElementsMustBeDocumented">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings>
<StringProperty Name="CompanyName">HandBrake Project (http://handbrake.fr)</StringProperty>
@@ -72,6 +77,16 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="FieldsMustBePrivate">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
+ <Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -157,6 +172,11 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="CommentsMustContainText">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -167,6 +187,21 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="ElementMustBeginWithUpperCaseLetter">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
+ <Rule Name="AccessibleFieldsMustBeginWithUpperCaseLetter">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
+ <Rule Name="FieldNamesMustBeginWithLowerCaseLetter">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -177,6 +212,16 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="ElementsMustAppearInTheCorrectOrder">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
+ <Rule Name="StaticElementsMustAppearBeforeInstanceElements">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
diff --git a/win/C#/app.config b/win/C#/app.config
index a51c09d8c..c1ee5fefa 100644
--- a/win/C#/app.config
+++ b/win/C#/app.config
@@ -101,9 +101,6 @@
<setting name="hb_platform" serializeAs="String">
<value />
</setting>
- <setting name="disableResCalc" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="growlQueue" serializeAs="String">
<value>False</value>
</setting>
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs
index 62799e926..ffc02fa8f 100644
--- a/win/C#/frmActivityWindow.cs
+++ b/win/C#/frmActivityWindow.cs
@@ -120,7 +120,7 @@ namespace Handbrake
this.mode = setMode;
Array values = Enum.GetValues(typeof(ActivityLogMode));
- Properties.Settings.Default.ActivityWindowLastMode = (int) values.GetValue(Convert.ToInt32(setMode));
+ Properties.Settings.Default.ActivityWindowLastMode = (int)values.GetValue(Convert.ToInt32(setMode));
Properties.Settings.Default.Save();
this.Text = mode == ActivityLogMode.Scan
@@ -155,7 +155,7 @@ namespace Handbrake
/// </param>
private void NewActivityWindow_Load(object sender, EventArgs e)
{
- ActivityLogMode activitLogMode = (ActivityLogMode) Enum.ToObject(typeof(ActivityLogMode), Properties.Settings.Default.ActivityWindowLastMode);
+ ActivityLogMode activitLogMode = (ActivityLogMode)Enum.ToObject(typeof(ActivityLogMode), Properties.Settings.Default.ActivityWindowLastMode);
SetMode(activitLogMode);
}
diff --git a/win/C#/frmAddPreset.cs b/win/C#/frmAddPreset.cs
index 22ba835d7..ecb952911 100644
--- a/win/C#/frmAddPreset.cs
+++ b/win/C#/frmAddPreset.cs
@@ -28,7 +28,7 @@ namespace Handbrake
/// <summary>
/// Initializes a new instance of the <see cref="frmAddPreset"/> class.
/// </summary>
- /// <param name="mainWindow"></param>
+ /// <param name="mainWindow">The Main Window</param>
/// <param name="presetHandler">
/// The preset handler.
/// </param>
@@ -69,6 +69,7 @@ namespace Handbrake
case 1:
pictureSettingsMode = QueryPictureSettingsMode.SourceMaximum;
break;
+
default:
pictureSettingsMode = QueryPictureSettingsMode.None;
break;
diff --git a/win/C#/frmDownload.cs b/win/C#/frmDownload.cs
index a3067e17d..f3ae682c1 100644
--- a/win/C#/frmDownload.cs
+++ b/win/C#/frmDownload.cs
@@ -12,15 +12,18 @@ namespace Handbrake
using System.Threading;
using System.Windows.Forms;
+ /// <summary>
+ /// The Update Download Screen
+ /// </summary>
public partial class frmDownload : Form
{
- private readonly Thread _downloadThread;
- private Stream _responceStream;
- private Stream _loacalStream;
- private HttpWebRequest _webRequest;
- private HttpWebResponse _webResponse;
- private static int _progress;
- private bool _killThread;
+ private readonly Thread downloadThread;
+ private Stream responceStream;
+ private Stream loacalStream;
+ private HttpWebRequest webRequest;
+ private HttpWebResponse webResponse;
+ private static int progress;
+ private bool killThread;
private delegate void UpdateProgessCallback(long bytesRead, long totalBytes);
@@ -32,14 +35,14 @@ namespace Handbrake
{
InitializeComponent();
- _downloadThread = new Thread(Download);
- _downloadThread.Start(filename);
+ downloadThread = new Thread(Download);
+ downloadThread.Start(filename);
}
private void Download(object file)
{
string tempPath = Path.Combine(Path.GetTempPath(), "handbrake-setup.exe");
- string hbUpdate = (string) file;
+ string hbUpdate = (string)file;
WebClient wcDownload = new WebClient();
try
@@ -47,29 +50,29 @@ namespace Handbrake
if (File.Exists(tempPath))
File.Delete(tempPath);
- _webRequest = (HttpWebRequest) WebRequest.Create(hbUpdate);
- _webRequest.Credentials = CredentialCache.DefaultCredentials;
- _webResponse = (HttpWebResponse) _webRequest.GetResponse();
- long fileSize = _webResponse.ContentLength;
+ webRequest = (HttpWebRequest)WebRequest.Create(hbUpdate);
+ webRequest.Credentials = CredentialCache.DefaultCredentials;
+ webResponse = (HttpWebResponse)webRequest.GetResponse();
+ long fileSize = webResponse.ContentLength;
- _responceStream = wcDownload.OpenRead(hbUpdate);
- _loacalStream = new FileStream(tempPath, FileMode.Create, FileAccess.Write, FileShare.None);
+ responceStream = wcDownload.OpenRead(hbUpdate);
+ loacalStream = new FileStream(tempPath, FileMode.Create, FileAccess.Write, FileShare.None);
int bytesSize;
byte[] downBuffer = new byte[2048];
long flength = 0;
- while ((bytesSize = _responceStream.Read(downBuffer, 0, downBuffer.Length)) > 0)
+ while ((bytesSize = responceStream.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
- if (_killThread)
+ if (killThread)
return;
- _loacalStream.Write(downBuffer, 0, bytesSize);
- flength = _loacalStream.Length;
- Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] {_loacalStream.Length, fileSize});
+ loacalStream.Write(downBuffer, 0, bytesSize);
+ flength = loacalStream.Length;
+ Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] {loacalStream.Length, fileSize});
}
- _responceStream.Close();
- _loacalStream.Close();
+ responceStream.Close();
+ loacalStream.Close();
if (flength != fileSize)
Invoke(new DownloadFailedCallback(this.DownloadFailed));
@@ -85,8 +88,8 @@ namespace Handbrake
private void UpdateProgress(long bytesRead, long totalBytes)
{
long p = (bytesRead * 100) / totalBytes;
- int.TryParse(p.ToString(), out _progress);
- progress_download.Value = _progress;
+ int.TryParse(p.ToString(), out progress);
+ progress_download.Value = progress;
lblProgress.Text = (bytesRead / 1024) + "k of " + (totalBytes / 1024) + "k ";
}
@@ -108,11 +111,11 @@ namespace Handbrake
private void btn_cancel_Click(object sender, EventArgs e)
{
- _killThread = true;
+ killThread = true;
lblProgress.Text = "Cancelling ...";
- if (_webResponse != null) _webResponse.Close();
- if (_responceStream != null) _responceStream.Close();
- if (_loacalStream != null) _loacalStream.Close();
+ if (webResponse != null) webResponse.Close();
+ if (responceStream != null) responceStream.Close();
+ if (loacalStream != null) loacalStream.Close();
this.Close();
}
}
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 83135c6c0..71ccef43b 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -26,6 +26,9 @@ namespace Handbrake
using Presets;
using Properties;
+ /// <summary>
+ /// The Main Window
+ /// </summary>
public partial class frmMain : Form
{
// Objects which may be used by one or more other objects *************
@@ -915,7 +918,6 @@ namespace Handbrake
if (treeView_presets.SelectedNode != null)
{
-
if (savefiledialog.ShowDialog() == DialogResult.OK)
{
Preset preset = presetHandler.GetPreset(treeView_presets.SelectedNode.Text);
@@ -1126,7 +1128,6 @@ namespace Handbrake
lbl_encode.Text = encodeQueue.Count + " encode(s) pending in the queue";
queueWindow.Show();
-
}
/// <summary>
@@ -1288,7 +1289,6 @@ namespace Handbrake
int id;
if (int.TryParse(driveId, out id))
{
-
this.dvdDrivePath = drives[id].RootDirectory;
this.dvdDriveLabel = drives[id].VolumeLabel;
@@ -1341,7 +1341,7 @@ namespace Handbrake
// Populate the Angles dropdown
drop_angle.Items.Clear();
- if (!Properties.Settings.Default.noDvdNav)
+ if (!Settings.Default.noDvdNav)
{
drop_angle.Visible = true;
lbl_angle.Visible = true;
@@ -1382,7 +1382,7 @@ namespace Handbrake
labelSource.Text = labelSource.Text = Path.GetFileName(selectedTitle.SourceName);
// Run the AutoName & ChapterNaming functions
- if (Properties.Settings.Default.autoNaming)
+ if (Settings.Default.autoNaming)
{
string autoPath = Main.AutoName(this);
if (autoPath != null)
@@ -1444,7 +1444,7 @@ namespace Handbrake
// Add more rows to the Chapter menu if needed.
if (Check_ChapterMarkers.Checked)
{
- int i = data_chpt.Rows.Count, finish = 0;
+ int i = data_chpt.Rows.Count, finish;
int.TryParse(drop_chapterFinish.Text, out finish);
while (i < finish)
@@ -1466,7 +1466,7 @@ namespace Handbrake
.ToString();
// Run the Autonaming function
- if (Properties.Settings.Default.autoNaming)
+ if (Settings.Default.autoNaming)
text_destination.Text = Main.AutoName(this);
// Disable chapter markers if only 1 chapter is selected.
@@ -1515,8 +1515,8 @@ namespace Handbrake
private void drop_mode_SelectedIndexChanged(object sender, EventArgs e)
{
// Reset
- this.drop_chapterFinish.TextChanged -= new EventHandler(this.SecondsOrFramesChanged);
- this.drop_chapterStart.TextChanged -= new EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterFinish.TextChanged -= this.SecondsOrFramesChanged;
+ this.drop_chapterStart.TextChanged -= this.SecondsOrFramesChanged;
// Do Work
switch (drop_mode.SelectedIndex)
@@ -1533,8 +1533,8 @@ namespace Handbrake
lbl_duration.Text = "--:--:--";
return;
case 1:
- this.drop_chapterStart.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
- this.drop_chapterFinish.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterStart.TextChanged += this.SecondsOrFramesChanged;
+ this.drop_chapterFinish.TextChanged += this.SecondsOrFramesChanged;
drop_chapterStart.DropDownStyle = ComboBoxStyle.Simple;
drop_chapterFinish.DropDownStyle = ComboBoxStyle.Simple;
if (selectedTitle != null)
@@ -1544,8 +1544,8 @@ namespace Handbrake
}
return;
case 2:
- this.drop_chapterStart.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
- this.drop_chapterFinish.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterStart.TextChanged += this.SecondsOrFramesChanged;
+ this.drop_chapterFinish.TextChanged += this.SecondsOrFramesChanged;
drop_chapterStart.DropDownStyle = ComboBoxStyle.Simple;
drop_chapterFinish.DropDownStyle = ComboBoxStyle.Simple;
if (selectedTitle != null)
@@ -1573,23 +1573,17 @@ namespace Handbrake
else if (drop_format.SelectedIndex.Equals(1))
DVD_Save.FilterIndex = 2;
- if (DVD_Save.ShowDialog() == DialogResult.OK)
+ if (DVD_Save.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(DVD_Save.FileName))
{
// Add a file extension manually, as FileDialog.AddExtension has issues with dots in filenames
switch (DVD_Save.FilterIndex)
{
case 1:
- if (
- !Path.GetExtension(DVD_Save.FileName).Equals(".mp4",
- StringComparison.InvariantCultureIgnoreCase))
- if (Properties.Settings.Default.useM4v)
- DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".m4v").Replace(".mkv", ".m4v");
- else
- DVD_Save.FileName = DVD_Save.FileName.Replace(".m4v", ".mp4").Replace(".mkv", ".mp4");
+ if (!Path.GetExtension(DVD_Save.FileName).Equals(".mp4", StringComparison.InvariantCultureIgnoreCase))
+ DVD_Save.FileName = Settings.Default.useM4v ? DVD_Save.FileName.Replace(".mp4", ".m4v").Replace(".mkv", ".m4v") : DVD_Save.FileName.Replace(".m4v", ".mp4").Replace(".mkv", ".mp4");
break;
case 2:
- if (
- !Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase))
+ if (!Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase))
DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".mkv").Replace(".m4v", ".mkv");
break;
default:
@@ -1619,7 +1613,7 @@ namespace Handbrake
switch (drop_format.SelectedIndex)
{
case 0:
- if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked ||
+ if (Settings.Default.useM4v || Check_ChapterMarkers.Checked ||
AudioSettings.RequiresM4V() || Subtitles.RequiresM4V())
SetExtension(".m4v");
else
@@ -1647,7 +1641,7 @@ namespace Handbrake
public void SetExtension(string newExtension)
{
if (newExtension == ".mp4" || newExtension == ".m4v")
- if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() ||
+ if (Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() ||
Subtitles.RequiresM4V())
newExtension = ".m4v";
else
@@ -1697,12 +1691,11 @@ namespace Handbrake
slider_videoQuality.Minimum = 0;
slider_videoQuality.TickFrequency = 1;
- CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
- double cqStep = Properties.Settings.Default.x264cqstep;
+ double cqStep = Settings.Default.x264cqstep;
double multiplier = 1.0 / cqStep;
double value = slider_videoQuality.Value * multiplier;
- slider_videoQuality.Maximum = (int)(51 / Properties.Settings.Default.x264cqstep);
+ slider_videoQuality.Maximum = (int)(51 / Settings.Default.x264cqstep);
if (value < slider_videoQuality.Maximum)
slider_videoQuality.Value = slider_videoQuality.Maximum - (int)value;
@@ -1761,7 +1754,7 @@ namespace Handbrake
}
}
- private double _cachedCqStep = Properties.Settings.Default.x264cqstep;
+ private double cachedCqStep = Settings.Default.x264cqstep;
/// <summary>
/// Update the CQ slider for x264 for a new CQ step. This is set from option
@@ -1769,17 +1762,17 @@ namespace Handbrake
public void setQualityFromSlider()
{
// Work out the current RF value.
- double cqStep = _cachedCqStep;
+ double cqStep = cachedCqStep;
double rfValue = 51.0 - slider_videoQuality.Value * cqStep;
// Change the maximum value for the slider
- slider_videoQuality.Maximum = (int)(51 / Properties.Settings.Default.x264cqstep);
+ slider_videoQuality.Maximum = (int)(51 / Settings.Default.x264cqstep);
// Reset the CQ slider to RF0
slider_videoQuality.Value = slider_videoQuality.Maximum;
// Reset the CQ slider back to the previous value as close as possible
- double cqStepNew = Properties.Settings.Default.x264cqstep;
+ double cqStepNew = Settings.Default.x264cqstep;
double rfValueCurrent = 51.0 - slider_videoQuality.Value * cqStepNew;
while (rfValueCurrent < rfValue)
{
@@ -1788,12 +1781,12 @@ namespace Handbrake
}
// Cache the CQ step for the next calculation
- _cachedCqStep = Properties.Settings.Default.x264cqstep;
+ cachedCqStep = Settings.Default.x264cqstep;
}
private void slider_videoQuality_Scroll(object sender, EventArgs e)
{
- double cqStep = Properties.Settings.Default.x264cqstep;
+ double cqStep = Settings.Default.x264cqstep;
switch (drp_videoEncoder.Text)
{
case "MPEG-4 (FFmpeg)":
@@ -1864,7 +1857,7 @@ namespace Handbrake
}
else
{
- if (drop_format.SelectedIndex != 1 && !Properties.Settings.Default.useM4v)
+ if (drop_format.SelectedIndex != 1 && !Settings.Default.useM4v)
SetExtension(".mp4");
data_chpt.Enabled = false;
btn_importChapters.Enabled = false;
@@ -1884,9 +1877,7 @@ namespace Handbrake
private void btn_export_Click(object sender, EventArgs e)
{
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Csv File|*.csv";
- saveFileDialog.DefaultExt = "csv";
+ SaveFileDialog saveFileDialog = new SaveFileDialog { Filter = "Csv File|*.csv", DefaultExt = "csv" };
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
string filename = saveFileDialog.FileName;
@@ -1942,8 +1933,8 @@ namespace Handbrake
try
{
SourceScan.Scan(sourcePath, title);
- SourceScan.ScanStatusChanged += new EventHandler(SourceScan_ScanStatusChanged);
- SourceScan.ScanCompleted += new EventHandler(SourceScan_ScanCompleted);
+ SourceScan.ScanStatusChanged += SourceScan_ScanStatusChanged;
+ SourceScan.ScanCompleted += SourceScan_ScanCompleted;
}
catch (Exception exc)
{
@@ -1960,9 +1951,9 @@ namespace Handbrake
/// <param name="e">
/// The e.
/// </param>
- private void SourceScan_ScanStatusChanged(object sender, EventArgs e)
+ private void SourceScan_ScanStatusChanged(object sender, HandBrake.ApplicationServices.ScanProgressEventArgs e)
{
- UpdateScanStatusLabel();
+ UpdateScanStatusLabel(sender, e);
}
/// <summary>
@@ -1982,14 +1973,17 @@ namespace Handbrake
/// <summary>
/// Update the Scan Status Label
/// </summary>
- private void UpdateScanStatusLabel()
+ /// <param name="sender"> The Sender </param>
+ /// <param name="e">Scan Progress Event Args</param>
+ private void UpdateScanStatusLabel(object sender, HandBrake.ApplicationServices.ScanProgressEventArgs e)
{
if (InvokeRequired)
{
- BeginInvoke(new UpdateWindowHandler(UpdateScanStatusLabel));
+ BeginInvoke(new ScanService.ScanProgessStatus(UpdateScanStatusLabel), new[] { e });
return;
}
- lbl_encode.Text = SourceScan.ScanStatus;
+
+ lbl_encode.Text = "Scanning Title" + e.CurrentTitle + " of " + e.TotalTitles;
}
/// <summary>
@@ -2110,7 +2104,7 @@ namespace Handbrake
/// </summary>
private void KillScan()
{
- SourceScan.ScanCompleted -= new EventHandler(SourceScan_ScanCompleted);
+ SourceScan.ScanCompleted -= SourceScan_ScanCompleted;
EnableGUI();
ResetGUI();
@@ -2200,10 +2194,10 @@ namespace Handbrake
ProgressBarStatus.Visible = false;
btn_start.Text = "Start";
btn_start.ToolTipText = "Start the encoding process";
- btn_start.Image = Properties.Resources.Play;
+ btn_start.Image = Resources.Play;
// If the window is minimized, display the notification in a popup.
- if (Properties.Settings.Default.trayIconAlerts)
+ if (Settings.Default.trayIconAlerts)
if (FormWindowState.Minimized == this.WindowState)
{
notifyIcon.BalloonTipText = lbl_encode.Text;
@@ -2234,7 +2228,7 @@ namespace Handbrake
lbl_encode.Text = "Encoding with " + encodeQueue.Count + " encode(s) pending";
btn_start.Text = "Stop";
btn_start.ToolTipText = "Stop the encoding process.";
- btn_start.Image = Properties.Resources.stop;
+ btn_start.Image = Resources.stop;
}
catch (Exception exc)
{
@@ -2295,7 +2289,7 @@ namespace Handbrake
Text = drive.RootDirectory + " (" + drive.VolumeLabel + ")",
Image = Resources.disc_small
};
- menuItem.Click += new EventHandler(mnu_dvd_drive_Click);
+ menuItem.Click += mnu_dvd_drive_Click;
menuItems.Add(menuItem);
}
@@ -2436,7 +2430,7 @@ namespace Handbrake
if (SourceScan.IsScanning)
{
- SourceScan.ScanCompleted -= new EventHandler(SourceScan_ScanCompleted);
+ SourceScan.ScanCompleted -= SourceScan_ScanCompleted;
SourceScan.Stop();
}
}
diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs
index 2541defc3..f7aa39631 100644
--- a/win/C#/frmOptions.Designer.cs
+++ b/win/C#/frmOptions.Designer.cs
@@ -100,8 +100,6 @@ namespace Handbrake
this.label30 = new System.Windows.Forms.Label();
this.check_disablePresetNotification = new System.Windows.Forms.CheckBox();
this.label28 = new System.Windows.Forms.Label();
- this.tab_debug = new System.Windows.Forms.TabPage();
- this.check_disableResCalc = new System.Windows.Forms.CheckBox();
this.label8 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pathFinder = new System.Windows.Forms.FolderBrowserDialog();
@@ -143,7 +141,6 @@ namespace Handbrake
this.tab_audio_sub.SuspendLayout();
this.tab_cli.SuspendLayout();
this.tab_advanced.SuspendLayout();
- this.tab_debug.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.tableLayoutPanel5.SuspendLayout();
this.SuspendLayout();
@@ -191,7 +188,6 @@ namespace Handbrake
this.tab_options.Controls.Add(this.tab_audio_sub);
this.tab_options.Controls.Add(this.tab_cli);
this.tab_options.Controls.Add(this.tab_advanced);
- this.tab_options.Controls.Add(this.tab_debug);
this.tab_options.Dock = System.Windows.Forms.DockStyle.Fill;
this.tab_options.Location = new System.Drawing.Point(3, 38);
this.tab_options.Name = "tab_options";
@@ -1049,29 +1045,6 @@ namespace Handbrake
this.label28.TabIndex = 85;
this.label28.Text = "x264:";
//
- // tab_debug
- //
- this.tab_debug.Controls.Add(this.check_disableResCalc);
- this.tab_debug.Location = new System.Drawing.Point(4, 22);
- this.tab_debug.Name = "tab_debug";
- this.tab_debug.Padding = new System.Windows.Forms.Padding(3);
- this.tab_debug.Size = new System.Drawing.Size(580, 334);
- this.tab_debug.TabIndex = 7;
- this.tab_debug.Text = "Debug";
- this.tab_debug.UseVisualStyleBackColor = true;
- //
- // check_disableResCalc
- //
- this.check_disableResCalc.AutoSize = true;
- this.check_disableResCalc.Location = new System.Drawing.Point(13, 15);
- this.check_disableResCalc.Name = "check_disableResCalc";
- this.check_disableResCalc.Size = new System.Drawing.Size(327, 17);
- this.check_disableResCalc.TabIndex = 0;
- this.check_disableResCalc.Text = "Disable Resolution Calculation for \"None\" and \"Custom\" modes.";
- this.ToolTip.SetToolTip(this.check_disableResCalc, resources.GetString("check_disableResCalc.ToolTip"));
- this.check_disableResCalc.UseVisualStyleBackColor = true;
- this.check_disableResCalc.CheckedChanged += new System.EventHandler(this.check_disableResCalc_CheckedChanged);
- //
// label8
//
this.label8.Anchor = System.Windows.Forms.AnchorStyles.Left;
@@ -1484,8 +1457,6 @@ namespace Handbrake
this.tab_cli.PerformLayout();
this.tab_advanced.ResumeLayout(false);
this.tab_advanced.PerformLayout();
- this.tab_debug.ResumeLayout(false);
- this.tab_debug.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.tableLayoutPanel5.ResumeLayout(false);
this.tableLayoutPanel5.PerformLayout();
@@ -1585,8 +1556,6 @@ namespace Handbrake
private System.Windows.Forms.RadioButton radio_dub;
private System.Windows.Forms.Label label15;
internal System.Windows.Forms.Button btn_browse;
- private System.Windows.Forms.TabPage tab_debug;
- private System.Windows.Forms.CheckBox check_disableResCalc;
internal System.Windows.Forms.CheckBox check_growlEncode;
internal System.Windows.Forms.CheckBox check_GrowlQueue;
internal System.Windows.Forms.ComboBox drop_previewScanCount;
diff --git a/win/C#/frmOptions.cs b/win/C#/frmOptions.cs
index 4475d9071..607c8ff0c 100644
--- a/win/C#/frmOptions.cs
+++ b/win/C#/frmOptions.cs
@@ -14,8 +14,11 @@ namespace Handbrake
using HandBrake.ApplicationServices;
- using Handbrake.Properties;
+ using Properties;
+ /// <summary>
+ /// The Options Screen
+ /// </summary>
public partial class frmOptions : Form
{
private frmMain mainWindow;
@@ -34,18 +37,18 @@ namespace Handbrake
// #############################
// Enable Tooltips.
- if (Properties.Settings.Default.tooltipEnable)
+ if (Settings.Default.tooltipEnable)
{
check_tooltip.CheckState = CheckState.Checked;
ToolTip.Active = true;
}
// Update Check
- if (Properties.Settings.Default.updateStatus)
+ if (Settings.Default.updateStatus)
check_updateCheck.CheckState = CheckState.Checked;
// Days between update checks
- switch (Properties.Settings.Default.daysBetweenUpdateCheck)
+ switch (Settings.Default.daysBetweenUpdateCheck)
{
case 1:
drop_updateCheckDays.SelectedIndex = 0;
@@ -59,51 +62,51 @@ namespace Handbrake
}
// On Encode Completeion Action
- drp_completeOption.Text = Properties.Settings.Default.CompletionOption;
+ drp_completeOption.Text = Settings.Default.CompletionOption;
// Growl.
- if (Properties.Settings.Default.growlEncode)
+ if (Settings.Default.growlEncode)
check_growlEncode.CheckState = CheckState.Checked;
- if (Properties.Settings.Default.growlQueue)
+ if (Settings.Default.growlQueue)
check_GrowlQueue.CheckState = CheckState.Checked;
// Enable auto naming feature.
- if (Properties.Settings.Default.autoNaming)
+ if (Settings.Default.autoNaming)
check_autoNaming.CheckState = CheckState.Checked;
// Store the auto name path
- text_an_path.Text = Properties.Settings.Default.autoNamePath;
+ text_an_path.Text = Settings.Default.autoNamePath;
if (text_an_path.Text == string.Empty)
text_an_path.Text = "Click 'Browse' to set the default location";
// Store auto name format
- txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat;
+ txt_autoNameFormat.Text = Settings.Default.autoNameFormat;
// Use iPod/iTunes friendly .m4v extension for MP4 files.
- if (Properties.Settings.Default.useM4v)
+ if (Settings.Default.useM4v)
check_m4v.CheckState = CheckState.Checked;
// Remove Underscores
- check_removeUnderscores.Checked = Properties.Settings.Default.AutoNameRemoveUnderscore;
+ check_removeUnderscores.Checked = Settings.Default.AutoNameRemoveUnderscore;
// Title case
- check_TitleCase.Checked = Properties.Settings.Default.AutoNameTitleCase;
+ check_TitleCase.Checked = Settings.Default.AutoNameTitleCase;
// #############################
// Picture Tab
// #############################
// VLC Path
- txt_vlcPath.Text = Properties.Settings.Default.VLC_Path;
+ txt_vlcPath.Text = Settings.Default.VLC_Path;
// #############################
// Audio and Subtitles Tab
// #############################
- drop_preferredLang.SelectedItem = Properties.Settings.Default.NativeLanguage;
+ drop_preferredLang.SelectedItem = Settings.Default.NativeLanguage;
- if (Properties.Settings.Default.DubAudio)
+ if (Settings.Default.DubAudio)
radio_dub.Checked = true;
else
radio_foreignAndSubs.Checked = true;
@@ -113,58 +116,58 @@ namespace Handbrake
// #############################
// Priority level for encodes
- drp_Priority.Text = Properties.Settings.Default.processPriority;
+ drp_Priority.Text = Settings.Default.processPriority;
- check_preventSleep.Checked = Properties.Settings.Default.preventSleep;
+ check_preventSleep.Checked = Settings.Default.preventSleep;
// Log Verbosity Level
- cb_logVerboseLvl.SelectedIndex = Properties.Settings.Default.verboseLevel;
+ cb_logVerboseLvl.SelectedIndex = Settings.Default.verboseLevel;
// Save logs in the same directory as encoded files
- if (Properties.Settings.Default.saveLogWithVideo)
+ if (Settings.Default.saveLogWithVideo)
check_saveLogWithVideo.CheckState = CheckState.Checked;
// Save Logs in a specified path
- if (Properties.Settings.Default.saveLogToSpecifiedPath)
+ if (Settings.Default.saveLogToSpecifiedPath)
check_logsInSpecifiedLocation.CheckState = CheckState.Checked;
// The saved log path
- text_logPath.Text = Properties.Settings.Default.saveLogPath;
+ text_logPath.Text = Settings.Default.saveLogPath;
- check_clearOldLogs.Checked = Properties.Settings.Default.clearOldLogs;
+ check_clearOldLogs.Checked = Settings.Default.clearOldLogs;
// #############################
// Advanced
// #############################
// Minimise to Tray
- if (Properties.Settings.Default.trayIconAlerts)
+ if (Settings.Default.trayIconAlerts)
check_trayStatusAlerts.CheckState = CheckState.Checked;
// Tray Balloon popups
- if (Properties.Settings.Default.MainWindowMinimize)
+ if (Settings.Default.MainWindowMinimize)
check_mainMinimize.CheckState = CheckState.Checked;
// Enable / Disable Query editor tab
- if (Properties.Settings.Default.QueryEditorTab)
+ if (Settings.Default.QueryEditorTab)
check_queryEditorTab.CheckState = CheckState.Checked;
check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;
// Prompt on inconsistant queries
- check_promptOnUnmatchingQueries.Checked = Properties.Settings.Default.PromptOnUnmatchingQueries;
+ check_promptOnUnmatchingQueries.Checked = Settings.Default.PromptOnUnmatchingQueries;
// Preset update notification
- if (Properties.Settings.Default.presetNotification)
+ if (Settings.Default.presetNotification)
check_disablePresetNotification.CheckState = CheckState.Checked;
// Show CLI Window
- check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;
+ check_showCliForInGUIEncode.Checked = Settings.Default.showCliForInGuiEncodeStatus;
// Set the preview count
- drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();
+ drop_previewScanCount.SelectedItem = Settings.Default.previewScanCount.ToString();
// x264 step
- string step = Properties.Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"));
+ string step = Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"));
switch (step)
{
case "1":
@@ -182,21 +185,15 @@ namespace Handbrake
}
// Use Experimental dvdnav
- if (Properties.Settings.Default.noDvdNav)
+ if (Settings.Default.noDvdNav)
check_dvdnav.CheckState = CheckState.Checked;
-
- // #############################
- // Debug
- // #############################
- if (Properties.Settings.Default.disableResCalc)
- check_disableResCalc.Checked = true;
}
#region General
private void check_updateCheck_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.updateStatus = check_updateCheck.Checked;
+ Settings.Default.updateStatus = check_updateCheck.Checked;
}
private void drop_updateCheckDays_SelectedIndexChanged(object sender, EventArgs e)
@@ -204,45 +201,45 @@ namespace Handbrake
switch (drop_updateCheckDays.SelectedIndex)
{
case 0:
- Properties.Settings.Default.daysBetweenUpdateCheck = 1;
+ Settings.Default.daysBetweenUpdateCheck = 1;
break;
case 1:
- Properties.Settings.Default.daysBetweenUpdateCheck = 7;
+ Settings.Default.daysBetweenUpdateCheck = 7;
break;
case 2:
- Properties.Settings.Default.daysBetweenUpdateCheck = 30;
+ Settings.Default.daysBetweenUpdateCheck = 30;
break;
}
}
private void check_tooltip_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.tooltipEnable = check_tooltip.Checked;
+ Settings.Default.tooltipEnable = check_tooltip.Checked;
}
private void drp_completeOption_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.CompletionOption = drp_completeOption.Text;
+ Settings.Default.CompletionOption = drp_completeOption.Text;
}
private void check_GrowlQueue_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.growlQueue = check_GrowlQueue.Checked;
+ Settings.Default.growlQueue = check_GrowlQueue.Checked;
}
private void check_growlEncode_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.growlEncode = check_growlEncode.Checked;
+ Settings.Default.growlEncode = check_growlEncode.Checked;
}
private void check_autoNaming_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.autoNaming = check_autoNaming.Checked;
+ Settings.Default.autoNaming = check_autoNaming.Checked;
}
private void txt_autoNameFormat_TextChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.autoNameFormat = txt_autoNameFormat.Text;
+ Settings.Default.autoNameFormat = txt_autoNameFormat.Text;
}
private void btn_browse_Click(object sender, EventArgs e)
@@ -255,26 +252,26 @@ namespace Handbrake
{
if (text_an_path.Text == string.Empty)
{
- Properties.Settings.Default.autoNamePath = string.Empty;
+ Settings.Default.autoNamePath = string.Empty;
text_an_path.Text = "Click 'Browse' to set the default location";
}
else
- Properties.Settings.Default.autoNamePath = text_an_path.Text;
+ Settings.Default.autoNamePath = text_an_path.Text;
}
private void check_m4v_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.useM4v = check_m4v.Checked;
+ Settings.Default.useM4v = check_m4v.Checked;
}
private void check_removeUnderscores_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.AutoNameRemoveUnderscore = check_removeUnderscores.Checked;
+ Settings.Default.AutoNameRemoveUnderscore = check_removeUnderscores.Checked;
}
private void check_TitleCase_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.AutoNameTitleCase = check_TitleCase.Checked;
+ Settings.Default.AutoNameTitleCase = check_TitleCase.Checked;
}
#endregion
@@ -290,7 +287,7 @@ namespace Handbrake
private void txt_vlcPath_TextChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.VLC_Path = txt_vlcPath.Text;
+ Settings.Default.VLC_Path = txt_vlcPath.Text;
}
#endregion
@@ -299,19 +296,19 @@ namespace Handbrake
private void drop_preferredLang_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.NativeLanguage = drop_preferredLang.SelectedItem.ToString();
+ Settings.Default.NativeLanguage = drop_preferredLang.SelectedItem.ToString();
}
private void radio_dub_CheckedChanged(object sender, EventArgs e)
{
if (radio_dub.Checked)
- Properties.Settings.Default.DubAudio = true;
+ Settings.Default.DubAudio = true;
}
private void radio_foreignAndSubs_CheckedChanged(object sender, EventArgs e)
{
if (radio_foreignAndSubs.Checked)
- Properties.Settings.Default.DubAudio = false;
+ Settings.Default.DubAudio = false;
}
#endregion
@@ -320,27 +317,27 @@ namespace Handbrake
private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.processPriority = drp_Priority.Text;
+ Settings.Default.processPriority = drp_Priority.Text;
}
private void check_preventSleep_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.preventSleep = check_preventSleep.Checked;
+ Settings.Default.preventSleep = check_preventSleep.Checked;
}
private void cb_logVerboseLvl_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.verboseLevel = cb_logVerboseLvl.SelectedIndex;
+ Settings.Default.verboseLevel = cb_logVerboseLvl.SelectedIndex;
}
private void check_saveLogWithVideo_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.saveLogWithVideo = check_saveLogWithVideo.Checked;
+ Settings.Default.saveLogWithVideo = check_saveLogWithVideo.Checked;
}
private void check_logsInSpecifiedLocation_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.saveLogToSpecifiedPath = check_logsInSpecifiedLocation.Checked;
+ Settings.Default.saveLogToSpecifiedPath = check_logsInSpecifiedLocation.Checked;
}
private void btn_saveLog_Click(object sender, EventArgs e)
@@ -353,16 +350,17 @@ namespace Handbrake
private void text_logPath_TextChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.saveLogPath = text_logPath.Text;
+ Settings.Default.saveLogPath = text_logPath.Text;
}
private void btn_viewLogs_Click(object sender, EventArgs e)
{
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
string windir = Environment.GetEnvironmentVariable("WINDIR");
- Process prc = new Process();
- prc.StartInfo.FileName = windir + @"\explorer.exe";
- prc.StartInfo.Arguments = logDir;
+ Process prc = new Process
+ {
+ StartInfo = {FileName = windir + @"\explorer.exe", Arguments = logDir}
+ };
prc.Start();
}
@@ -380,7 +378,7 @@ namespace Handbrake
private void check_clearOldLogs_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.clearOldLogs = check_clearOldLogs.Checked;
+ Settings.Default.clearOldLogs = check_clearOldLogs.Checked;
}
#endregion
@@ -389,39 +387,39 @@ namespace Handbrake
private void check_mainMinimize_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.MainWindowMinimize = check_mainMinimize.Checked;
+ Settings.Default.MainWindowMinimize = check_mainMinimize.Checked;
check_trayStatusAlerts.Enabled = check_mainMinimize.Checked;
}
private void check_trayStatusAlerts_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.trayIconAlerts = check_trayStatusAlerts.Checked;
+ Settings.Default.trayIconAlerts = check_trayStatusAlerts.Checked;
}
private void check_queryEditorTab_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.QueryEditorTab = check_queryEditorTab.Checked;
+ Settings.Default.QueryEditorTab = check_queryEditorTab.Checked;
check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;
}
private void check_promptOnUnmatchingQueries_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.PromptOnUnmatchingQueries = check_promptOnUnmatchingQueries.Checked;
+ Settings.Default.PromptOnUnmatchingQueries = check_promptOnUnmatchingQueries.Checked;
}
private void check_disablePresetNotification_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.presetNotification = check_disablePresetNotification.Checked;
+ Settings.Default.presetNotification = check_disablePresetNotification.Checked;
}
private void check_showCliForInGUIEncode_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;
+ Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;
}
private void drop_previewScanCount_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.previewScanCount = int.Parse(drop_previewScanCount.SelectedItem.ToString());
+ Settings.Default.previewScanCount = int.Parse(drop_previewScanCount.SelectedItem.ToString());
}
private void x264step_SelectedIndexChanged(object sender, EventArgs e)
@@ -429,16 +427,16 @@ namespace Handbrake
switch (drop_x264step.SelectedIndex)
{
case 0:
- Properties.Settings.Default.x264cqstep = 1.0;
+ Settings.Default.x264cqstep = 1.0;
break;
case 1:
- Properties.Settings.Default.x264cqstep = 0.50;
+ Settings.Default.x264cqstep = 0.50;
break;
case 2:
- Properties.Settings.Default.x264cqstep = 0.25;
+ Settings.Default.x264cqstep = 0.25;
break;
case 3:
- Properties.Settings.Default.x264cqstep = 0.20;
+ Settings.Default.x264cqstep = 0.20;
break;
}
mainWindow.setQualityFromSlider();
@@ -446,23 +444,14 @@ namespace Handbrake
private void check_dvdnav_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.noDvdNav = check_dvdnav.Checked;
- }
-
- #endregion
-
- #region Debug
-
- private void check_disableResCalc_CheckedChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.disableResCalc = check_disableResCalc.Checked;
+ Settings.Default.noDvdNav = check_dvdnav.Checked;
}
#endregion
private void btn_close_Click(object sender, EventArgs e)
{
- Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this
+ Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this
UpdateApplicationServicesSettings();
this.Close();
diff --git a/win/C#/frmOptions.resx b/win/C#/frmOptions.resx
index df466a44b..8a1811c83 100644
--- a/win/C#/frmOptions.resx
+++ b/win/C#/frmOptions.resx
@@ -120,19 +120,6 @@
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 18</value>
</metadata>
- <data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">
- <value>Shows the CLI window when encoding.
-You may wish to enable this as you'll be able to cleanly exit the CLI using ctrl-c
-meaing you'll have playable files if you choose to end the encode early.
-
-When disabled, Presseting "Stop" on the main winow will render the encode unplayable.</value>
- </data>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>132, 18</value>
- </metadata>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>132, 18</value>
- </metadata>
<data name="check_m4v.ToolTip" xml:space="preserve">
<value>Use .m4v instead of .mp4 for MP4 files
@@ -140,10 +127,12 @@ Chapter Markers, AC3 Audio and SRT Subtitles will require the m4v extension if y
When this option is disabled, Chapter Markers, AC3 audio and SRT subtitiles will still automatically change the file extension to m4v.
</value>
</data>
- <data name="check_disableResCalc.ToolTip" xml:space="preserve">
- <value>If the new Picture Settings panel is causing you problems, enable this option.
-It disables some of the resolution calcuation code for None and Custom modes.
-When enabled, the values in the text boxes will simply be passed through to the CLI so it is up to you to get the values correct.</value>
+ <data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">
+ <value>Shows the CLI window when encoding.
+You may wish to enable this as you'll be able to cleanly exit the CLI using ctrl-c
+meaing you'll have playable files if you choose to end the encode early.
+
+When disabled, Presseting "Stop" on the main winow will render the encode unplayable.</value>
</data>
<metadata name="pathFinder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs
index 7d52ddef5..85ffde8e6 100644
--- a/win/C#/frmQueue.cs
+++ b/win/C#/frmQueue.cs
@@ -9,7 +9,6 @@ namespace Handbrake
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
- using System.IO;
using System.Windows.Forms;
using Functions;
@@ -425,6 +424,7 @@ namespace Handbrake
}
/* Right Click Menu */
+
/// <summary>
/// Handle the Move Up Menu Item
/// </summary>