summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrake.ApplicationServices
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-07-22 10:44:54 +0000
committersr55 <[email protected]>2010-07-22 10:44:54 +0000
commit994b648e3ea1d42951221b9cdb0d2b5f4310b652 (patch)
tree95a33f1f00dd832944f558ca4bdb1f71198bf3d7 /win/C#/HandBrake.ApplicationServices
parent8fc8e81a0856e8b859e675bf1df055f2d4bfbdac (diff)
WinGui:
- Removed old settings debug tab, Code refactoring and some tweaks to stylecop so it's less noisy. Upgraded to Stylecop 4.4.0 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3452 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices')
-rw-r--r--win/C#/HandBrake.ApplicationServices/Functions/Logging.cs1
-rw-r--r--win/C#/HandBrake.ApplicationServices/Functions/Win32.cs99
-rw-r--r--win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj3
-rw-r--r--win/C#/HandBrake.ApplicationServices/Init.cs113
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs4
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs3
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs2
-rw-r--r--win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs2
-rw-r--r--win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs42
-rw-r--r--win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs25
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Encode.cs12
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs11
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs7
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Queue.cs2
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Scan.cs29
-rw-r--r--win/C#/HandBrake.ApplicationServices/Settings.StyleCop15
16 files changed, 222 insertions, 148 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs
index aba92dbbe..2efab7d97 100644
--- a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs
+++ b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs
@@ -23,6 +23,7 @@ namespace HandBrake.ApplicationServices.Functions
/// <param name="encJob">
/// The Encode Job Object
/// </param>
+ /// <returns>String with the log header</returns>
public static string CreateCliLogHeader(Job encJob)
{
StringBuilder logHeader = new StringBuilder();
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
index a45d7441a..d06144981 100644
--- a/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
+++ b/win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
@@ -47,62 +47,13 @@ namespace HandBrake.ApplicationServices.Functions
public static extern int ExitWindowsEx(int uFlags, int dwReason);
/// <summary>
- /// System Memory Status
- /// </summary>
- public struct MEMORYSTATUS // Unused var's are required here.
- {
- /// <summary>
- /// Unknown
- /// </summary>
- public UInt32 dwLength;
-
- /// <summary>
- /// Memory Load
- /// </summary>
- public UInt32 dwMemoryLoad;
-
- /// <summary>
- /// Total Physical Memory
- /// </summary>
- public UInt32 dwTotalPhys; // Used
-
- /// <summary>
- /// Available Physical Memory
- /// </summary>
- public UInt32 dwAvailPhys;
-
- /// <summary>
- /// Total Page File
- /// </summary>
- public UInt32 dwTotalPageFile;
-
- /// <summary>
- /// Available Page File
- /// </summary>
- public UInt32 dwAvailPageFile;
-
- /// <summary>
- /// Total Virtual Memory
- /// </summary>
- public UInt32 dwTotalVirtual;
-
- /// <summary>
- /// Available Virtual Memory
- /// </summary>
- public UInt32 dwAvailVirtual;
- }
-
- /// <summary>
/// Global Memory Status
/// </summary>
/// <param name="lpBuffer">
/// The lp buffer.
/// </param>
[DllImport("kernel32.dll")]
- public static extern void GlobalMemoryStatus
- (
- ref MEMORYSTATUS lpBuffer
- );
+ public static extern void GlobalMemoryStatus(ref MEMORYSTATUS lpBuffer);
/// <summary>
/// Generate a Console Ctrl Event
@@ -141,7 +92,7 @@ namespace HandBrake.ApplicationServices.Functions
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
+ public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[FlagsAttribute]
public enum EXECUTION_STATE : uint
@@ -166,5 +117,51 @@ namespace HandBrake.ApplicationServices.Functions
{
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);
}
+
+ /// <summary>
+ /// System Memory Status
+ /// </summary>
+ public struct MEMORYSTATUS // Unused var's are required here.
+ {
+ /// <summary>
+ /// Unknown
+ /// </summary>
+ public UInt32 dwLength;
+
+ /// <summary>
+ /// Memory Load
+ /// </summary>
+ public UInt32 dwMemoryLoad;
+
+ /// <summary>
+ /// Total Physical Memory
+ /// </summary>
+ public UInt32 dwTotalPhys; // Used
+
+ /// <summary>
+ /// Available Physical Memory
+ /// </summary>
+ public UInt32 dwAvailPhys;
+
+ /// <summary>
+ /// Total Page File
+ /// </summary>
+ public UInt32 dwTotalPageFile;
+
+ /// <summary>
+ /// Available Page File
+ /// </summary>
+ public UInt32 dwAvailPageFile;
+
+ /// <summary>
+ /// Total Virtual Memory
+ /// </summary>
+ public UInt32 dwTotalVirtual;
+
+ /// <summary>
+ /// Available Virtual Memory
+ /// </summary>
+ public UInt32 dwAvailVirtual;
+ }
}
}
diff --git a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
index 17effbc64..e102010be 100644
--- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
+++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
@@ -75,6 +75,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="ScanProgressEventArgs.cs" />
<Compile Include="EncodeProgressEventArgs.cs" />
<Compile Include="frmExceptionWindow.cs">
<SubType>Form</SubType>
@@ -136,7 +137,7 @@
<EmbeddedResource Include="Resources\copy.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />
+ <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/win/C#/HandBrake.ApplicationServices/Init.cs b/win/C#/HandBrake.ApplicationServices/Init.cs
index e8f2e18af..b1321bc4d 100644
--- a/win/C#/HandBrake.ApplicationServices/Init.cs
+++ b/win/C#/HandBrake.ApplicationServices/Init.cs
@@ -14,63 +14,6 @@ namespace HandBrake.ApplicationServices
public class Init
{
/// <summary>
- /// Setup the Settings used by the applicaiton with this library
- /// </summary>
- /// <param name="versionString">
- /// The version / name of the application that's using this DLL.
- /// </param>
- /// <param name="instanceId">
- /// The Instance ID
- /// </param>
- /// <param name="completionOption">
- /// The completion option.
- /// </param>
- /// <param name="disableDvdNav">
- /// The disable dvd nav.
- /// </param>
- /// <param name="growlEncode">
- /// The growl encode.
- /// </param>
- /// <param name="growlQueue">
- /// The growl queue.
- /// </param>
- /// <param name="processPriority">
- /// The process priority.
- /// </param>
- /// <param name="saveLogPath">
- /// The save log path.
- /// </param>
- /// <param name="saveLogToSpecifiedPath">
- /// The save log to specified path.
- /// </param>
- /// <param name="saveLogWithVideo">
- /// The save log with video.
- /// </param>
- /// <param name="showCliForInGuiEncodeStatus">
- /// The show cli for in gui encode status.
- /// </param>
- /// <param name="preventSleep">
- /// Prevent the system from sleeping
- /// </param>
- public static void SetupSettings(string versionString, int instanceId, string completionOption, bool disableDvdNav,
- bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,
- bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)
- {
- InstanceId = instanceId;
- HandBrakeGuiVersionString = versionString;
- CompletionOption = completionOption;
- DisableDvdNav = disableDvdNav;
- GrowlEncode = growlEncode;
- GrowlQueue = growlQueue;
- ProcessPriority = processPriority;
- SaveLogPath = saveLogPath;
- SaveLogToSpecifiedPath = saveLogToSpecifiedPath;
- SaveLogWithVideo = saveLogWithVideo;
- ShowCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
- PreventSleep = preventSleep;
- }
-
- /// <summary>
/// Gets the Assembly version.
/// </summary>
/// <returns>
@@ -141,5 +84,61 @@ namespace HandBrake.ApplicationServices
/// </summary>
public static bool PreventSleep;
+ /// <summary>
+ /// Setup the Settings used by the applicaiton with this library
+ /// </summary>
+ /// <param name="versionString">
+ /// The version / name of the application that's using this DLL.
+ /// </param>
+ /// <param name="instanceId">
+ /// The Instance ID
+ /// </param>
+ /// <param name="completionOption">
+ /// The completion option.
+ /// </param>
+ /// <param name="disableDvdNav">
+ /// The disable dvd nav.
+ /// </param>
+ /// <param name="growlEncode">
+ /// The growl encode.
+ /// </param>
+ /// <param name="growlQueue">
+ /// The growl queue.
+ /// </param>
+ /// <param name="processPriority">
+ /// The process priority.
+ /// </param>
+ /// <param name="saveLogPath">
+ /// The save log path.
+ /// </param>
+ /// <param name="saveLogToSpecifiedPath">
+ /// The save log to specified path.
+ /// </param>
+ /// <param name="saveLogWithVideo">
+ /// The save log with video.
+ /// </param>
+ /// <param name="showCliForInGuiEncodeStatus">
+ /// The show cli for in gui encode status.
+ /// </param>
+ /// <param name="preventSleep">
+ /// Prevent the system from sleeping
+ /// </param>
+ public static void SetupSettings(string versionString, int instanceId, string completionOption, bool disableDvdNav,
+ bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,
+ bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)
+ {
+ InstanceId = instanceId;
+ HandBrakeGuiVersionString = versionString;
+ CompletionOption = completionOption;
+ DisableDvdNav = disableDvdNav;
+ GrowlEncode = growlEncode;
+ GrowlQueue = growlQueue;
+ ProcessPriority = processPriority;
+ SaveLogPath = saveLogPath;
+ SaveLogToSpecifiedPath = saveLogToSpecifiedPath;
+ SaveLogWithVideo = saveLogWithVideo;
+ ShowCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
+ PreventSleep = preventSleep;
+ }
}
}
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs
index 55cf524a5..4eba0b4c1 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs
@@ -61,6 +61,10 @@ namespace HandBrake.ApplicationServices.Parsing
public static AudioTrack Parse(StringReader output)
{
string audioTrack = output.ReadLine();
+
+ if (audioTrack == null)
+ return null;
+
Match m = Regex.Match(audioTrack, @"^ \+ ([0-9]*), ([A-Za-z0-9,\s]*) \((.*)\) \((.*)\)");
Match track = Regex.Match(audioTrack, @"^ \+ ([0-9]*), ([A-Za-z0-9,\s]*) \((.*)\)"); // ID and Language
Match iso639_2 = Regex.Match(audioTrack, @"iso639-2: ([a-zA-Z]*)\)");
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
index 0545dd1d5..258dcff16 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
@@ -36,8 +36,7 @@ namespace HandBrake.ApplicationServices.Parsing
/// </returns>
public static Chapter Parse(StringReader output)
{
- Match m = Regex.Match(
- output.ReadLine(),
+ Match m = Regex.Match(output.ReadLine(),
@"^ \+ ([0-9]*): cells ([0-9]*)->([0-9]*), ([0-9]*) blocks, duration ([0-9]{2}:[0-9]{2}:[0-9]{2})");
if (m.Success)
{
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
index c7e5a27bb..d9f7e5e69 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
@@ -41,7 +41,7 @@ namespace HandBrake.ApplicationServices.Parsing
while (!output.EndOfStream)
{
- if ((char) output.Peek() == '+')
+ if ((char)output.Peek() == '+')
thisDVD.Titles.AddRange(Title.ParseList(output.ReadToEnd()));
else
output.ReadLine();
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs
index f4cd65768..913ab5fa1 100644
--- a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs
+++ b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs
@@ -87,7 +87,7 @@ namespace HandBrake.ApplicationServices.Parsing
public static IEnumerable<Subtitle> ParseList(StringReader output)
{
var subtitles = new List<Subtitle>();
- while ((char) output.Peek() != '+')
+ while ((char)output.Peek() != '+')
{
Subtitle thisSubtitle = Parse(output);
diff --git a/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs b/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..c6ad9aef0
--- /dev/null
+++ b/win/C#/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs
@@ -0,0 +1,42 @@
+/* AssemblyInfo.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HandBrake")]
+[assembly: AssemblyDescription("HandBrake is a GPL-licensed, multiplatform, multithreaded video transcoder.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HandBrake Team")]
+[assembly: AssemblyProduct("HandBrake")]
+[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5e4e3f97-5252-41f6-aae9-3846f62cbc66")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.9.4.3447")]
+[assembly: NeutralResourcesLanguage("")]
diff --git a/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs b/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs
new file mode 100644
index 000000000..b7e1ccd4a
--- /dev/null
+++ b/win/C#/HandBrake.ApplicationServices/ScanProgressEventArgs.cs
@@ -0,0 +1,25 @@
+/* ScanProgressEventArgs.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices
+{
+ using System;
+
+ /// <summary>
+ /// Scan Progress Event Args
+ /// </summary>
+ public class ScanProgressEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Gets or sets TotalTitles.
+ /// </summary>
+ public int TotalTitles { get; set; }
+
+ /// <summary>
+ /// Gets or sets CurrentTitle.
+ /// </summary>
+ public int CurrentTitle { get; set; }
+ }
+}
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
index 87b0e0027..ca3f898df 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
@@ -15,7 +15,6 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
@@ -252,14 +251,15 @@ namespace HandBrake.ApplicationServices.Services
SendKeys.Send("^C");
SendKeys.Flush();
- //if (HbProcess != null)
+ /*//if (HbProcess != null)
//{
// HbProcess.StandardInput.AutoFlush = true;
// HbProcess.StandardInput.WriteLine("^c^z");
- //}
+ //}*/
}
/* Helpers */
+
/// <summary>
/// Save a copy of the log to the users desired location or a default location
/// if this feature is enabled in options.
@@ -315,8 +315,6 @@ namespace HandBrake.ApplicationServices.Services
{
IsEncoding = false;
- // ReadFile(null);
-
if (this.EncodeEnded != null)
this.EncodeEnded(this, new EventArgs());
@@ -344,9 +342,6 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// Read the log file
/// </summary>
- /// <param name="n">
- /// The object.
- /// </param>
private void ReadFile()
{
logBuffer = new StringBuilder();
@@ -398,6 +393,7 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// Setup the logging.
/// </summary>
+ /// <param name="encodeJob">The Encode Job Object</param>
private void SetupLogging(Job encodeJob)
{
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs
index 981f3c19e..d82cfbb02 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueue.cs
@@ -58,16 +58,6 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
int Count { get; }
/// <summary>
- /// Gets a value indicating whether IsEncoding.
- /// </summary>
- bool IsEncoding { get; }
-
- /// <summary>
- /// Gets ActivityLog.
- /// </summary>
- string ActivityLog { get; }
-
- /// <summary>
/// Adds an item to the queue.
/// </summary>
/// <param name="query">
@@ -122,6 +112,7 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
/// Writes the current state of the queue in the form of a batch (.bat) file.
/// </summary>
/// <param name="file">The location of the file to write the batch file to.</param>
+ /// <returns>True if sucessful</returns>
bool WriteBatchScriptToFile(string file);
/// <summary>
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
index b02b8b06f..63d3aee64 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
@@ -27,7 +27,7 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
/// <summary>
/// Scan process has changed to a new title
/// </summary>
- event EventHandler ScanStatusChanged;
+ event ScanService.ScanProgessStatus ScanStatusChanged;
/// <summary>
/// Gets a value indicating whether IsScanning.
@@ -35,11 +35,6 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
bool IsScanning { get; }
/// <summary>
- /// Gets the Scan Status.
- /// </summary>
- string ScanStatus { get; }
-
- /// <summary>
/// Gets the Souce Data.
/// </summary>
DVD SouceData { get; }
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
index 59c084f1c..3bcbcb7e8 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
@@ -17,7 +17,6 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
@@ -253,6 +252,7 @@ namespace HandBrake.ApplicationServices.Services
/// Writes the current state of the queue in the form of a batch (.bat) file.
/// </summary>
/// <param name="file">The location of the file to write the batch file to.</param>
+ /// <returns>True if successful</returns>
public bool WriteBatchScriptToFile(string file)
{
string queries = string.Empty;
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
index da8d34f7c..76ecbf2b9 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
@@ -61,9 +61,20 @@ namespace HandBrake.ApplicationServices.Services
public event EventHandler ScanCompleted;
/// <summary>
+ /// Scan Progess Status
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The ScanProgressEventArgs.
+ /// </param>
+ public delegate void ScanProgessStatus(object sender, ScanProgressEventArgs e);
+
+ /// <summary>
/// Scan process has changed to a new title
/// </summary>
- public event EventHandler ScanStatusChanged;
+ public event ScanProgessStatus ScanStatusChanged;
/* Properties */
@@ -73,11 +84,6 @@ namespace HandBrake.ApplicationServices.Services
public bool IsScanning { get; private set; }
/// <summary>
- /// Gets the Scan Status.
- /// </summary>
- public string ScanStatus { get; private set; }
-
- /// <summary>
/// Gets the Souce Data.
/// </summary>
public DVD SouceData { get; private set; }
@@ -186,7 +192,7 @@ namespace HandBrake.ApplicationServices.Services
this.hbProc.Start();
this.readData = new Parser(this.hbProc.StandardError.BaseStream);
- this.readData.OnScanProgress += new ScanProgressEventHandler(this.OnScanProgress);
+ this.readData.OnScanProgress += this.OnScanProgress;
this.SouceData = DVD.Parse(this.readData);
// Write the Buffer out to file.
@@ -280,9 +286,14 @@ namespace HandBrake.ApplicationServices.Services
/// <param name="titleCount">the total number of titles</param>
private void OnScanProgress(object sender, int currentTitle, int titleCount)
{
- this.ScanStatus = string.Format("Processing Title: {0} of {1}", currentTitle, titleCount);
+ ScanProgressEventArgs scanProgressEventArgs = new ScanProgressEventArgs
+ {
+ TotalTitles = titleCount,
+ CurrentTitle = currentTitle
+ };
+
if (this.ScanStatusChanged != null)
- this.ScanStatusChanged(this, new EventArgs());
+ this.ScanStatusChanged(this, scanProgressEventArgs);
}
}
} \ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Settings.StyleCop b/win/C#/HandBrake.ApplicationServices/Settings.StyleCop
index 7f55ce6c6..1ca772fff 100644
--- a/win/C#/HandBrake.ApplicationServices/Settings.StyleCop
+++ b/win/C#/HandBrake.ApplicationServices/Settings.StyleCop
@@ -1 +1,14 @@
-<StyleCopSettings Version="4.3" /> \ No newline at end of file
+<StyleCopSettings Version="4.3">
+ <Analyzers>
+ <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.MaintainabilityRules">
+ <Rules>
+ <Rule Name="FieldsMustBePrivate">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
+ </Rules>
+ <AnalyzerSettings />
+ </Analyzer>
+ </Analyzers>
+</StyleCopSettings> \ No newline at end of file