diff options
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index b0ae80f93..6577dfc5c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -195,7 +195,7 @@ namespace HandBrakeWPF.ViewModels /// </param>
/// <param name="notificationService">
/// The notification Service.
- /// Leave in Constructor.
+ /// *** Leave in Constructor. *** TODO find out why?
/// </param>
public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService, INotificationService notificationService)
@@ -771,6 +771,28 @@ namespace HandBrakeWPF.ViewModels {
this.SelectedStartPoint = 1;
this.SelectedEndPoint = selectedTitle.Chapters.Last().ChapterNumber;
+ }
+ else if (value == PointToPointMode.Seconds)
+ {
+ this.SelectedStartPoint = 0;
+
+ int timeInSeconds;
+ if (int.TryParse(selectedTitle.Duration.TotalSeconds.ToString(CultureInfo.InvariantCulture), out timeInSeconds))
+ {
+ this.SelectedEndPoint = timeInSeconds;
+ }
+ }
+ else
+ {
+ // Note this does not account for VFR. It's only a guesstimate.
+ double estimatedTotalFrames = selectedTitle.Fps * selectedTitle.Duration.TotalSeconds;
+
+ this.SelectedStartPoint = 0;
+ int totalFrames;
+ if (int.TryParse(estimatedTotalFrames.ToString(CultureInfo.InvariantCulture), out totalFrames))
+ {
+ this.SelectedEndPoint = totalFrames;
+ }
}
}
}
|