]> granicus.if.org Git - handbrake/commitdiff
WinGui: Add support for upcoming changes to CLI scan output showing bluray playlist...
authorsr55 <sr55.hb@outlook.com>
Tue, 16 Aug 2011 15:36:39 +0000 (15:36 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 16 Aug 2011 15:36:39 +0000 (15:36 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4181 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Parsing/Title.cs

index ac8bcf6d3d17d7876eb29267f5f298a6b4396735..1453889edfaade25123c6d3dd117d6fa1e215e3f 100644 (file)
@@ -11,9 +11,6 @@ namespace HandBrake.ApplicationServices.Parsing
     using System.IO;\r
     using System.Text.RegularExpressions;\r
 \r
-    using HandBrake.ApplicationServices.Model;\r
-    using HandBrake.ApplicationServices.Model.Encoding;\r
-    using HandBrake.ApplicationServices.Services;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
     using HandBrake.Interop.Model;\r
 \r
@@ -66,6 +63,11 @@ namespace HandBrake.ApplicationServices.Parsing
         /// </summary>\r
         public int TitleNumber { get; set; }\r
 \r
+        /// <summary>\r
+        /// Gets or sets Playlist.\r
+        /// </summary>\r
+        public string Playlist { get; set; }\r
+\r
         /// <summary>\r
         /// Gets or sets the length in time of this Title\r
         /// </summary>\r
@@ -150,6 +152,14 @@ namespace HandBrake.ApplicationServices.Parsing
                 nextLine = output.ReadLine();\r
             }\r
 \r
+            // Playlist\r
+            m = Regex.Match(nextLine, @"^  \+ playlist:");\r
+            if (m.Success)\r
+            {\r
+                thisTitle.Playlist = nextLine.Replace("+ playlist:", string.Empty).Trim();\r
+                nextLine = output.ReadLine();\r
+            }\r
+\r
             // Jump over the VTS and blocks line\r
             m = Regex.Match(nextLine, @"^  \+ vts:");\r
             if (nextLine.Contains("blocks") || nextLine.Contains("+ vts "))\r
@@ -257,7 +267,12 @@ namespace HandBrake.ApplicationServices.Parsing
         /// <returns>A string representing this track in the format: {title #} (00:00:00)</returns>\r
         public override string ToString()\r
         {\r
-            return string.Format("{0} ({1:00}:{2:00}:{3:00})", TitleNumber, Duration.Hours, Duration.Minutes, Duration.Seconds);\r
+            if (!string.IsNullOrEmpty(this.Playlist))\r
+            {\r
+                this.Playlist = string.Format(" {0}", this.Playlist);\r
+            }\r
+\r
+            return string.Format("{0}{1} ({2:00}:{3:00}:{4:00})", TitleNumber, Playlist, Duration.Hours, Duration.Minutes, Duration.Seconds);\r
         }\r
     }\r
 }
\ No newline at end of file