diff options
author | sr55 <[email protected]> | 2014-05-14 19:48:54 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-05-14 19:48:54 +0000 |
commit | 37848c2b97eda7b116a79d1b520377bd4978e6ba (patch) | |
tree | eb4938c6d839ce87b20a5acf60e02fdf2b13be70 /win/CS/HandBrakeWPF/ViewModels | |
parent | ebb2651ca57744741810e870e3762f1ada2959e6 (diff) |
WinGui: Fix up Pausing when using libhb encode.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6189 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 55694dbe6..4445a546b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -27,6 +27,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Model.Subtitle;
using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
@@ -180,6 +181,11 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private BindingList<SourceMenuItem> drives;
+ /// <summary>
+ /// The can pause.
+ /// </summary>
+ private bool canPause;
+
#endregion
/// <summary>
@@ -420,6 +426,26 @@ namespace HandBrakeWPF.ViewModels public int TitleSpecificScan { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether the encode serivce supports pausing.
+ /// </summary>
+ public bool CanPause
+ {
+ get
+ {
+ return this.canPause;
+ }
+ set
+ {
+ if (value.Equals(this.canPause))
+ {
+ return;
+ }
+ this.canPause = value;
+ this.NotifyOfPropertyChange(() => this.CanPause);
+ }
+ }
+
+ /// <summary>
/// Gets or sets the Source Label
/// This indicates the status of scans.
/// </summary>
@@ -569,6 +595,7 @@ namespace HandBrakeWPF.ViewModels set
{
this.isEncoding = value;
+ this.CanPause = value;
this.NotifyOfPropertyChange(() => this.IsEncoding);
}
}
@@ -1320,8 +1347,13 @@ namespace HandBrakeWPF.ViewModels }
// Check if we already have jobs, and if we do, just start the queue.
- if (this.queueProcessor.Count != 0)
+ if (this.queueProcessor.Count != 0 || this.encodeService.IsPasued)
{
+ if (this.encodeService.IsPasued)
+ {
+ this.IsEncoding = true;
+ }
+
this.queueProcessor.Start(UserSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue));
return;
}
@@ -1375,6 +1407,12 @@ namespace HandBrakeWPF.ViewModels public void PauseEncode()
{
this.queueProcessor.Pause();
+
+ if (this.encodeService.CanPause)
+ {
+ this.encodeService.Pause();
+ this.IsEncoding = false;
+ }
}
/// <summary>
@@ -2064,6 +2102,7 @@ namespace HandBrakeWPF.ViewModels {
this.IsEncoding = false;
+
Execute.OnUIThread(
() =>
{
|