this.m_duration.Minutes, this.m_duration.Seconds);\r
}\r
\r
-\r
- /*\r
- * \r
- * There is some pretty extensive exception handling in here. A number of people have been seeing random problems.\r
- * It just helps pinpointing which line of code is causing the issue.\r
- * Can be cut down at a later date.\r
- * \r
- */\r
public static Title Parse(StringReader output)\r
{\r
Title thisTitle = new Title();\r
try\r
{\r
Match m = Regex.Match(output.ReadLine(), @"^\+ title ([0-9]*):");\r
- try\r
- {\r
- // Match track number for this title\r
- if (m.Success)\r
- thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("Title.cs - Track Number " + exc.ToString());\r
- }\r
+ // Match track number for this title\r
+ if (m.Success)\r
+ thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());\r
\r
output.ReadLine();\r
\r
// Get duration for this title\r
- try\r
- {\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
- catch (Exception exc)\r
- {\r
- MessageBox.Show("Title.cs - Duration " + exc.ToString());\r
- }\r
\r
- try\r
- {\r
- // Get resolution, aspect ratio and FPS for this title\r
- m = Regex.Match(output.ReadLine(), @"^ \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\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, Functions.CLI.Culture);\r
- }\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("Title.cs - Resolution and Aspect " + exc.ToString());\r
- }\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
- try\r
- {\r
- // Get autocrop region for this title\r
- m = Regex.Match(output.ReadLine(), @"^ \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");\r
- if (m.Success)\r
- thisTitle.m_autoCrop = new int[4] { int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value) };\r
- }\r
- catch (Exception exc)\r
+ // Get resolution, aspect ratio and FPS for this title\r
+ m = Regex.Match(output.ReadLine(), @"^ \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
+ if (m.Success)\r
{\r
- MessageBox.Show("Title.cs - Auto Crop " + exc.ToString());\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, Functions.CLI.Culture);\r
}\r
\r
+ // Get autocrop region for this title\r
+ m = Regex.Match(output.ReadLine(), @"^ \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");\r
+ if (m.Success)\r
+ thisTitle.m_autoCrop = new int[4] { int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value) };\r
\r
- try\r
- {\r
- thisTitle.m_chapters.AddRange(Chapter.ParseList(output));\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("Title.cs - Chapters EXC " + exc.ToString());\r
- }\r
+ thisTitle.m_chapters.AddRange(Chapter.ParseList(output));\r
\r
- try\r
- {\r
- thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("Title.cs - Audio EXC " + exc.ToString());\r
- }\r
+ thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));\r
\r
- try\r
- {\r
- thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("Title.cs - Subtitles EXC " + exc.ToString());\r
- }\r
+ thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));\r
}\r
catch (Exception exc)\r
{\r
MessageBox.Show("Title.cs - Parse " + exc.ToString());\r
}\r
\r
-\r
return thisTitle;\r
}\r
\r