summaryrefslogtreecommitdiffstats
path: root/win/C#/frmMain.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-05-19 20:13:53 +0000
committersr55 <[email protected]>2010-05-19 20:13:53 +0000
commitf6b620012c27bc2858ea0ad198bd3edf34965ca3 (patch)
tree558aa1a7dfecb8ed69bca9e59ef1c93897ea9d8b /win/C#/frmMain.cs
parent7fda78b54bdc920653ca3d9d2da0be56712c0a77 (diff)
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
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r--win/C#/frmMain.cs23
1 files changed, 16 insertions, 7 deletions
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<DriveInformation> 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