diff options
author | sr55 <[email protected]> | 2012-12-27 21:50:58 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-12-27 21:50:58 +0000 |
commit | 40373fc63256c3e135e9ca0352d70efe1291e929 (patch) | |
tree | f28a7436c6482f2bbf9b7588d31240010a0c66b0 /win/CS/HandBrakeWPF/ViewModels | |
parent | b87cca000d252e72f4d130068e9a2ea70f28b07f (diff) |
WinGui: Default the textboxes for Seconds and Frames to sensible values.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5109 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-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;
+ }
}
}
}
|