summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs26
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs53
3 files changed, 78 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs
index 67dcf4c09..6ccc50777 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs
@@ -22,6 +22,11 @@ namespace HandBrakeWPF.ViewModels.Interfaces
Preset SelectedPreset { set; }
/// <summary>
+ /// Gets or Sets IsInstandHandBrake.
+ /// </summary>
+ bool IsInstandHandBrake { get; set; }
+
+ /// <summary>
/// Shutdown the Application
/// </summary>
void ExitApplication();
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 81ac6a688..1e3754de7 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -922,8 +922,16 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets a value indicating progress percentage.
+ /// </summary>
public int ProgressPercentage { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the app is in "instant" mode
+ /// </summary>
+ public bool IsInstandHandBrake { get; set; }
+
#endregion
#region Load and Shutdown Handling
@@ -950,12 +958,18 @@ namespace HandBrakeWPF.ViewModels
"Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);
// Queue Recovery
- QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+ if (!AppArguments.IsInstantHandBrake)
+ {
+ QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+ }
this.SelectedPreset = this.presetService.DefaultPreset;
// Populate the Source menu with drives.
- this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());
+ if (!AppArguments.IsInstantHandBrake)
+ {
+ this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());
+ }
// Log Cleaning
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))
@@ -1897,9 +1911,15 @@ namespace HandBrakeWPF.ViewModels
{
if (this.queueProcessor.EncodeService.IsEncoding)
{
+ string josPending = string.Empty;
+ if (this.IsInstandHandBrake)
+ {
+ josPending = ", Pending Jobs {5}";
+ }
+
this.ProgramStatusLabel =
string.Format(
- "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}",
+ "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}" + josPending,
e.PercentComplete,
e.CurrentFrameRate,
e.AverageFrameRate,
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
index 39fee77fd..4a4aebf43 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
@@ -13,6 +13,8 @@ namespace HandBrakeWPF.ViewModels
using Caliburn.Micro;
+ using Castle.Facilities.FactorySupport;
+
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.Helpers;
@@ -42,6 +44,11 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private bool showOptions;
+ /// <summary>
+ /// The show instant.
+ /// </summary>
+ private bool showInstant;
+
#endregion
/// <summary>
@@ -53,8 +60,19 @@ namespace HandBrakeWPF.ViewModels
public ShellViewModel(IErrorService errorService)
{
this.errorService = errorService;
- this.showMainWindow = true;
- this.showOptions = false;
+
+ if (!AppArguments.IsInstantHandBrake)
+ {
+ this.showMainWindow = true;
+ this.showOptions = false;
+ this.showInstant = false;
+ }
+ else
+ {
+ this.showMainWindow = false;
+ this.showOptions = false;
+ this.showInstant = true;
+ }
}
/// <summary>
@@ -69,16 +87,29 @@ namespace HandBrakeWPF.ViewModels
{
this.ShowMainWindow = true;
this.ShowOptions = false;
+ this.ShowInstant = false;
+ this.MainViewModel.IsInstandHandBrake = false;
}
else if (window == ShellWindow.OptionsWindow)
{
this.ShowOptions = true;
this.ShowMainWindow = false;
+ this.ShowInstant = false;
+ this.MainViewModel.IsInstandHandBrake = false;
+ }
+ else if (window == ShellWindow.InstantMainWindow)
+ {
+ this.ShowInstant = true;
+ this.ShowOptions = false;
+ this.ShowMainWindow = false;
+ this.MainViewModel.IsInstandHandBrake = true;
}
else
{
this.ShowMainWindow = true;
this.ShowOptions = false;
+ this.ShowInstant = false;
+ this.MainViewModel.IsInstandHandBrake = false;
}
}
@@ -127,13 +158,29 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Gets or sets a value indicating whether ShowInstant.
+ /// </summary>
+ public bool ShowInstant
+ {
+ get
+ {
+ return this.showInstant;
+ }
+ set
+ {
+ this.showInstant = value;
+ this.NotifyOfPropertyChange(() => this.ShowInstant);
+ }
+ }
+
+ /// <summary>
/// Gets WindowTitle.
/// </summary>
public string WindowTitle
{
get
{
- return "HandBrake";
+ return AppArguments.IsInstantHandBrake ? "Instant HandBrake" : "HandBrake";
}
}