summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs12
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs74
-rw-r--r--win/CS/HandBrakeWPF/Views/QueueView.xaml8
3 files changed, 50 insertions, 44 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 4063c1e68..f3945fb7a 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1843,7 +1843,7 @@ namespace HandBrakeWPF.ViewModels
Execute.OnUIThread(
() =>
{
- if (this.IsEncoding)
+ if (this.queueProcessor.EncodeService.IsEncoding)
{
this.ProgramStatusLabel =
string.Format(
@@ -1862,6 +1862,16 @@ namespace HandBrakeWPF.ViewModels
lastEncodePercentage = percent;
}
+ else
+ {
+ this.ProgramStatusLabel = "Queue Finished";
+ this.IsEncoding = false;
+
+ if (this.windowsSeven.IsWindowsSeven)
+ {
+ this.windowsSeven.SetTaskBarProgressToNoProgress();
+ }
+ }
});
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index faa856d6b..3465fe273 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -237,6 +237,13 @@ namespace HandBrakeWPF.ViewModels
public void PauseEncode()
{
this.queueProcessor.Pause();
+
+ this.JobStatus = "Queue Paused";
+ this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
+ this.IsEncoding = false;
+
+ MessageBox.Show("The Queue has been pasued. The currently running job will run to completion and no further jobs will start.", "Queue",
+ MessageBoxButton.OK, MessageBoxImage.Information);
}
/// <summary>
@@ -293,6 +300,10 @@ namespace HandBrakeWPF.ViewModels
return;
}
+ this.JobStatus = "Queue Started";
+ this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
+ this.IsEncoding = true;
+
this.queueProcessor.Start();
}
@@ -364,13 +375,13 @@ namespace HandBrakeWPF.ViewModels
this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);
- this.queueProcessor.JobProcessingStarted += this.queueProcessor_JobProcessingStarted;
this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;
- this.queueProcessor.QueuePaused += this.queueProcessor_QueuePaused;
this.queueProcessor.QueueChanged += this.QueueManager_QueueChanged;
this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeService_EncodeStatusChanged;
+ this.queueProcessor.EncodeService.EncodeCompleted += EncodeService_EncodeCompleted;
this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
+ this.JobStatus = "Queue Ready";
base.OnActivate();
}
@@ -383,11 +394,10 @@ namespace HandBrakeWPF.ViewModels
/// </param>
protected override void OnDeactivate(bool close)
{
- this.queueProcessor.JobProcessingStarted -= this.queueProcessor_JobProcessingStarted;
this.queueProcessor.QueueCompleted -= this.queueProcessor_QueueCompleted;
- this.queueProcessor.QueuePaused -= this.queueProcessor_QueuePaused;
this.queueProcessor.QueueChanged -= this.QueueManager_QueueChanged;
this.queueProcessor.EncodeService.EncodeStatusChanged -= this.EncodeService_EncodeStatusChanged;
+ this.queueProcessor.EncodeService.EncodeCompleted -= EncodeService_EncodeCompleted;
base.OnDeactivate(close);
}
@@ -406,19 +416,16 @@ namespace HandBrakeWPF.ViewModels
{
Caliburn.Micro.Execute.OnUIThread(() =>
{
- if (this.IsEncoding)
- {
- this.JobStatus =
- string.Format(
- "Encoding: Pass {0} of {1}, {2:00.00}%, FPS: {3:000.0}, Avg FPS: {4:000.0}, Time Remaining: {5}, Elapsed: {6:hh\\:mm\\:ss}",
- e.Task,
- e.TaskCount,
- e.PercentComplete,
- e.CurrentFrameRate,
- e.AverageFrameRate,
- e.EstimatedTimeLeft,
- e.ElapsedTime);
- }
+ this.JobStatus =
+ string.Format(
+ "Encoding: Pass {0} of {1}, {2:00.00}%, FPS: {3:000.0}, Avg FPS: {4:000.0}, Time Remaining: {5}, Elapsed: {6:hh\\:mm\\:ss}",
+ e.Task,
+ e.TaskCount,
+ e.PercentComplete,
+ e.CurrentFrameRate,
+ e.AverageFrameRate,
+ e.EstimatedTimeLeft,
+ e.ElapsedTime);
});
}
@@ -434,23 +441,11 @@ namespace HandBrakeWPF.ViewModels
private void QueueManager_QueueChanged(object sender, EventArgs e)
{
this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
- }
- /// <summary>
- /// Handle teh Job Processing Started Event
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The QueueProgressEventArgs.
- /// </param>
- private void queueProcessor_JobProcessingStarted(
- object sender, QueueProgressEventArgs e)
- {
- this.JobStatus = "Queue Started";
- this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
- this.IsEncoding = true;
+ if (!queueProcessor.IsProcessing)
+ {
+ this.JobStatus = "Queue Not Running";
+ }
}
/// <summary>
@@ -470,19 +465,20 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Handle the Queue Paused Event
+ /// The encode service_ encode completed.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
- /// The EventArgs.
+ /// The e.
/// </param>
- private void queueProcessor_QueuePaused(object sender, EventArgs e)
+ private void EncodeService_EncodeCompleted(object sender, EncodeCompletedEventArgs e)
{
- this.JobStatus = "Queue Paused";
- this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);
- this.IsEncoding = false;
+ if (!this.queueProcessor.IsProcessing)
+ {
+ this.JobStatus = "Last Queued Job Finished";
+ }
}
#endregion
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml
index e0758689d..d3df53451 100644
--- a/win/CS/HandBrakeWPF/Views/QueueView.xaml
+++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml
@@ -10,10 +10,10 @@
xmlns:YourNamespace="clr-namespace:HandBrakeWPF.AttachedProperties"
xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio"
xmlns:Subtitles="clr-namespace:HandBrakeWPF.Converters.Subtitles" Title="{Binding Title}"
- Width="600"
- Height="400"
- MinWidth="600"
- MinHeight="400"
+ Width="700"
+ Height="500"
+ MinWidth="200"
+ MinHeight="200"
Background="#FFF0F0F0"
WindowStartupLocation="CenterScreen"
TextOptions.TextFormattingMode="Display"