diff options
author | sr55 <[email protected]> | 2012-07-08 15:57:58 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-07-08 15:57:58 +0000 |
commit | aea2c5f0a32428671182a5e9d680ab4c016fce2c (patch) | |
tree | 39ae475bc274cb2ecf5099c6ddb98bc44e7d0e66 /win/CS/HandBrake.ApplicationServices/Services | |
parent | da44aa82136fb9423f041b200b3e40632b8287e7 (diff) |
WinGui: Initial work to restore queue editing functionality. (Note, it's not complete yet)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4821 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
3 files changed, 38 insertions, 9 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs index 3ad25c583..cd69084eb 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs @@ -84,7 +84,10 @@ namespace HandBrake.ApplicationServices.Services.Interfaces /// <param name="previewCount">
/// The preview Count.
/// </param>
- void Scan(string sourcePath, int title, int previewCount);
+ /// <param name="postAction">
+ /// The post Action.
+ /// </param>
+ void Scan(string sourcePath, int title, int previewCount, Action<bool> postAction);
/// <summary>
/// Kill the scan
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs index 8fe7affc6..4957a62bb 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs @@ -141,7 +141,10 @@ namespace HandBrake.ApplicationServices.Services /// <param name="previewCount">
/// The preview Count.
/// </param>
- public void Scan(string sourcePath, int title, int previewCount)
+ /// <param name="postAction">
+ /// The post Action.
+ /// </param>
+ public void Scan(string sourcePath, int title, int previewCount, Action<bool> postAction)
{
Thread t = new Thread(unused => this.ScanSource(sourcePath, title, previewCount));
t.Start();
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index 742a46b08..5eb1f0a37 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -124,9 +124,12 @@ namespace HandBrake.ApplicationServices.Services /// <param name="previewCount">
/// The preview Count.
/// </param>
- public void Scan(string sourcePath, int title, int previewCount)
+ /// <param name="postScanAction">
+ /// The post Scan Action.
+ /// </param>
+ public void Scan(string sourcePath, int title, int previewCount, Action<bool> postScanAction)
{
- Thread t = new Thread(unused => this.ScanSource(sourcePath, title, previewCount));
+ Thread t = new Thread(unused => this.ScanSource(sourcePath, title, previewCount, postScanAction));
t.Start();
}
@@ -195,7 +198,10 @@ namespace HandBrake.ApplicationServices.Services /// <param name="previewCount">
/// The preview Count.
/// </param>
- private void ScanSource(object sourcePath, int title, int previewCount)
+ /// <param name="postScanAction">
+ /// The post Scan Action. Disables the Scan Completed Event
+ /// </param>
+ private void ScanSource(object sourcePath, int title, int previewCount, Action<bool> postScanAction)
{
try
{
@@ -292,17 +298,34 @@ namespace HandBrake.ApplicationServices.Services this.IsScanning = false;
- if (this.ScanCompleted != null)
+
+ if (postScanAction != null)
{
- this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty));
+ postScanAction(true);
+ }
+ else
+ {
+ if (this.ScanCompleted != null)
+ {
+ this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty));
+ }
}
}
catch (Exception exc)
{
this.Stop();
- if (this.ScanCompleted != null)
- this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()"));
+ if (postScanAction != null)
+ {
+ postScanAction(false);
+ }
+ else
+ {
+ if (this.ScanCompleted != null)
+ {
+ this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()"));
+ }
+ }
}
}
|