diff options
44 files changed, 1332 insertions, 609 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m index 47303dfc9..d9122b587 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -182,9 +182,9 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It */ if (hbInstanceNum > 1) { - alertTitle = [NSString stringWithFormat: - NSLocalizedString(@"There is already an instance of HandBrake running.", @"")]; - NSBeginCriticalAlertSheet( + alertTitle = [NSString stringWithFormat: + NSLocalizedString(@"There is already an instance of HandBrake running.", @"")]; + NSBeginCriticalAlertSheet( alertTitle, NSLocalizedString(@"Reload Queue", nil), nil, @@ -195,48 +195,29 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } else { - if (fWorkingCount > 0 || fPendingCount > 0) + if (fWorkingCount > 0) { - if (fWorkingCount > 0) - { - alertTitle = [NSString stringWithFormat: - NSLocalizedString(@"HandBrake Has Detected %d Previously Encoding Item(s) and %d Pending Item(s) In Your Queue.", @""), - fWorkingCount,fPendingCount]; - } - else - { - alertTitle = [NSString stringWithFormat: - NSLocalizedString(@"HandBrake Has Detected %d Pending Item(s) In Your Queue.", @""), - fPendingCount]; - } - - NSBeginCriticalAlertSheet( - alertTitle, - NSLocalizedString(@"Reload Queue", nil), - nil, - NSLocalizedString(@"Empty Queue", nil), - fWindow, self, - nil, @selector(didDimissReloadQueue:returnCode:contextInfo:), nil, - NSLocalizedString(@" Do you want to reload them ?", nil)); + alertTitle = [NSString stringWithFormat: + NSLocalizedString(@"HandBrake Has Detected %d Previously Encoding Item and %d Pending Item(s) In Your Queue.", @""), + fWorkingCount,fPendingCount]; } else { - /* Since we addressed any pending or previously encoding items above, we go ahead and make sure the queue - * is empty of any finished items or cancelled items */ - [self clearQueueAllItems]; - /* We show whichever open source window specified in LaunchSourceBehavior preference key */ - if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"LaunchSourceBehavior"] isEqualToString: @"Open Source"]) - { - [self browseSources:nil]; - } - - if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"LaunchSourceBehavior"] isEqualToString: @"Open Source (Title Specific)"]) - { - [self browseSources:(id)fOpenSourceTitleMMenu]; - } + alertTitle = [NSString stringWithFormat: + NSLocalizedString(@"HandBrake Has Detected %d Pending Item(s) In Your Queue.", @""), + fPendingCount]; } + NSBeginCriticalAlertSheet( + alertTitle, + NSLocalizedString(@"Reload Queue", nil), + nil, + NSLocalizedString(@"Empty Queue", nil), + fWindow, self, + nil, @selector(didDimissReloadQueue:returnCode:contextInfo:), nil, + NSLocalizedString(@" Do you want to reload them ?", nil)); } + } else { @@ -274,6 +255,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It { if ([[runningAppsDictionary valueForKey:@"NSApplicationName"] isEqualToString:@"HandBrake"]) { + hbInstances++; /*Report the path to each active instances app path */ runningInstancePidNum = [[runningAppsDictionary valueForKey:@"NSApplicationProcessIdentifier"] intValue]; runningInstanceAppPath = [runningAppsDictionary valueForKey:@"NSApplicationPath"]; @@ -290,8 +272,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It /* Tell fQueueController what our pidNum is */ [fQueueController setPidNum:pidNum]; } - hbInstances++; - } + } } return hbInstances; } @@ -300,11 +281,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It - (void) didDimissReloadQueue: (NSWindow *)sheet returnCode: (int)returnCode contextInfo: (void *)contextInfo { - - [self writeToActivityLog: "didDimissReloadQueue number of hb instances:%d", hbInstanceNum]; if (returnCode == NSAlertOtherReturn) { - [self writeToActivityLog: "didDimissReloadQueue NSAlertOtherReturn Chosen"]; [self clearQueueAllItems]; /* We show whichever open source window specified in LaunchSourceBehavior preference key */ @@ -320,10 +298,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } else { - [self writeToActivityLog: "didDimissReloadQueue First Button Chosen"]; - if (hbInstanceNum == 1) + if ([self hbInstances] == 1) { - [self setQueueEncodingItemsAsPending]; } [self showQueueWindow:NULL]; @@ -2105,19 +2081,15 @@ fWorkingCount = 0; /* we look here to see if the preset is we move on to the next one */ while ( tempObject = [enumerator nextObject] ) { - /* We want to keep any queue item that is pending or was previously being encoded */ - if ([[tempObject objectForKey:@"Status"] intValue] == 1 || [[tempObject objectForKey:@"Status"] intValue] == 2) + /* If the queue item is marked as "encoding" (1) + * then change its status back to pending (2) which effectively + * puts it back into the queue to be encoded + */ + if ([[tempObject objectForKey:@"Status"] intValue] == 1) { - /* If the queue item is marked as "encoding" (1) - * then change its status back to pending (2) which effectively - * puts it back into the queue to be encoded - */ - if ([[tempObject objectForKey:@"Status"] intValue] == 1) - { - [tempObject setObject:[NSNumber numberWithInt: 2] forKey:@"Status"]; - } - [tempArray addObject:tempObject]; + [tempObject setObject:[NSNumber numberWithInt: 2] forKey:@"Status"]; } + [tempArray addObject:tempObject]; } [QueueFileArray setArray:tempArray]; diff --git a/win/C#/Controls/Filters.cs b/win/C#/Controls/Filters.cs index 1ee72d6c9..9f75f69d3 100644 --- a/win/C#/Controls/Filters.cs +++ b/win/C#/Controls/Filters.cs @@ -8,12 +8,14 @@ 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>
@@ -27,11 +29,6 @@ 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
@@ -263,12 +260,6 @@ 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";
@@ -277,11 +268,6 @@ 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";
@@ -293,11 +279,6 @@ 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";
@@ -309,11 +290,6 @@ 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";
@@ -323,11 +299,6 @@ 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 534cc0fd5..e0319a690 100644 --- a/win/C#/Controls/PictureSettings.cs +++ b/win/C#/Controls/PictureSettings.cs @@ -7,6 +7,7 @@ namespace Handbrake.Controls {
using System;
using System.Drawing;
+ using System.Globalization;
using System.Windows.Forms;
using HandBrake.ApplicationServices.Parsing;
@@ -18,6 +19,7 @@ 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;
@@ -150,6 +152,9 @@ namespace Handbrake.Controls // Picture Controls
private void TextWidthValueChanged(object sender, EventArgs e)
{
+ if (Properties.Settings.Default.disableResCalc)
+ return;
+
if (preventChangingWidth)
return;
@@ -209,6 +214,9 @@ namespace Handbrake.Controls private void TextHeightValueChanged(object sender, EventArgs e)
{
+ if (Properties.Settings.Default.disableResCalc)
+ return;
+
if (preventChangingHeight)
return;
@@ -269,6 +277,9 @@ 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());
@@ -287,6 +298,9 @@ 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;
@@ -312,7 +326,7 @@ namespace Handbrake.Controls // Update value
preventChangingHeight = true;
- text_height.Value = modulusHeight;
+ text_height.Value = (decimal)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 8baf18eae..e923598e7 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,7 +458,8 @@ 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;
+ subList[lv_subList.SelectedIndices[0]].SrtOffset = (int) srt_offset.Value;
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -478,7 +479,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>
@@ -498,7 +499,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 f63214b23..8d223f6ab 100644 --- a/win/C#/Controls/x264Panel.cs +++ b/win/C#/Controls/x264Panel.cs @@ -8,9 +8,6 @@ namespace Handbrake.Controls using System;
using System.Windows.Forms;
- /// <summary>
- /// The Advanced Panel
- /// </summary>
public partial class x264Panel : UserControl
{
/*
@@ -41,10 +38,7 @@ namespace Handbrake.Controls {
return rtf_x264Query.Text;
}
- set
- {
- rtf_x264Query.Text = value;
- }
+ set { rtf_x264Query.Text = value; }
}
/// <summary>
@@ -1005,7 +999,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 7248ffa78..e6bd64b08 100644 --- a/win/C#/Functions/AppcastReader.cs +++ b/win/C#/Functions/AppcastReader.cs @@ -54,7 +54,9 @@ 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 ace2d6853..148f8f315 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -411,7 +411,6 @@ 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;
@@ -450,7 +449,7 @@ namespace Handbrake.Functions }
/// <summary>
- /// Gets a value indicating whether this this application is running in multi instance mode.
+ /// Checks if this HandBrake is running multiple instances
/// </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 790d51163..649804914 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -26,6 +26,9 @@ 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 c2e785075..a50102688 100644 --- a/win/C#/Functions/Win32.cs +++ b/win/C#/Functions/Win32.cs @@ -47,13 +47,62 @@ 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
@@ -92,7 +141,7 @@ namespace Handbrake.Functions }
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
+ static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[FlagsAttribute]
public enum EXECUTION_STATE : uint
@@ -117,51 +166,5 @@ 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 new file mode 100644 index 000000000..22ca79976 --- /dev/null +++ b/win/C#/HandBrake.5.0.ReSharper @@ -0,0 +1,379 @@ +<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 2efab7d97..aba92dbbe 100644 --- a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs +++ b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs @@ -23,7 +23,6 @@ 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 d06144981..a45d7441a 100644 --- a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs +++ b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs @@ -47,13 +47,62 @@ 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
@@ -92,7 +141,7 @@ namespace HandBrake.ApplicationServices.Functions }
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
+ static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[FlagsAttribute]
public enum EXECUTION_STATE : uint
@@ -117,51 +166,5 @@ 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 e102010be..17effbc64 100644 --- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -75,7 +75,6 @@ <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="ScanProgressEventArgs.cs" />
<Compile Include="EncodeProgressEventArgs.cs" />
<Compile Include="frmExceptionWindow.cs">
<SubType>Form</SubType>
@@ -137,7 +136,7 @@ <EmbeddedResource Include="Resources\copy.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />
+ <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\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 b1321bc4d..e8f2e18af 100644 --- a/win/C#/HandBrake.ApplicationServices/Init.cs +++ b/win/C#/HandBrake.ApplicationServices/Init.cs @@ -14,6 +14,63 @@ 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>
@@ -84,61 +141,5 @@ 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 4eba0b4c1..55cf524a5 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs @@ -61,10 +61,6 @@ 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 258dcff16..0545dd1d5 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs @@ -36,7 +36,8 @@ 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 d9f7e5e69..c7e5a27bb 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 913ab5fa1..f4cd65768 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 deleted file mode 100644 index c6ad9aef0..000000000 --- a/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* 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 deleted file mode 100644 index b7e1ccd4a..000000000 --- a/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* 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 ca3f898df..87b0e0027 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs @@ -15,6 +15,7 @@ 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>
@@ -251,15 +252,14 @@ 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,6 +315,8 @@ namespace HandBrake.ApplicationServices.Services {
IsEncoding = false;
+ // ReadFile(null);
+
if (this.EncodeEnded != null)
this.EncodeEnded(this, new EventArgs());
@@ -342,6 +344,9 @@ namespace HandBrake.ApplicationServices.Services /// <summary>
/// Read the log file
/// </summary>
+ /// <param name="n">
+ /// The object.
+ /// </param>
private void ReadFile()
{
logBuffer = new StringBuilder();
@@ -393,7 +398,6 @@ 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 d82cfbb02..981f3c19e 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs @@ -58,6 +58,16 @@ 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">
@@ -112,7 +122,6 @@ 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 63d3aee64..b02b8b06f 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 ScanService.ScanProgessStatus ScanStatusChanged;
+ event EventHandler ScanStatusChanged;
/// <summary>
/// Gets a value indicating whether IsScanning.
@@ -35,6 +35,11 @@ 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 3bcbcb7e8..59c084f1c 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs @@ -17,6 +17,7 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
@@ -252,7 +253,6 @@ 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 76ecbf2b9..da8d34f7c 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs @@ -61,20 +61,9 @@ 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 ScanProgessStatus ScanStatusChanged;
+ public event EventHandler ScanStatusChanged;
/* Properties */
@@ -84,6 +73,11 @@ 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; }
@@ -192,7 +186,7 @@ namespace HandBrake.ApplicationServices.Services this.hbProc.Start();
this.readData = new Parser(this.hbProc.StandardError.BaseStream);
- this.readData.OnScanProgress += this.OnScanProgress;
+ this.readData.OnScanProgress += new ScanProgressEventHandler(this.OnScanProgress);
this.SouceData = DVD.Parse(this.readData);
// Write the Buffer out to file.
@@ -286,14 +280,9 @@ namespace HandBrake.ApplicationServices.Services /// <param name="titleCount">the total number of titles</param>
private void OnScanProgress(object sender, int currentTitle, int titleCount)
{
- ScanProgressEventArgs scanProgressEventArgs = new ScanProgressEventArgs
- {
- TotalTitles = titleCount,
- CurrentTitle = currentTitle
- };
-
+ this.ScanStatus = string.Format("Processing Title: {0} of {1}", currentTitle, titleCount);
if (this.ScanStatusChanged != null)
- this.ScanStatusChanged(this, scanProgressEventArgs);
+ this.ScanStatusChanged(this, new EventArgs());
}
}
}
\ No newline at end of file diff --git a/win/C#/HandBrake.ApplicationServices/Settings.StyleCop b/win/C#/HandBrake.ApplicationServices/Settings.StyleCop index 1ca772fff..7f55ce6c6 100644 --- a/win/C#/HandBrake.ApplicationServices/Settings.StyleCop +++ b/win/C#/HandBrake.ApplicationServices/Settings.StyleCop @@ -1,14 +1 @@ -<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 +<StyleCopSettings Version="4.3" />
\ No newline at end of file diff --git a/win/C#/HandBrakeCS.5.0.ReSharper b/win/C#/HandBrakeCS.5.0.ReSharper new file mode 100644 index 000000000..59f681991 --- /dev/null +++ b/win/C#/HandBrakeCS.5.0.ReSharper @@ -0,0 +1,388 @@ +<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 203886d13..20cb57342 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.4\Microsoft.StyleCop.targets" />
+ <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />
<PropertyGroup Condition=" '$(Configuration)' == 'Install' ">
<PostBuildEvent>
cd ../../
diff --git a/win/C#/HandBrakeCS.csproj.ReSharper b/win/C#/HandBrakeCS.csproj.ReSharper new file mode 100644 index 000000000..9b0507870 --- /dev/null +++ b/win/C#/HandBrakeCS.csproj.ReSharper @@ -0,0 +1,3 @@ +<Configuration>
+ <Localizable>No</Localizable>
+</Configuration>
\ No newline at end of file diff --git a/win/C#/HandBrakeCS.sln b/win/C#/HandBrakeCS.sln new file mode 100644 index 000000000..bde8c131b --- /dev/null +++ b/win/C#/HandBrakeCS.sln @@ -0,0 +1,38 @@ +
+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 43659b07a..971a47859 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>
- /// Gets or sets the Last preset added
+ /// Last preset added
/// </summary>
public Preset LastPresetAdded { get; set; }
diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 42d9d9b87..1c428c874 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,14 +24,13 @@ 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 += CurrentDomain_UnhandledException;
+ AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
// Attempt to upgrade / keep the users settings between versions
if (Settings.Default.UpdateRequired)
@@ -122,6 +121,9 @@ namespace Handbrake }
}
- public static int InstanceId;
+
+ public static int InstanceId = 0;
+
+
}
}
\ No newline at end of file diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index 585e2f550..b2f489294 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:2.0.50727.4927
+// Runtime Version:4.0.30319.1
//
// 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", "9.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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,6 +397,18 @@ 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 af1a7f563..c7e001d5e 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -95,6 +95,9 @@ <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 73638a716..139f00afe 100644 --- a/win/C#/Settings.StyleCop +++ b/win/C#/Settings.StyleCop @@ -59,11 +59,6 @@ <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>
@@ -77,16 +72,6 @@ <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>
@@ -172,11 +157,6 @@ <BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="CommentsMustContainText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -187,21 +167,6 @@ <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>
@@ -212,16 +177,6 @@ <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 c1ee5fefa..a51c09d8c 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -101,6 +101,9 @@ <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 ffc02fa8f..62799e926 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 ecb952911..22ba835d7 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">The Main Window</param>
+ /// <param name="mainWindow"></param>
/// <param name="presetHandler">
/// The preset handler.
/// </param>
@@ -69,7 +69,6 @@ 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 f3ae682c1..a3067e17d 100644 --- a/win/C#/frmDownload.cs +++ b/win/C#/frmDownload.cs @@ -12,18 +12,15 @@ 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);
@@ -35,14 +32,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
@@ -50,29 +47,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));
@@ -88,8 +85,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 ";
}
@@ -111,11 +108,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 71ccef43b..83135c6c0 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -26,9 +26,6 @@ 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 *************
@@ -918,6 +915,7 @@ namespace Handbrake if (treeView_presets.SelectedNode != null)
{
+
if (savefiledialog.ShowDialog() == DialogResult.OK)
{
Preset preset = presetHandler.GetPreset(treeView_presets.SelectedNode.Text);
@@ -1128,6 +1126,7 @@ namespace Handbrake lbl_encode.Text = encodeQueue.Count + " encode(s) pending in the queue";
queueWindow.Show();
+
}
/// <summary>
@@ -1289,6 +1288,7 @@ 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 (!Settings.Default.noDvdNav)
+ if (!Properties.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 (Settings.Default.autoNaming)
+ if (Properties.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;
+ int i = data_chpt.Rows.Count, finish = 0;
int.TryParse(drop_chapterFinish.Text, out finish);
while (i < finish)
@@ -1466,7 +1466,7 @@ namespace Handbrake .ToString();
// Run the Autonaming function
- if (Settings.Default.autoNaming)
+ if (Properties.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 -= this.SecondsOrFramesChanged;
- this.drop_chapterStart.TextChanged -= this.SecondsOrFramesChanged;
+ this.drop_chapterFinish.TextChanged -= new EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterStart.TextChanged -= new EventHandler(this.SecondsOrFramesChanged);
// Do Work
switch (drop_mode.SelectedIndex)
@@ -1533,8 +1533,8 @@ namespace Handbrake lbl_duration.Text = "--:--:--";
return;
case 1:
- this.drop_chapterStart.TextChanged += this.SecondsOrFramesChanged;
- this.drop_chapterFinish.TextChanged += this.SecondsOrFramesChanged;
+ this.drop_chapterStart.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterFinish.TextChanged += new EventHandler(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 += this.SecondsOrFramesChanged;
- this.drop_chapterFinish.TextChanged += this.SecondsOrFramesChanged;
+ this.drop_chapterStart.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterFinish.TextChanged += new EventHandler(this.SecondsOrFramesChanged);
drop_chapterStart.DropDownStyle = ComboBoxStyle.Simple;
drop_chapterFinish.DropDownStyle = ComboBoxStyle.Simple;
if (selectedTitle != null)
@@ -1573,17 +1573,23 @@ namespace Handbrake else if (drop_format.SelectedIndex.Equals(1))
DVD_Save.FilterIndex = 2;
- if (DVD_Save.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(DVD_Save.FileName))
+ if (DVD_Save.ShowDialog() == DialogResult.OK)
{
// 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))
- DVD_Save.FileName = Settings.Default.useM4v ? DVD_Save.FileName.Replace(".mp4", ".m4v").Replace(".mkv", ".m4v") : DVD_Save.FileName.Replace(".m4v", ".mp4").Replace(".mkv", ".mp4");
+ 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");
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:
@@ -1613,7 +1619,7 @@ namespace Handbrake switch (drop_format.SelectedIndex)
{
case 0:
- if (Settings.Default.useM4v || Check_ChapterMarkers.Checked ||
+ if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked ||
AudioSettings.RequiresM4V() || Subtitles.RequiresM4V())
SetExtension(".m4v");
else
@@ -1641,7 +1647,7 @@ namespace Handbrake public void SetExtension(string newExtension)
{
if (newExtension == ".mp4" || newExtension == ".m4v")
- if (Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() ||
+ if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() ||
Subtitles.RequiresM4V())
newExtension = ".m4v";
else
@@ -1691,11 +1697,12 @@ namespace Handbrake slider_videoQuality.Minimum = 0;
slider_videoQuality.TickFrequency = 1;
- double cqStep = Settings.Default.x264cqstep;
+ CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
+ double cqStep = Properties.Settings.Default.x264cqstep;
double multiplier = 1.0 / cqStep;
double value = slider_videoQuality.Value * multiplier;
- slider_videoQuality.Maximum = (int)(51 / Settings.Default.x264cqstep);
+ slider_videoQuality.Maximum = (int)(51 / Properties.Settings.Default.x264cqstep);
if (value < slider_videoQuality.Maximum)
slider_videoQuality.Value = slider_videoQuality.Maximum - (int)value;
@@ -1754,7 +1761,7 @@ namespace Handbrake }
}
- private double cachedCqStep = Settings.Default.x264cqstep;
+ private double _cachedCqStep = Properties.Settings.Default.x264cqstep;
/// <summary>
/// Update the CQ slider for x264 for a new CQ step. This is set from option
@@ -1762,17 +1769,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 / Settings.Default.x264cqstep);
+ slider_videoQuality.Maximum = (int)(51 / Properties.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 = Settings.Default.x264cqstep;
+ double cqStepNew = Properties.Settings.Default.x264cqstep;
double rfValueCurrent = 51.0 - slider_videoQuality.Value * cqStepNew;
while (rfValueCurrent < rfValue)
{
@@ -1781,12 +1788,12 @@ namespace Handbrake }
// Cache the CQ step for the next calculation
- cachedCqStep = Settings.Default.x264cqstep;
+ _cachedCqStep = Properties.Settings.Default.x264cqstep;
}
private void slider_videoQuality_Scroll(object sender, EventArgs e)
{
- double cqStep = Settings.Default.x264cqstep;
+ double cqStep = Properties.Settings.Default.x264cqstep;
switch (drp_videoEncoder.Text)
{
case "MPEG-4 (FFmpeg)":
@@ -1857,7 +1864,7 @@ namespace Handbrake }
else
{
- if (drop_format.SelectedIndex != 1 && !Settings.Default.useM4v)
+ if (drop_format.SelectedIndex != 1 && !Properties.Settings.Default.useM4v)
SetExtension(".mp4");
data_chpt.Enabled = false;
btn_importChapters.Enabled = false;
@@ -1877,7 +1884,9 @@ namespace Handbrake private void btn_export_Click(object sender, EventArgs e)
{
- SaveFileDialog saveFileDialog = new SaveFileDialog { Filter = "Csv File|*.csv", DefaultExt = "csv" };
+ SaveFileDialog saveFileDialog = new SaveFileDialog();
+ saveFileDialog.Filter = "Csv File|*.csv";
+ saveFileDialog.DefaultExt = "csv";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
string filename = saveFileDialog.FileName;
@@ -1933,8 +1942,8 @@ namespace Handbrake try
{
SourceScan.Scan(sourcePath, title);
- SourceScan.ScanStatusChanged += SourceScan_ScanStatusChanged;
- SourceScan.ScanCompleted += SourceScan_ScanCompleted;
+ SourceScan.ScanStatusChanged += new EventHandler(SourceScan_ScanStatusChanged);
+ SourceScan.ScanCompleted += new EventHandler(SourceScan_ScanCompleted);
}
catch (Exception exc)
{
@@ -1951,9 +1960,9 @@ namespace Handbrake /// <param name="e">
/// The e.
/// </param>
- private void SourceScan_ScanStatusChanged(object sender, HandBrake.ApplicationServices.ScanProgressEventArgs e)
+ private void SourceScan_ScanStatusChanged(object sender, EventArgs e)
{
- UpdateScanStatusLabel(sender, e);
+ UpdateScanStatusLabel();
}
/// <summary>
@@ -1973,17 +1982,14 @@ namespace Handbrake /// <summary>
/// Update the Scan Status Label
/// </summary>
- /// <param name="sender"> The Sender </param>
- /// <param name="e">Scan Progress Event Args</param>
- private void UpdateScanStatusLabel(object sender, HandBrake.ApplicationServices.ScanProgressEventArgs e)
+ private void UpdateScanStatusLabel()
{
if (InvokeRequired)
{
- BeginInvoke(new ScanService.ScanProgessStatus(UpdateScanStatusLabel), new[] { e });
+ BeginInvoke(new UpdateWindowHandler(UpdateScanStatusLabel));
return;
}
-
- lbl_encode.Text = "Scanning Title" + e.CurrentTitle + " of " + e.TotalTitles;
+ lbl_encode.Text = SourceScan.ScanStatus;
}
/// <summary>
@@ -2104,7 +2110,7 @@ namespace Handbrake /// </summary>
private void KillScan()
{
- SourceScan.ScanCompleted -= SourceScan_ScanCompleted;
+ SourceScan.ScanCompleted -= new EventHandler(SourceScan_ScanCompleted);
EnableGUI();
ResetGUI();
@@ -2194,10 +2200,10 @@ namespace Handbrake ProgressBarStatus.Visible = false;
btn_start.Text = "Start";
btn_start.ToolTipText = "Start the encoding process";
- btn_start.Image = Resources.Play;
+ btn_start.Image = Properties.Resources.Play;
// If the window is minimized, display the notification in a popup.
- if (Settings.Default.trayIconAlerts)
+ if (Properties.Settings.Default.trayIconAlerts)
if (FormWindowState.Minimized == this.WindowState)
{
notifyIcon.BalloonTipText = lbl_encode.Text;
@@ -2228,7 +2234,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 = Resources.stop;
+ btn_start.Image = Properties.Resources.stop;
}
catch (Exception exc)
{
@@ -2289,7 +2295,7 @@ namespace Handbrake Text = drive.RootDirectory + " (" + drive.VolumeLabel + ")",
Image = Resources.disc_small
};
- menuItem.Click += mnu_dvd_drive_Click;
+ menuItem.Click += new EventHandler(mnu_dvd_drive_Click);
menuItems.Add(menuItem);
}
@@ -2430,7 +2436,7 @@ namespace Handbrake if (SourceScan.IsScanning)
{
- SourceScan.ScanCompleted -= SourceScan_ScanCompleted;
+ SourceScan.ScanCompleted -= new EventHandler(SourceScan_ScanCompleted);
SourceScan.Stop();
}
}
diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs index f7aa39631..2541defc3 100644 --- a/win/C#/frmOptions.Designer.cs +++ b/win/C#/frmOptions.Designer.cs @@ -100,6 +100,8 @@ 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();
@@ -141,6 +143,7 @@ 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();
@@ -188,6 +191,7 @@ 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";
@@ -1045,6 +1049,29 @@ 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;
@@ -1457,6 +1484,8 @@ 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();
@@ -1556,6 +1585,8 @@ 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 607c8ff0c..4475d9071 100644 --- a/win/C#/frmOptions.cs +++ b/win/C#/frmOptions.cs @@ -14,11 +14,8 @@ namespace Handbrake using HandBrake.ApplicationServices;
- using Properties;
+ using Handbrake.Properties;
- /// <summary>
- /// The Options Screen
- /// </summary>
public partial class frmOptions : Form
{
private frmMain mainWindow;
@@ -37,18 +34,18 @@ namespace Handbrake // #############################
// Enable Tooltips.
- if (Settings.Default.tooltipEnable)
+ if (Properties.Settings.Default.tooltipEnable)
{
check_tooltip.CheckState = CheckState.Checked;
ToolTip.Active = true;
}
// Update Check
- if (Settings.Default.updateStatus)
+ if (Properties.Settings.Default.updateStatus)
check_updateCheck.CheckState = CheckState.Checked;
// Days between update checks
- switch (Settings.Default.daysBetweenUpdateCheck)
+ switch (Properties.Settings.Default.daysBetweenUpdateCheck)
{
case 1:
drop_updateCheckDays.SelectedIndex = 0;
@@ -62,51 +59,51 @@ namespace Handbrake }
// On Encode Completeion Action
- drp_completeOption.Text = Settings.Default.CompletionOption;
+ drp_completeOption.Text = Properties.Settings.Default.CompletionOption;
// Growl.
- if (Settings.Default.growlEncode)
+ if (Properties.Settings.Default.growlEncode)
check_growlEncode.CheckState = CheckState.Checked;
- if (Settings.Default.growlQueue)
+ if (Properties.Settings.Default.growlQueue)
check_GrowlQueue.CheckState = CheckState.Checked;
// Enable auto naming feature.
- if (Settings.Default.autoNaming)
+ if (Properties.Settings.Default.autoNaming)
check_autoNaming.CheckState = CheckState.Checked;
// Store the auto name path
- text_an_path.Text = Settings.Default.autoNamePath;
+ text_an_path.Text = Properties.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 = Settings.Default.autoNameFormat;
+ txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat;
// Use iPod/iTunes friendly .m4v extension for MP4 files.
- if (Settings.Default.useM4v)
+ if (Properties.Settings.Default.useM4v)
check_m4v.CheckState = CheckState.Checked;
// Remove Underscores
- check_removeUnderscores.Checked = Settings.Default.AutoNameRemoveUnderscore;
+ check_removeUnderscores.Checked = Properties.Settings.Default.AutoNameRemoveUnderscore;
// Title case
- check_TitleCase.Checked = Settings.Default.AutoNameTitleCase;
+ check_TitleCase.Checked = Properties.Settings.Default.AutoNameTitleCase;
// #############################
// Picture Tab
// #############################
// VLC Path
- txt_vlcPath.Text = Settings.Default.VLC_Path;
+ txt_vlcPath.Text = Properties.Settings.Default.VLC_Path;
// #############################
// Audio and Subtitles Tab
// #############################
- drop_preferredLang.SelectedItem = Settings.Default.NativeLanguage;
+ drop_preferredLang.SelectedItem = Properties.Settings.Default.NativeLanguage;
- if (Settings.Default.DubAudio)
+ if (Properties.Settings.Default.DubAudio)
radio_dub.Checked = true;
else
radio_foreignAndSubs.Checked = true;
@@ -116,58 +113,58 @@ namespace Handbrake // #############################
// Priority level for encodes
- drp_Priority.Text = Settings.Default.processPriority;
+ drp_Priority.Text = Properties.Settings.Default.processPriority;
- check_preventSleep.Checked = Settings.Default.preventSleep;
+ check_preventSleep.Checked = Properties.Settings.Default.preventSleep;
// Log Verbosity Level
- cb_logVerboseLvl.SelectedIndex = Settings.Default.verboseLevel;
+ cb_logVerboseLvl.SelectedIndex = Properties.Settings.Default.verboseLevel;
// Save logs in the same directory as encoded files
- if (Settings.Default.saveLogWithVideo)
+ if (Properties.Settings.Default.saveLogWithVideo)
check_saveLogWithVideo.CheckState = CheckState.Checked;
// Save Logs in a specified path
- if (Settings.Default.saveLogToSpecifiedPath)
+ if (Properties.Settings.Default.saveLogToSpecifiedPath)
check_logsInSpecifiedLocation.CheckState = CheckState.Checked;
// The saved log path
- text_logPath.Text = Settings.Default.saveLogPath;
+ text_logPath.Text = Properties.Settings.Default.saveLogPath;
- check_clearOldLogs.Checked = Settings.Default.clearOldLogs;
+ check_clearOldLogs.Checked = Properties.Settings.Default.clearOldLogs;
// #############################
// Advanced
// #############################
// Minimise to Tray
- if (Settings.Default.trayIconAlerts)
+ if (Properties.Settings.Default.trayIconAlerts)
check_trayStatusAlerts.CheckState = CheckState.Checked;
// Tray Balloon popups
- if (Settings.Default.MainWindowMinimize)
+ if (Properties.Settings.Default.MainWindowMinimize)
check_mainMinimize.CheckState = CheckState.Checked;
// Enable / Disable Query editor tab
- if (Settings.Default.QueryEditorTab)
+ if (Properties.Settings.Default.QueryEditorTab)
check_queryEditorTab.CheckState = CheckState.Checked;
check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;
// Prompt on inconsistant queries
- check_promptOnUnmatchingQueries.Checked = Settings.Default.PromptOnUnmatchingQueries;
+ check_promptOnUnmatchingQueries.Checked = Properties.Settings.Default.PromptOnUnmatchingQueries;
// Preset update notification
- if (Settings.Default.presetNotification)
+ if (Properties.Settings.Default.presetNotification)
check_disablePresetNotification.CheckState = CheckState.Checked;
// Show CLI Window
- check_showCliForInGUIEncode.Checked = Settings.Default.showCliForInGuiEncodeStatus;
+ check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;
// Set the preview count
- drop_previewScanCount.SelectedItem = Settings.Default.previewScanCount.ToString();
+ drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();
// x264 step
- string step = Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"));
+ string step = Properties.Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"));
switch (step)
{
case "1":
@@ -185,15 +182,21 @@ namespace Handbrake }
// Use Experimental dvdnav
- if (Settings.Default.noDvdNav)
+ if (Properties.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)
{
- Settings.Default.updateStatus = check_updateCheck.Checked;
+ Properties.Settings.Default.updateStatus = check_updateCheck.Checked;
}
private void drop_updateCheckDays_SelectedIndexChanged(object sender, EventArgs e)
@@ -201,45 +204,45 @@ namespace Handbrake switch (drop_updateCheckDays.SelectedIndex)
{
case 0:
- Settings.Default.daysBetweenUpdateCheck = 1;
+ Properties.Settings.Default.daysBetweenUpdateCheck = 1;
break;
case 1:
- Settings.Default.daysBetweenUpdateCheck = 7;
+ Properties.Settings.Default.daysBetweenUpdateCheck = 7;
break;
case 2:
- Settings.Default.daysBetweenUpdateCheck = 30;
+ Properties.Settings.Default.daysBetweenUpdateCheck = 30;
break;
}
}
private void check_tooltip_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.tooltipEnable = check_tooltip.Checked;
+ Properties.Settings.Default.tooltipEnable = check_tooltip.Checked;
}
private void drp_completeOption_SelectedIndexChanged(object sender, EventArgs e)
{
- Settings.Default.CompletionOption = drp_completeOption.Text;
+ Properties.Settings.Default.CompletionOption = drp_completeOption.Text;
}
private void check_GrowlQueue_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.growlQueue = check_GrowlQueue.Checked;
+ Properties.Settings.Default.growlQueue = check_GrowlQueue.Checked;
}
private void check_growlEncode_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.growlEncode = check_growlEncode.Checked;
+ Properties.Settings.Default.growlEncode = check_growlEncode.Checked;
}
private void check_autoNaming_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.autoNaming = check_autoNaming.Checked;
+ Properties.Settings.Default.autoNaming = check_autoNaming.Checked;
}
private void txt_autoNameFormat_TextChanged(object sender, EventArgs e)
{
- Settings.Default.autoNameFormat = txt_autoNameFormat.Text;
+ Properties.Settings.Default.autoNameFormat = txt_autoNameFormat.Text;
}
private void btn_browse_Click(object sender, EventArgs e)
@@ -252,26 +255,26 @@ namespace Handbrake {
if (text_an_path.Text == string.Empty)
{
- Settings.Default.autoNamePath = string.Empty;
+ Properties.Settings.Default.autoNamePath = string.Empty;
text_an_path.Text = "Click 'Browse' to set the default location";
}
else
- Settings.Default.autoNamePath = text_an_path.Text;
+ Properties.Settings.Default.autoNamePath = text_an_path.Text;
}
private void check_m4v_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.useM4v = check_m4v.Checked;
+ Properties.Settings.Default.useM4v = check_m4v.Checked;
}
private void check_removeUnderscores_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.AutoNameRemoveUnderscore = check_removeUnderscores.Checked;
+ Properties.Settings.Default.AutoNameRemoveUnderscore = check_removeUnderscores.Checked;
}
private void check_TitleCase_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.AutoNameTitleCase = check_TitleCase.Checked;
+ Properties.Settings.Default.AutoNameTitleCase = check_TitleCase.Checked;
}
#endregion
@@ -287,7 +290,7 @@ namespace Handbrake private void txt_vlcPath_TextChanged(object sender, EventArgs e)
{
- Settings.Default.VLC_Path = txt_vlcPath.Text;
+ Properties.Settings.Default.VLC_Path = txt_vlcPath.Text;
}
#endregion
@@ -296,19 +299,19 @@ namespace Handbrake private void drop_preferredLang_SelectedIndexChanged(object sender, EventArgs e)
{
- Settings.Default.NativeLanguage = drop_preferredLang.SelectedItem.ToString();
+ Properties.Settings.Default.NativeLanguage = drop_preferredLang.SelectedItem.ToString();
}
private void radio_dub_CheckedChanged(object sender, EventArgs e)
{
if (radio_dub.Checked)
- Settings.Default.DubAudio = true;
+ Properties.Settings.Default.DubAudio = true;
}
private void radio_foreignAndSubs_CheckedChanged(object sender, EventArgs e)
{
if (radio_foreignAndSubs.Checked)
- Settings.Default.DubAudio = false;
+ Properties.Settings.Default.DubAudio = false;
}
#endregion
@@ -317,27 +320,27 @@ namespace Handbrake private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)
{
- Settings.Default.processPriority = drp_Priority.Text;
+ Properties.Settings.Default.processPriority = drp_Priority.Text;
}
private void check_preventSleep_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.preventSleep = check_preventSleep.Checked;
+ Properties.Settings.Default.preventSleep = check_preventSleep.Checked;
}
private void cb_logVerboseLvl_SelectedIndexChanged(object sender, EventArgs e)
{
- Settings.Default.verboseLevel = cb_logVerboseLvl.SelectedIndex;
+ Properties.Settings.Default.verboseLevel = cb_logVerboseLvl.SelectedIndex;
}
private void check_saveLogWithVideo_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.saveLogWithVideo = check_saveLogWithVideo.Checked;
+ Properties.Settings.Default.saveLogWithVideo = check_saveLogWithVideo.Checked;
}
private void check_logsInSpecifiedLocation_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.saveLogToSpecifiedPath = check_logsInSpecifiedLocation.Checked;
+ Properties.Settings.Default.saveLogToSpecifiedPath = check_logsInSpecifiedLocation.Checked;
}
private void btn_saveLog_Click(object sender, EventArgs e)
@@ -350,17 +353,16 @@ namespace Handbrake private void text_logPath_TextChanged(object sender, EventArgs e)
{
- Settings.Default.saveLogPath = text_logPath.Text;
+ Properties.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
- {
- StartInfo = {FileName = windir + @"\explorer.exe", Arguments = logDir}
- };
+ Process prc = new Process();
+ prc.StartInfo.FileName = windir + @"\explorer.exe";
+ prc.StartInfo.Arguments = logDir;
prc.Start();
}
@@ -378,7 +380,7 @@ namespace Handbrake private void check_clearOldLogs_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.clearOldLogs = check_clearOldLogs.Checked;
+ Properties.Settings.Default.clearOldLogs = check_clearOldLogs.Checked;
}
#endregion
@@ -387,39 +389,39 @@ namespace Handbrake private void check_mainMinimize_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.MainWindowMinimize = check_mainMinimize.Checked;
+ Properties.Settings.Default.MainWindowMinimize = check_mainMinimize.Checked;
check_trayStatusAlerts.Enabled = check_mainMinimize.Checked;
}
private void check_trayStatusAlerts_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.trayIconAlerts = check_trayStatusAlerts.Checked;
+ Properties.Settings.Default.trayIconAlerts = check_trayStatusAlerts.Checked;
}
private void check_queryEditorTab_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.QueryEditorTab = check_queryEditorTab.Checked;
+ Properties.Settings.Default.QueryEditorTab = check_queryEditorTab.Checked;
check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;
}
private void check_promptOnUnmatchingQueries_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.PromptOnUnmatchingQueries = check_promptOnUnmatchingQueries.Checked;
+ Properties.Settings.Default.PromptOnUnmatchingQueries = check_promptOnUnmatchingQueries.Checked;
}
private void check_disablePresetNotification_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.presetNotification = check_disablePresetNotification.Checked;
+ Properties.Settings.Default.presetNotification = check_disablePresetNotification.Checked;
}
private void check_showCliForInGUIEncode_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;
+ Properties.Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;
}
private void drop_previewScanCount_SelectedIndexChanged(object sender, EventArgs e)
{
- Settings.Default.previewScanCount = int.Parse(drop_previewScanCount.SelectedItem.ToString());
+ Properties.Settings.Default.previewScanCount = int.Parse(drop_previewScanCount.SelectedItem.ToString());
}
private void x264step_SelectedIndexChanged(object sender, EventArgs e)
@@ -427,16 +429,16 @@ namespace Handbrake switch (drop_x264step.SelectedIndex)
{
case 0:
- Settings.Default.x264cqstep = 1.0;
+ Properties.Settings.Default.x264cqstep = 1.0;
break;
case 1:
- Settings.Default.x264cqstep = 0.50;
+ Properties.Settings.Default.x264cqstep = 0.50;
break;
case 2:
- Settings.Default.x264cqstep = 0.25;
+ Properties.Settings.Default.x264cqstep = 0.25;
break;
case 3:
- Settings.Default.x264cqstep = 0.20;
+ Properties.Settings.Default.x264cqstep = 0.20;
break;
}
mainWindow.setQualityFromSlider();
@@ -444,14 +446,23 @@ namespace Handbrake private void check_dvdnav_CheckedChanged(object sender, EventArgs e)
{
- Settings.Default.noDvdNav = check_dvdnav.Checked;
+ 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;
}
#endregion
private void btn_close_Click(object sender, EventArgs e)
{
- Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this
+ Properties.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 8a1811c83..df466a44b 100644 --- a/win/C#/frmOptions.resx +++ b/win/C#/frmOptions.resx @@ -120,6 +120,19 @@ <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
@@ -127,12 +140,10 @@ 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_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 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>
<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 85ffde8e6..7d52ddef5 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -9,6 +9,7 @@ namespace Handbrake using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
+ using System.IO;
using System.Windows.Forms;
using Functions;
@@ -424,7 +425,6 @@ namespace Handbrake }
/* Right Click Menu */
-
/// <summary>
/// Handle the Move Up Menu Item
/// </summary>
|