@@ -30,6 +30,7 @@ public class EncodeJobViewModel : ReactiveObject, IDragItem, IListItemViewModel
30
30
public const double SubtitleScanCostFactor = 5.0 ;
31
31
private ProcessingService processingService ;
32
32
private Stopwatch encodeTimeStopwatch ;
33
+ private Stopwatch pauseTimeStopwatch ;
33
34
34
35
public EncodeJobViewModel (
35
36
VCJob job ,
@@ -354,6 +355,19 @@ public TimeSpan EncodeTime
354
355
}
355
356
}
356
357
358
+ public TimeSpan PauseTime
359
+ {
360
+ get
361
+ {
362
+ if ( this . pauseTimeStopwatch == null )
363
+ {
364
+ return TimeSpan . Zero ;
365
+ }
366
+
367
+ return this . pauseTimeStopwatch . Elapsed ;
368
+ }
369
+ }
370
+
357
371
private readonly ObservableAsPropertyHelper < string > encodeTimeDisplay ;
358
372
public string EncodeTimeDisplay => this . encodeTimeDisplay . Value ;
359
373
@@ -854,24 +868,28 @@ public void ReportEncodeStart()
854
868
this . InitializeForEncoding ( ) ;
855
869
this . Encoding = true ;
856
870
this . encodeTimeStopwatch = Stopwatch . StartNew ( ) ;
871
+ this . pauseTimeStopwatch = new Stopwatch ( ) ;
857
872
}
858
873
859
874
public void ReportEncodePause ( )
860
875
{
861
876
this . IsPaused = true ;
862
877
this . encodeTimeStopwatch . Stop ( ) ;
878
+ this . pauseTimeStopwatch . Start ( ) ;
863
879
}
864
880
865
881
public void ReportEncodeResume ( )
866
882
{
867
883
this . IsPaused = false ;
868
884
this . encodeTimeStopwatch . Start ( ) ;
885
+ this . pauseTimeStopwatch . Stop ( ) ;
869
886
}
870
887
871
888
public void ReportEncodeEnd ( )
872
889
{
873
890
this . Encoding = false ;
874
891
this . encodeTimeStopwatch ? . Stop ( ) ;
892
+ this . pauseTimeStopwatch ? . Stop ( ) ;
875
893
}
876
894
877
895
public override string ToString ( )
0 commit comments