diff options
author | sr55 <[email protected]> | 2011-03-27 20:08:33 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-03-27 20:08:33 +0000 |
commit | abd251048b392e86041325c1561e7a9dcd8067c3 (patch) | |
tree | 6f18df3389db6994e5f454e423880f73c7a5e8d6 /win/CS/HandBrake.ApplicationServices/Parsing | |
parent | 5b0977cc04f8d6471905f4090c7f18e6240988da (diff) |
WinGui:
- Some move re factoring to push the logic code into the service library.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3885 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Parsing')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Parsing/Title.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs index 3a9e6a56a..7f4bf9b78 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs @@ -223,6 +223,26 @@ namespace HandBrake.ApplicationServices.Parsing }
/// <summary>
+ /// Calcuate the Duration
+ /// </summary>
+ /// <param name="startPoint">The Start Point (Chapters)</param>
+ /// <param name="endPoint">The End Point (Chapters)</param>
+ /// <returns>A Timespan</returns>
+ public TimeSpan CalculateDuration(int startPoint, int endPoint)
+ {
+ TimeSpan duration = TimeSpan.FromSeconds(0.0);
+ startPoint++;
+ endPoint++;
+ if (startPoint != 0 && endPoint != 0 && endPoint <= this.Chapters.Count)
+ {
+ for (int i = startPoint; i <= endPoint; i++)
+ duration += this.Chapters[i - 1].Duration;
+ }
+
+ return duration;
+ }
+
+ /// <summary>
/// Override of the ToString method to provide an easy way to use this object in the UI
/// </summary>
/// <returns>A string representing this track in the format: {title #} (00:00:00)</returns>
|