2 using System.Collections.Generic;
\r
6 namespace Handbrake.Parsing
\r
10 private int m_chapterNumber;
\r
11 public int ChapterNumber
\r
15 return this.m_chapterNumber;
\r
19 /*private int[] m_cellRange;
\r
20 public int[] CellRange
\r
24 return this.m_cellRange;
\r
28 private int m_blocks;
\r
29 public int BlockCount
\r
33 return this.m_blocks;
\r
37 private TimeSpan m_duration;
\r
38 public TimeSpan Duration
\r
42 return this.m_duration;
\r
46 public static Chapter Parse(StreamReader output)
\r
48 string curLine = output.ReadLine();
\r
49 if (!curLine.Contains(" + audio tracks:"))
\r
51 Chapter thisChapter = new Chapter();
\r
52 string[] splitter = curLine.Split(new string[] { " + ", ": cells ", ", ", " blocks, duration ", "->" }, StringSplitOptions.RemoveEmptyEntries);
\r
53 thisChapter.m_chapterNumber = int.Parse(splitter[0]);
\r
54 //thisChapter.m_cellRange = new int[2] { int.Parse(splitter[1]), int.Parse(splitter[2]) };
\r
55 //thisChapter.m_blocks = int.Parse(splitter[3]);
\r
56 thisChapter.m_duration = TimeSpan.Parse(splitter[4]);
\r
65 public static Chapter[] ParseList(StreamReader output)
\r
67 List<Chapter> chapters = new List<Chapter>();
\r
68 string curLine = output.ReadLine();
\r
69 while (!curLine.Contains(" + audio tracks:"))
\r
71 Chapter thisChapter = Chapter.Parse(output);
\r
72 if (thisChapter != null)
\r
74 chapters.Add(thisChapter);
\r
81 return chapters.ToArray();
\r