diff options
author | sr55 <[email protected]> | 2011-05-08 11:00:16 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-05-08 11:00:16 +0000 |
commit | c2e751e3eb2ed19163c6c2a1318eab28bcbb921b (patch) | |
tree | 2a652aefd39b11c7442136052927df1b0e9b6191 /win/CS/frmQueue.cs | |
parent | 3d7392c9e4f114408b2fd16bd848a2e10c36fa32 (diff) |
WinGui:
- Add Elapsed Encode Time the main window.
- Add Elapsed Queue Time to the queue window. (Note, Pausing the queue resets this currently)
- Fixed an issue with disabled controls on the audio panel after removing the last track which was passthru.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3973 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/frmQueue.cs')
-rw-r--r-- | win/CS/frmQueue.cs | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/win/CS/frmQueue.cs b/win/CS/frmQueue.cs index ee9dae04f..20ce68259 100644 --- a/win/CS/frmQueue.cs +++ b/win/CS/frmQueue.cs @@ -46,6 +46,8 @@ namespace Handbrake private readonly IUserSettingService userSettingService = new UserSettingService();
+ private DateTime startTime;
+
/// <summary>
/// Initializes a new instance of the <see cref="frmQueue"/> class.
/// </summary>
@@ -136,11 +138,14 @@ namespace Handbrake lbl_encodeStatus.Text =
string.Format(
- "Encoding: Pass {0} of {1}, {2:00.00}% Time Remaining: {3}",
+ "Encoding: Pass {0} of {1}, {2:00.00}%, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}",
e.Task,
e.TaskCount,
e.PercentComplete,
- e.EstimatedTimeLeft);
+ e.EstimatedTimeLeft,
+ e.ElapsedTime);
+
+ UpdateStatusLabel();
}
/// <summary>
@@ -224,6 +229,7 @@ namespace Handbrake if (!queue.IsProcessing)
{
SetUiEncodeStarted();
+ startTime = DateTime.Now;
}
lbl_encodeStatus.Text = "Encoding ...";
@@ -242,6 +248,7 @@ namespace Handbrake private void BtnPauseClick(object sender, EventArgs e)
{
queue.Pause();
+
MessageBox.Show(
"No further items on the queue will start. The current encode process will continue until it is finished. \nClick 'Encode' when you wish to continue encoding the queue.",
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
@@ -309,7 +316,7 @@ namespace Handbrake lbl_dest.Text = "-";
lbl_encodeOptions.Text = "-";
- lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending";
+ UpdateStatusLabel();
}
/// <summary>
@@ -348,22 +355,7 @@ namespace Handbrake item.SubItems.Add(chapters); // Chapters
item.SubItems.Add(queueItem.Source); // Source
item.SubItems.Add(queueItem.Destination); // Destination
-
- switch (parsed.VideoEncoder)
- {
- case VideoEncoder.FFMpeg:
- item.SubItems.Add("MPEG-4 (FFmpeg)");
- break;
- default:
- case VideoEncoder.X264:
- item.SubItems.Add("H.264 (x264)");
- break;
- case VideoEncoder.Theora:
- item.SubItems.Add("VP3 (Theroa)");
- break;
- }
-
- // Video
+ item.SubItems.Add(EnumHelper<VideoEncoder>.GetDescription(parsed.VideoEncoder));
// Display The Audio Track Information
string audio = string.Empty;
@@ -392,7 +384,28 @@ namespace Handbrake }
RedrawQueue();
- lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending";
+ UpdateStatusLabel();
+ }
+
+ private void UpdateStatusLabel()
+ {
+ if (InvokeRequired)
+ {
+ BeginInvoke(new UpdateHandler(UpdateStatusLabel));
+ return;
+ }
+ TimeSpan span = DateTime.Now - startTime;
+
+ if (queue.IsProcessing)
+ {
+ lbl_encodesPending.Text = string.Format(
+ "{0} encodes(s) pending, Time Elasped {1:hh\\:mm\\:ss}", list_queue.Items.Count, span);
+ }
+ else
+ {
+ lbl_encodesPending.Text = string.Format(
+ "{0} encodes(s) pending", list_queue.Items.Count);
+ }
}
/// <summary>
|