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 | |
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')
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()"));
+ }
+ }
}
}
|