summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-08-18 20:29:53 +0000
committersr55 <[email protected]>2013-08-18 20:29:53 +0000
commitf7dd1b81feb1a34e030d47f782bfa017a5550fd1 (patch)
tree8a7a643fe3f43ad117eed3ccc0ece471f3ed7dc2 /win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
parent1b762c5dcdab7133e2954fd3bb21e239a74de7e5 (diff)
WinGui: Stopping an encode or pausing the queue will no longer run the "When Done" option.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5714 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs42
1 files changed, 22 insertions, 20 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
index a8cb55f58..92558f6cc 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
@@ -49,12 +49,7 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// HandBrakes Queue file with a place holder for an extra string.
/// </summary>
- private string queueFile;
-
- /// <summary>
- /// The is paused.
- /// </summary>
- private bool isPaused;
+ private readonly string queueFile;
#endregion
@@ -96,6 +91,17 @@ namespace HandBrake.ApplicationServices.Services
/// </param>
public delegate void QueueProgressStatus(object sender, QueueProgressEventArgs e);
+ /// <summary>
+ /// The queue completed.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public delegate void QueueCompletedEventDelegate(object sender, QueueCompletedEventArgs e);
+
#endregion
#region Events
@@ -114,7 +120,7 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// Fires when the entire encode queue has completed.
/// </summary>
- public event EventHandler QueueCompleted;
+ public event QueueCompletedEventDelegate QueueCompleted;
/// <summary>
/// Fires when a pause to the encode queue has been requested.
@@ -424,7 +430,6 @@ namespace HandBrake.ApplicationServices.Services
{
this.InvokeQueuePaused(EventArgs.Empty);
this.IsProcessing = false;
- this.isPaused = true;
}
/// <summary>
@@ -447,7 +452,6 @@ namespace HandBrake.ApplicationServices.Services
}
this.IsProcessing = true;
- this.isPaused = false;
}
#endregion
@@ -490,7 +494,7 @@ namespace HandBrake.ApplicationServices.Services
else
{
this.EncodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;
- this.InvokeQueueCompleted(EventArgs.Empty);
+ this.OnQueueCompleted(new QueueCompletedEventArgs(true));
this.BackupQueue(string.Empty);
}
}
@@ -535,16 +539,14 @@ namespace HandBrake.ApplicationServices.Services
}
/// <summary>
- /// Invoke the QueueCompleted event.
+ /// Invoke the QueuePaused event
/// </summary>
/// <param name="e">
/// The EventArgs.
/// </param>
- private void InvokeQueueCompleted(EventArgs e)
+ private void InvokeQueuePaused(EventArgs e)
{
- this.IsProcessing = false;
-
- EventHandler handler = this.QueueCompleted;
+ EventHandler handler = this.QueuePaused;
if (handler != null)
{
handler(this, e);
@@ -552,14 +554,14 @@ namespace HandBrake.ApplicationServices.Services
}
/// <summary>
- /// Invoke the QueuePaused event
+ /// The on queue completed.
/// </summary>
/// <param name="e">
- /// The EventArgs.
+ /// The e.
/// </param>
- private void InvokeQueuePaused(EventArgs e)
+ protected virtual void OnQueueCompleted(QueueCompletedEventArgs e)
{
- EventHandler handler = this.QueuePaused;
+ QueueCompletedEventDelegate handler = this.QueueCompleted;
if (handler != null)
{
handler(this, e);
@@ -583,7 +585,7 @@ namespace HandBrake.ApplicationServices.Services
this.EncodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;
// Fire the event to tell connected services.
- this.InvokeQueueCompleted(EventArgs.Empty);
+ this.OnQueueCompleted(new QueueCompletedEventArgs(false));
}
}