OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Parsing / DVD.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.IO;\r
5 using System.Windows.Forms;\r
6 \r
7 \r
8 namespace Handbrake.Parsing\r
9 {\r
10     /// <summary>\r
11     /// An object representing a scanned DVD\r
12     /// </summary>\r
13     public class DVD\r
14     {\r
15         private List<Title> m_titles;\r
16         /// <summary>\r
17         /// Collection of Titles associated with this DVD\r
18         /// </summary>\r
19         public List<Title> Titles\r
20         {\r
21             get\r
22             {\r
23                 return this.m_titles;\r
24             }\r
25         }\r
26 \r
27         /// <summary>\r
28         /// Default constructor for this object\r
29         /// </summary>\r
30         public DVD()\r
31         {\r
32             this.m_titles = new List<Title>();\r
33         }\r
34 \r
35         public static DVD Parse(StreamReader output)\r
36         {\r
37             DVD thisDVD = new DVD();\r
38             while (!output.EndOfStream)\r
39             {\r
40                 string curLine = output.ReadLine();\r
41 \r
42                 if (curLine.Contains("Scanning title"))\r
43                 {\r
44                     thisDVD.m_titles.AddRange(Title.ParseList(output));\r
45                 }\r
46             }\r
47             return thisDVD;\r
48         }\r
49     }\r
50 }\r