OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Parsing / Title.cs
index 8073606..1a98a58 100644 (file)
@@ -22,12 +22,14 @@ namespace Handbrake.Parsing
         private readonly List<AudioTrack> m_audioTracks;\r
         private readonly List<Chapter> m_chapters;\r
         private readonly List<Subtitle> m_subtitles;\r
+        private List<String> m_angles = new List<string>();\r
         private float m_aspectRatio;\r
         private int[] m_autoCrop;\r
         private TimeSpan m_duration;\r
         private Size m_resolution;\r
         private int m_titleNumber;\r
-\r
+        private Size m_parVal;\r
+        \r
         /// <summary>\r
         /// The constructor for this object\r
         /// </summary>\r
@@ -95,6 +97,14 @@ namespace Handbrake.Parsing
         }\r
 \r
         /// <summary>\r
+        /// Par Value\r
+        /// </summary>\r
+        public Size ParVal\r
+        {\r
+            get { return m_parVal; }\r
+        }\r
+\r
+        /// <summary>\r
         /// The automatically detected crop region for this Title.\r
         /// This is an int array with 4 items in it as so:\r
         /// 0: \r
@@ -108,6 +118,14 @@ namespace Handbrake.Parsing
         }\r
 \r
         /// <summary>\r
+        /// Collection of Angles in this Title\r
+        /// </summary>\r
+        public List<string> Angles\r
+        {\r
+            get { return m_angles; }\r
+        }\r
+  \r
+        /// <summary>\r
         /// Override of the ToString method to provide an easy way to use this object in the UI\r
         /// </summary>\r
         /// <returns>A string representing this track in the format: {title #} (00:00:00)</returns>\r
@@ -128,19 +146,40 @@ namespace Handbrake.Parsing
 \r
             output.ReadLine();\r
 \r
-            // Get duration for this title\r
+            if (!Properties.Settings.Default.noDvdNav)\r
+            {\r
+                // Get the Angles for the title.\r
+                m = Regex.Match(output.ReadLine(), @"  \+ angle\(s\) ([0-9,])");\r
+                if (m.Success)\r
+                {\r
+                    String angleList = m.Value.Replace("+ angle(s) ", "").Trim();\r
+\r
+                    if (angleList.Contains(","))\r
+                    {\r
+                        string[] angles = angleList.Split(',');\r
+                        foreach (string s in angles)\r
+                            thisTitle.m_angles.Add(s);\r
+                    }\r
+                    else\r
+                        thisTitle.m_angles.Add(m.Value.Replace("+ angle(s) ", "").Trim());\r
+                }\r
+            }\r
 \r
+            // Get duration for this title\r
             m = Regex.Match(output.ReadLine(), @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
             if (m.Success)\r
                 thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);\r
 \r
             // Get resolution, aspect ratio and FPS for this title\r
             m = Regex.Match(output.ReadLine(),\r
-                            @"^  \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
+                            @"^  \+ size: ([0-9]*)x([0-9]*), pixel aspect: ([0-9]*)/([0-9]*), display aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
+            //size: 720x576, pixel aspect: 16/15, display aspect: 1.33, 25.000 fps\r
+\r
             if (m.Success)\r
             {\r
                 thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
-                thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Culture);\r
+                thisTitle.m_parVal = new Size(int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value));\r
+                thisTitle.m_aspectRatio = float.Parse(m.Groups[5].Value, Culture);\r
             }\r
 \r
             // Get autocrop region for this title\r