diff options
author | sr55 <[email protected]> | 2017-04-15 12:26:59 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-04-15 12:27:19 +0100 |
commit | 52d4c21b22cfc91b63a680aa7e475cc0ca6012cb (patch) | |
tree | d742c17b8ddff744d10ec5ee79344355aa17a907 /win/CS/HandBrakeWPF | |
parent | a0fefdaf374c7e7b0bbf58482b86bac03d673a7c (diff) |
WinGui: Handle HB_STATE_MUXING and HB_STATE_SEARCHING for better progress indication in the UI. #676
Diffstat (limited to 'win/CS/HandBrakeWPF')
7 files changed, 106 insertions, 26 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 0fee65fc9..c04e4e97e 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -754,6 +754,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Muxing: This may take a while....
+ /// </summary>
+ public static string MainView_Muxing {
+ get {
+ return ResourceManager.GetString("MainView_Muxing", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Options.
/// </summary>
public static string MainView_Options {
@@ -817,6 +826,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Encoding: {0}, {1:00.00}%, Time Remaining: {2}, {3}.
+ /// </summary>
+ public static string MainView_ProgressStatusWithTask {
+ get {
+ return ResourceManager.GetString("MainView_ProgressStatusWithTask", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Remove.
/// </summary>
public static string MainView_Remove {
@@ -835,6 +853,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Searching for start time.
+ /// </summary>
+ public static string MainView_Searching {
+ get {
+ return ResourceManager.GetString("MainView_Searching", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Set Default.
/// </summary>
public static string MainView_SetDefault {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index f6c92ea61..50a0c4bbd 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -899,4 +899,13 @@ This will not affect your current settings in the Subtitle tab.</value> <data name="OptionsView_PlaySoundWhenDone" xml:space="preserve">
<value>Play a sound when the queue or single encode completes:</value>
</data>
+ <data name="MainView_Muxing" xml:space="preserve">
+ <value>Muxing: This may take a while...</value>
+ </data>
+ <data name="MainView_ProgressStatusWithTask" xml:space="preserve">
+ <value>Encoding: {0}, {1:00.00}%, Time Remaining: {2}, {3}</value>
+ </data>
+ <data name="MainView_Searching" xml:space="preserve">
+ <value>Searching for start time</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Encode/EventArgs/EncodeProgressEventArgs.cs b/win/CS/HandBrakeWPF/Services/Encode/EventArgs/EncodeProgressEventArgs.cs index 940be6568..784245af6 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/EventArgs/EncodeProgressEventArgs.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/EventArgs/EncodeProgressEventArgs.cs @@ -10,54 +10,45 @@ namespace HandBrakeWPF.Services.Encode.EventArgs { using System; - using System.Runtime.Serialization; /// <summary> /// Encode Progress Event Args /// </summary> - [DataContract] public class EncodeProgressEventArgs : EventArgs { /// <summary> /// Gets or sets PercentComplete. /// </summary> - [DataMember] public double PercentComplete { get; set; } /// <summary> /// Gets or sets CurrentFrameRate. /// </summary> - [DataMember] public double CurrentFrameRate { get; set; } /// <summary> /// Gets or sets AverageFrameRate. /// </summary> - [DataMember] public double AverageFrameRate { get; set; } /// <summary> /// Gets or sets EstimatedTimeLeft. /// </summary> - [DataMember] public TimeSpan EstimatedTimeLeft { get; set; } /// <summary> /// Gets or sets Task. /// </summary> - [DataMember] public int Task { get; set; } /// <summary> /// Gets or sets TaskCount. /// </summary> - [DataMember] public int TaskCount { get; set; } /// <summary> /// Gets or sets ElapsedTime. /// </summary> - [DataMember] public TimeSpan ElapsedTime { get; set; } /// <summary> @@ -70,5 +61,31 @@ namespace HandBrakeWPF.Services.Encode.EventArgs /// 2: Encode second pass /// </remarks> public int PassId { get; set; } + + /// <summary> + /// Gets a value indicating that we are in the muxing process. + /// </summary> + public bool IsMuxing { get; set; } + + /// <summary> + /// Gets a value indicating that we are in the searching process. + /// </summary> + public bool IsSearching { get; set; } + + /// <summary> + /// Gets a value indicating that we are doing a subtitle scan pass. + /// </summary> + public bool IsSubtitleScan + { + get + { + if (this.PassId == -1) + { + return true; + } + + return false; + } + } } } diff --git a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs index 03763d448..2ad5f0688 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs @@ -180,7 +180,9 @@ namespace HandBrakeWPF.Services.Encode Task = e.Pass, TaskCount = e.PassCount, ElapsedTime = DateTime.Now - this.startTime, - PassId = e.PassId + PassId = e.PassId, + IsMuxing = e.IsMuxing, + IsSearching = e.IsSearching }; this.InvokeEncodeStatusChanged(args); diff --git a/win/CS/HandBrakeWPF/Services/Scan/EventArgs/ScanProgressEventArgs.cs b/win/CS/HandBrakeWPF/Services/Scan/EventArgs/ScanProgressEventArgs.cs index 8d815b746..113f7a923 100644 --- a/win/CS/HandBrakeWPF/Services/Scan/EventArgs/ScanProgressEventArgs.cs +++ b/win/CS/HandBrakeWPF/Services/Scan/EventArgs/ScanProgressEventArgs.cs @@ -10,30 +10,25 @@ namespace HandBrakeWPF.Services.Scan.EventArgs { using System; - using System.Runtime.Serialization; /// <summary> /// Scan Progress Event Args /// </summary> - [DataContract] public class ScanProgressEventArgs : EventArgs { /// <summary> /// Gets or sets the title currently being scanned. /// </summary> - [DataMember] public int CurrentTitle { get; set; } /// <summary> /// Gets or sets the total number of Titles. /// </summary> - [DataMember] public int Titles { get; set; } /// <summary> /// Gets or sets the percentage. /// </summary> - [DataMember] public decimal Percentage { get; set; } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 283111b11..9bb991efc 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -2420,7 +2420,7 @@ namespace HandBrakeWPF.ViewModels if (this.queueProcessor.EncodeService.IsEncoding)
{
string jobsPending = string.Format(Resources.Main_JobsPending_addon, this.queueProcessor.Count);
- if (e.PassId == -1)
+ if (e.IsSubtitleScan)
{
this.ProgramStatusLabel = string.Format(Resources.MainViewModel_EncodeStatusChanged_SubScan_StatusLabel,
e.Task,
@@ -2430,6 +2430,14 @@ namespace HandBrakeWPF.ViewModels e.ElapsedTime,
jobsPending);
}
+ else if (e.IsMuxing)
+ {
+ this.ProgramStatusLabel = ResourcesUI.MainView_Muxing;
+ }
+ else if (e.IsSearching)
+ {
+ this.ProgramStatusLabel = string.Format(ResourcesUI.MainView_ProgressStatusWithTask, ResourcesUI.MainView_Searching, e.PercentComplete, e.EstimatedTimeLeft, jobsPending);
+ }
else
{
this.ProgramStatusLabel =
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index c5351d729..2267c1a44 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -519,16 +519,38 @@ namespace HandBrakeWPF.ViewModels {
Execute.OnUIThread(() =>
{
- this.JobStatus =
- string.Format(
- Resources.QueueViewModel_QueueStatusDisplay,
- e.Task,
- e.TaskCount,
- e.PercentComplete,
- e.CurrentFrameRate,
- e.AverageFrameRate,
- e.EstimatedTimeLeft,
- e.ElapsedTime);
+ string jobsPending = string.Format(Resources.Main_JobsPending_addon, this.queueProcessor.Count);
+ if (e.IsSubtitleScan)
+ {
+ this.JobStatus = string.Format(Resources.MainViewModel_EncodeStatusChanged_SubScan_StatusLabel,
+ e.Task,
+ e.TaskCount,
+ e.PercentComplete,
+ e.EstimatedTimeLeft,
+ e.ElapsedTime,
+ jobsPending);
+ }
+ else if (e.IsMuxing)
+ {
+ this.JobStatus = ResourcesUI.MainView_Muxing;
+ }
+ else if (e.IsSearching)
+ {
+ this.JobStatus = string.Format(ResourcesUI.MainView_ProgressStatusWithTask, ResourcesUI.MainView_Searching, e.PercentComplete, e.EstimatedTimeLeft, jobsPending);
+ }
+ else
+ {
+ this.JobStatus =
+ string.Format(Resources.MainViewModel_EncodeStatusChanged_StatusLabel,
+ e.Task,
+ e.TaskCount,
+ e.PercentComplete,
+ e.CurrentFrameRate,
+ e.AverageFrameRate,
+ e.EstimatedTimeLeft,
+ e.ElapsedTime,
+ jobsPending);
+ }
});
}
|