summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrake.ApplicationServices/Services
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/Services
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/Services')
-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
5 files changed, 27 insertions, 34 deletions
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