summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-12-20 20:42:07 +0000
committersr55 <[email protected]>2011-12-20 20:42:07 +0000
commit4d0e5554c2e8d0a9fced4c1e3e1662aa677ff748 (patch)
tree140caef970e82488612ad31507588f7c65167dcb /win/CS/HandBrake.ApplicationServices/Services
parent7ebaeeb31c1eba5f86a79d9ae9946822e50232a9 (diff)
WinGui: Some Audio Panel refactoring and an additional method to the scan service to allow scan logs to be more easily debugged.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4377 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs29
3 files changed, 50 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
index fbbebfe27..b992dc8eb 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
@@ -86,5 +86,13 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
/// Kill the scan
/// </summary>
void Stop();
+
+ /// <summary>
+ /// Take a Scan Log file, and process it as if it were from the CLI.
+ /// </summary>
+ /// <param name="path">
+ /// The path to the log file.
+ /// </param>
+ void DebugScanLog(string path);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
index 033f16018..2a5726ef0 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
@@ -151,6 +151,20 @@ namespace HandBrake.ApplicationServices.Services
instance.StopScan();
}
+ /// <summary>
+ /// Debug a Scan Log (Only Available for CLI Mode, not LIBHB)
+ /// </summary>
+ /// <param name="path">
+ /// The path.
+ /// </param>
+ /// <exception cref="NotImplementedException">
+ /// (Only Available for CLI Mode, not LIBHB)
+ /// </exception>
+ public void DebugScanLog(string path)
+ {
+ throw new NotImplementedException("Only Available when using the CLI mode. Not LibHB");
+ }
+
#endregion
#region Private Methods
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
index 781aa40ec..b3470d63e 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
@@ -13,6 +13,7 @@ namespace HandBrake.ApplicationServices.Services
using System.Windows.Forms;
using HandBrake.ApplicationServices.EventArgs;
+ using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
@@ -147,6 +148,32 @@ namespace HandBrake.ApplicationServices.Services
// We don't really need to notify the user of any errors here.
}
}
+
+ /// <summary>
+ /// Take a Scan Log file, and process it as if it were from the CLI.
+ /// </summary>
+ /// <param name="path">
+ /// The path to the log file.
+ /// </param>
+ public void DebugScanLog(string path)
+ {
+ try
+ {
+ StreamReader parseLog = new StreamReader(path);
+ this.readData = new Parser(parseLog.BaseStream);
+ this.SouceData = Source.Parse(this.readData);
+ this.SouceData.ScanPath = path;
+
+ if (this.ScanCompleted != null)
+ {
+ this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty));
+ }
+ }
+ catch (Exception e)
+ {
+ throw new GeneralApplicationException("Debug Run Failed", string.Empty, e);
+ }
+ }
#endregion
#region Private Methods
@@ -268,7 +295,7 @@ namespace HandBrake.ApplicationServices.Services
this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()"));
}
}
-
+
/// <summary>
/// Fire an event when the scan process progresses
/// </summary>