diff options
author | sr55 <[email protected]> | 2007-07-15 21:52:57 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-07-15 21:52:57 +0000 |
commit | 29036b449c87ca64e425e405fe81c450a65a081e (patch) | |
tree | 8d044a2609858ae2ea26ebf13bde3069d6205a26 /win/C#/Parsing/Title.cs | |
parent | e8c438e0573761f14af481d07615072babf94951 (diff) |
WinGui:
- Fixed Queue bug where it selecting the wrong item.
- changed Invalid chapter messagebox to onscreen text alert. (less irritating)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@692 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Parsing/Title.cs')
-rw-r--r-- | win/C#/Parsing/Title.cs | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index d1ccd8a04..245adfcdb 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -147,32 +147,39 @@ namespace Handbrake.Parsing * This will be converted to use Regex soon, I promise ;)
* brianmario - 7/9/07
*/
-
- string curLine = output.ReadLine();
- thisTitle.m_titleNumber = int.Parse(curLine.Substring(curLine.Length - 2, 1));
- curLine = output.ReadLine();
- string[] splitter = curLine.Split(',');
- //thisTitle.m_vts = int.Parse(splitter[0].Substring(8));
- //thisTitle.m_ttn = int.Parse(splitter[1].Substring(5));
- splitter = splitter[2].Trim().Split(' ', '(', ')');
- //thisTitle.m_blockCount = int.Parse(splitter[3]);
- splitter = splitter[1].Split('-', '>');
- //thisTitle.m_cellRange[0] = int.Parse(splitter[0]);
- //thisTitle.m_cellRange[1] = int.Parse(splitter[2]);
- curLine = output.ReadLine();
- splitter = curLine.Split(new string[] { " + duration: " }, StringSplitOptions.RemoveEmptyEntries);
- thisTitle.m_duration = TimeSpan.Parse(splitter[0]);
- curLine = output.ReadLine();
- splitter = curLine.Split(new string[] { " + size: ", "aspect: ", ", ", " fps", "x" }, StringSplitOptions.RemoveEmptyEntries);
- thisTitle.m_resolution = new Size(int.Parse(splitter[0]), int.Parse(splitter[1]));
- thisTitle.m_aspectRatio = float.Parse(splitter[2].ToString());
- //thisTitle.m_fps = float.Parse(splitter[3].ToString());
- curLine = output.ReadLine();
- splitter = curLine.Split(new string[] { " + autocrop: ", "/" }, StringSplitOptions.RemoveEmptyEntries);
- thisTitle.m_autoCrop = new int[4] { int.Parse(splitter[0]), int.Parse(splitter[1]), int.Parse(splitter[2]), int.Parse(splitter[3]) };
- thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
- thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
- thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
+ try
+ {
+ string curLine = output.ReadLine();
+ thisTitle.m_titleNumber = int.Parse(curLine.Substring(curLine.Length - 2, 1));
+ curLine = output.ReadLine();
+ string[] splitter = curLine.Split(',');
+ //thisTitle.m_vts = int.Parse(splitter[0].Substring(8));
+ //thisTitle.m_ttn = int.Parse(splitter[1].Substring(5));
+ splitter = splitter[2].Trim().Split(' ', '(', ')');
+ //thisTitle.m_blockCount = int.Parse(splitter[3]);
+ splitter = splitter[1].Split('-', '>');
+ //thisTitle.m_cellRange[0] = int.Parse(splitter[0]);
+ //thisTitle.m_cellRange[1] = int.Parse(splitter[2]);
+ curLine = output.ReadLine();
+ splitter = curLine.Split(new string[] { " + duration: " }, StringSplitOptions.RemoveEmptyEntries);
+ thisTitle.m_duration = TimeSpan.Parse(splitter[0]);
+ curLine = output.ReadLine();
+ splitter = curLine.Split(new string[] { " + size: ", "aspect: ", ", ", " fps", "x" }, StringSplitOptions.RemoveEmptyEntries);
+ thisTitle.m_resolution = new Size(int.Parse(splitter[0]), int.Parse(splitter[1]));
+ thisTitle.m_aspectRatio = float.Parse(splitter[2].ToString());
+ //thisTitle.m_fps = float.Parse(splitter[3].ToString());
+ curLine = output.ReadLine();
+ splitter = curLine.Split(new string[] { " + autocrop: ", "/" }, StringSplitOptions.RemoveEmptyEntries);
+ thisTitle.m_autoCrop = new int[4] { int.Parse(splitter[0]), int.Parse(splitter[1]), int.Parse(splitter[2]), int.Parse(splitter[3]) };
+ thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
+ thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
+ thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
+ }
+ catch (Exception)
+ {
+ // hbcli crashed caused an exception here. Just threw this in to prevent a program error.
+ // Can be debuged later.
+ }
return thisTitle;
}
|