From f6b620012c27bc2858ea0ad198bd3edf34965ca3 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 19 May 2010 20:13:53 +0000 Subject: WinGui: - In-Gui encode status is now own by default. - Added a progress bar and tidied up the appearance of the status text. - Tweaked the preview window design. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3307 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'win/C#/frmMain.cs') diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 61efc879c..72790bd09 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -42,6 +42,7 @@ namespace Handbrake private DVD currentSource; private ScanService SourceScan = new ScanService(); private List drives; + private Thread encodeMonitor; // Delegates ********************************************************** private delegate void UpdateWindowHandler(); @@ -351,8 +352,8 @@ namespace Handbrake // Experimental HBProc Process Monitoring. if (Properties.Settings.Default.enocdeStatusInGui) { - Thread encodeMon = new Thread(EncodeMonitorThread); - encodeMon.Start(); + encodeMonitor = new Thread(EncodeMonitorThread); + encodeMonitor.Start(); } } @@ -821,9 +822,6 @@ namespace Handbrake { encodeQueue.SafelyClose(); } - - // Update the GUI - SetEncodeFinished(); } } else @@ -1868,6 +1866,7 @@ namespace Handbrake } lbl_encode.Text = "Encoding Finished"; + ProgressBarStatus.Visible = false; btn_start.Text = "Start"; btn_start.ToolTipText = "Start the encoding process"; btn_start.Image = Properties.Resources.Play; @@ -1898,8 +1897,9 @@ namespace Handbrake BeginInvoke(new UpdateWindowHandler(SetEncodeStarted)); return; } - lbl_encode.Visible = true; + ProgressBarStatus.Value = 0; + ProgressBarStatus.Visible = true; lbl_encode.Text = "Encoding with " + encodeQueue.Count + " encode(s) pending"; btn_start.Text = "Stop"; btn_start.ToolTipText = "Stop the encoding process."; @@ -2052,6 +2052,8 @@ namespace Handbrake encode.OnEncodeProgress += EncodeOnEncodeProgress; while (!encode.EndOfStream) encode.ReadEncodeStatus(); + + SetEncodeFinished(); } catch (Exception exc) { @@ -2079,7 +2081,14 @@ namespace Handbrake return; } lbl_encode.Text = - string.Format("Encode Progress: {0}%, FPS: {1}, Avg FPS: {2}, Time Remaining: {3} ", PercentComplete, CurrentFps, AverageFps, TimeRemaining); + string.Format( + "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}", + PercentComplete, + CurrentFps, + AverageFps, + TimeRemaining); + + ProgressBarStatus.Value = (int)Math.Round(PercentComplete); } #endregion -- cgit v1.2.3