summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-12-22 17:05:20 +0000
committersr55 <[email protected]>2013-12-22 17:05:20 +0000
commit9eee8673822bea969bdf205e0c2d3d6d9a0c18a6 (patch)
treed64fd2fce642cada85cc0038c7ca6255cf713f9f
parent164190053ac8ef37f98e944ae7f9368e8ae5279a (diff)
WinGui: Add support for passing through chapter names.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5939 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs3
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs3
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs5
3 files changed, 9 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
index 24c364024..7831f6bb2 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
@@ -460,7 +460,8 @@ namespace HandBrake.ApplicationServices.Services
foreach (Interop.SourceData.Chapter chapter in title.Chapters)
{
- converted.Chapters.Add(new Chapter(chapter.ChapterNumber, string.Empty, chapter.Duration));
+ string chapterName = !string.IsNullOrEmpty(chapter.Name) ? chapter.Name : string.Empty;
+ converted.Chapters.Add(new Chapter(chapter.ChapterNumber, chapterName, chapter.Duration));
}
foreach (Interop.SourceData.AudioTrack track in title.AudioTracks)
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
index af3a56ee4..494a8d717 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
@@ -1892,9 +1892,10 @@ namespace HandBrake.Interop
List<hb_chapter_s> chapterList = title.list_chapter.ToList<hb_chapter_s>();
foreach (hb_chapter_s chapter in chapterList)
- {
+ {
var newChapter = new Chapter
{
+ Name = chapter.title,
ChapterNumber = chapter.index,
Duration = Converters.PtsToTimeSpan(chapter.duration),
DurationPts = chapter.duration
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs
index 411a8d851..25d5b811b 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs
@@ -17,6 +17,11 @@ namespace HandBrake.Interop.SourceData
/// </summary>
public class Chapter
{
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ public string Name { get; set; }
+
/// <summary>
/// Gets or sets the number of this Chapter, in regards to its parent Title
/// </summary>