From: sr55 Date: Tue, 16 Aug 2011 15:36:39 +0000 (+0000) Subject: WinGui: Add support for upcoming changes to CLI scan output showing bluray playlist... X-Git-Tag: 0.9.6~287 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=356f4d167d59fb486541c280867f1b27a7d05690;p=handbrake WinGui: Add support for upcoming changes to CLI scan output showing bluray playlist number. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4181 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs index ac8bcf6d3..1453889ed 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs @@ -11,9 +11,6 @@ namespace HandBrake.ApplicationServices.Parsing using System.IO; using System.Text.RegularExpressions; - using HandBrake.ApplicationServices.Model; - using HandBrake.ApplicationServices.Model.Encoding; - using HandBrake.ApplicationServices.Services; using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.Interop.Model; @@ -66,6 +63,11 @@ namespace HandBrake.ApplicationServices.Parsing /// public int TitleNumber { get; set; } + /// + /// Gets or sets Playlist. + /// + public string Playlist { get; set; } + /// /// Gets or sets the length in time of this Title /// @@ -150,6 +152,14 @@ namespace HandBrake.ApplicationServices.Parsing nextLine = output.ReadLine(); } + // Playlist + m = Regex.Match(nextLine, @"^ \+ playlist:"); + if (m.Success) + { + thisTitle.Playlist = nextLine.Replace("+ playlist:", string.Empty).Trim(); + nextLine = output.ReadLine(); + } + // Jump over the VTS and blocks line m = Regex.Match(nextLine, @"^ \+ vts:"); if (nextLine.Contains("blocks") || nextLine.Contains("+ vts ")) @@ -257,7 +267,12 @@ namespace HandBrake.ApplicationServices.Parsing /// A string representing this track in the format: {title #} (00:00:00) public override string ToString() { - return string.Format("{0} ({1:00}:{2:00}:{3:00})", TitleNumber, Duration.Hours, Duration.Minutes, Duration.Seconds); + if (!string.IsNullOrEmpty(this.Playlist)) + { + this.Playlist = string.Format(" {0}", this.Playlist); + } + + return string.Format("{0}{1} ({2:00}:{3:00}:{4:00})", TitleNumber, Playlist, Duration.Hours, Duration.Minutes, Duration.Seconds); } } } \ No newline at end of file