diff options
author | sr55 <[email protected]> | 2013-01-23 19:04:55 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-01-23 19:04:55 +0000 |
commit | b038d708ec82764959f7f2647224a7c5ad168191 (patch) | |
tree | 7f2261e02619db914a81771b1b6a2f9fc4203d16 | |
parent | 13ad8794373d89e4049e8774646cce11177e975b (diff) |
WinGui: Add duration of the chapter to the chapters tab.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5196 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs | 14 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ChaptersView.xaml | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs index db3794151..1a20379f4 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs @@ -9,6 +9,8 @@ namespace HandBrake.ApplicationServices.Model.Encoding
{
+ using System;
+
using Caliburn.Micro;
/// <summary>
@@ -37,10 +39,14 @@ namespace HandBrake.ApplicationServices.Model.Encoding /// <param name="name">
/// The name.
/// </param>
- public ChapterMarker(int number, string name)
+ /// <param name="duration">
+ /// The duration.
+ /// </param>
+ public ChapterMarker(int number, string name, TimeSpan duration)
{
this.ChapterName = name;
this.ChapterNumber = number;
+ this.Duration = duration;
}
/// <summary>
@@ -54,6 +60,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding {
this.ChapterName = chapter.ChapterName;
this.ChapterNumber = chapter.ChapterNumber;
+ this.Duration = chapter.Duration;
}
/// <summary>
@@ -62,6 +69,11 @@ namespace HandBrake.ApplicationServices.Model.Encoding public int ChapterNumber { get; set; }
/// <summary>
+ /// Gets or sets the duration.
+ /// </summary>
+ public TimeSpan Duration { get; set; }
+
+ /// <summary>
/// Gets or sets ChapterName.
/// </summary>
public string ChapterName
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs index 69a8a5d05..4276b97a4 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs @@ -274,7 +274,7 @@ namespace HandBrakeWPF.ViewModels foreach (Chapter chapter in this.SourceChapterList)
{
string chapterName = string.IsNullOrEmpty(chapter.ChapterName) ? string.Format("Chapter {0}", counter) : chapter.ChapterName;
- var marker = new ChapterMarker(chapter.ChapterNumber, chapterName);
+ var marker = new ChapterMarker(chapter.ChapterNumber, chapterName, chapter.Duration);
this.Task.ChapterNames.Add(marker);
counter += 1;
diff --git a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml index c6cefb35e..a5fa6a6da 100644 --- a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml +++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml @@ -38,7 +38,8 @@ </ContextMenu>
</DataGrid.ContextMenu>
<DataGrid.Columns>
- <DataGridTextColumn Header="Chapter Number" Width="150" Binding="{Binding ChapterNumber}" IsReadOnly="True" />
+ <DataGridTextColumn Header="Chapter Number" Width="120" Binding="{Binding ChapterNumber}" IsReadOnly="True" />
+ <DataGridTextColumn Header="Duration" Width="100" Binding="{Binding Duration}" IsReadOnly="True" />
<DataGridTextColumn Header="Chapter Name" Width="*" Binding="{Binding ChapterName}" IsReadOnly="False" />
</DataGrid.Columns>
</DataGrid>
|