summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs7
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs37
5 files changed, 47 insertions, 35 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index cdd436b03..f6b57b1e3 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -147,39 +147,15 @@ namespace HandBrake.ApplicationServices.Model
/// </summary>
public PointToPointMode PointToPointMode { get; set; }
- private int startPoint;
-
/// <summary>
/// Gets or sets StartPoint.
/// </summary>
- public int StartPoint
- {
- get
- {
- return this.startPoint;
- }
- set
- {
- this.startPoint = value;
- }
- }
-
- private int endPoint;
+ public int StartPoint { get; set; }
/// <summary>
/// Gets or sets EndPoint.
/// </summary>
- public int EndPoint
- {
- get
- {
- return this.endPoint;
- }
- set
- {
- this.endPoint = value;
- }
- }
+ public int EndPoint { get; set; }
#endregion
diff --git a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
index 0e06ca5c6..15f158381 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
@@ -11,6 +11,8 @@ namespace HandBrake.ApplicationServices.Model
{
using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Parsing;
+
/// <summary>
/// The QueueTask.
/// </summary>
@@ -28,6 +30,11 @@ namespace HandBrake.ApplicationServices.Model
#region Properties
/// <summary>
+ /// Gets or sets ScannedSource.
+ /// </summary>
+ public Source ScannedSource { get; set; }
+
+ /// <summary>
/// Gets or sets a value indicating whether if this is a user or GUI generated query
/// </summary>
public bool CustomQuery { get; set; }
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()"));
+ }
+ }
}
}