summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs53
1 files changed, 37 insertions, 16 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index e4d20d053..41e280b9a 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -260,13 +260,13 @@ namespace HandBrakeWPF.ViewModels
this.CurrentTask = new EncodeTask();
this.CurrentTask.PropertyChanged += this.CurrentTask_PropertyChanged;
this.ScannedSource = new Source();
- this.HasSource = false;
-
- // Setup Events
- this.scanService.ScanStarted += this.ScanStared;
- this.scanService.ScanCompleted += this.ScanCompleted;
- this.scanService.ScanStatusChanged += this.ScanStatusChanged;
- this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
+ this.HasSource = false;
+
+ // Setup Events
+ this.scanService.ScanStarted += this.ScanStared;
+ this.scanService.ScanCompleted += this.ScanCompleted;
+ this.scanService.ScanStatusChanged += this.ScanStatusChanged;
+ this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
this.queueProcessor.QueueCompleted += this.QueueCompleted;
this.queueProcessor.QueueChanged += this.QueueChanged;
this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
@@ -1220,13 +1220,13 @@ namespace HandBrakeWPF.ViewModels
public void Shutdown()
{
// Shutdown Service
- this.encodeService.Stop();
-
- // Unsubscribe from Events.
- this.scanService.ScanStarted -= this.ScanStared;
- this.scanService.ScanCompleted -= this.ScanCompleted;
- this.scanService.ScanStatusChanged -= this.ScanStatusChanged;
-
+ this.encodeService.Stop();
+
+ // Unsubscribe from Events.
+ this.scanService.ScanStarted -= this.ScanStared;
+ this.scanService.ScanCompleted -= this.ScanCompleted;
+ this.scanService.ScanStatusChanged -= this.ScanStatusChanged;
+
this.queueProcessor.QueueCompleted -= this.QueueCompleted;
this.queueProcessor.QueueChanged -= this.QueueChanged;
this.queueProcessor.JobProcessingStarted -= this.QueueProcessorJobProcessingStarted;
@@ -2258,14 +2258,35 @@ namespace HandBrakeWPF.ViewModels
{
if (this.queueProcessor.EncodeService.IsEncoding)
{
+ long length = 0;
+ double filesize = 0;
+ try
+ {
+ length = new System.IO.FileInfo(this.Destination).Length;
+ if (length != 0)
+ {
+ length = length / 1024 / 1024; // MB
+ }
+
+ double portionLeft = 100 / e.PercentComplete;
+
+ filesize = Math.Round( length * portionLeft, 1);
+
+ }
+ catch (Exception ee)
+ {
+ Debug.WriteLine(ee);
+ }
+
this.ProgramStatusLabel =
- string.Format("{0:00.00}% FPS: {1:000.0} Avg FPS: {2:000.0} Time Remaining: {3} Elapsed: {4:hh\\:mm\\:ss}" + Resources.Main_JobsPending_addon,
+ string.Format("{0:00.00}% FPS: {1:000.0} Avg FPS: {2:000.0} Time Remaining: {3} Elapsed: {4:hh\\:mm\\:ss} Filesize: {6}MB" + Resources.Main_JobsPending_addon,
e.PercentComplete,
e.CurrentFrameRate,
e.AverageFrameRate,
e.EstimatedTimeLeft,
e.ElapsedTime,
- this.queueProcessor.Count);
+ this.queueProcessor.Count,
+ filesize);
if (lastEncodePercentage != percent && this.windowsSeven.IsWindowsSeven)
{