diff options
author | sr55 <[email protected]> | 2007-08-29 17:14:42 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-08-29 17:14:42 +0000 |
commit | c2501467f65a24f2e098b0932da4908ae430ad3c (patch) | |
tree | 1cde86d069ec3123dc4f10b2b1c66f46e03ee1e2 /win/C#/Parsing/Title.cs | |
parent | 8d1c8819a2695068d7999e74368bdb4401827f05 (diff) |
WinGui:
- Gui debug more added to tools > options.
- More exception handling added
- frmReadDVD is now automatic. User no longer has to manually start scan process.
- Re-enabled onwindow scan status message. Removed Message box which alerts scan status.
- Few other small code tweaks.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@893 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Parsing/Title.cs')
-rw-r--r-- | win/C#/Parsing/Title.cs | 75 |
1 files changed, 64 insertions, 11 deletions
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index 1611f5c23..16c032edf 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -134,6 +134,14 @@ namespace Handbrake.Parsing this.m_duration.Minutes, this.m_duration.Seconds);
}
+
+ /*
+ *
+ * There is some pretty extensive exception handling in here. A number of people have been seeing random problems.
+ * It just helps pinpointing which line of code is causing the issue.
+ * Can be cut down at a later date.
+ *
+ */
public static Title Parse(StringReader output)
{
Title thisTitle = new Title();
@@ -145,15 +153,20 @@ namespace Handbrake.Parsing // Match track number for this title
if (m.Success)
{
- thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value);
+ //MessageBox.Show(m.Groups[1].Value);
+ thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());
+ //.Trim().ToString() Not sure why this is needed but some systems seem to get a rogue
}
- output.ReadLine();
- }
+ }
catch (Exception exc)
{
- MessageBox.Show("Title.cs - Track Number " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Track Number " + exc.ToString());
+ }
}
-
+
+ output.ReadLine();
// Get duration for this title
try
@@ -166,7 +179,10 @@ namespace Handbrake.Parsing }
catch (Exception exc)
{
- MessageBox.Show("Title.cs - Duration " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Duration " + exc.ToString());
+ }
}
try
@@ -182,7 +198,10 @@ namespace Handbrake.Parsing }
catch (Exception exc)
{
- MessageBox.Show("Title.cs - Resolution and Aspect " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Resolution and Aspect " + exc.ToString());
+ }
}
try
@@ -196,24 +215,55 @@ namespace Handbrake.Parsing }
catch (Exception exc)
{
- MessageBox.Show("Title.cs - Auto Crop " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Auto Crop " + exc.ToString());
+ }
}
try
{
thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
+ }
+ catch (Exception exc)
+ {
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Chapters EXC " + exc.ToString());
+ }
+ }
+
+ try
+ {
thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
+ }
+ catch (Exception exc)
+ {
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Audio EXC " + exc.ToString());
+ }
+ }
+
+ try
+ {
thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
}
catch (Exception exc)
{
- MessageBox.Show("Title.cs - Chapters / Audio / Subtitles " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Subtitles EXC " + exc.ToString());
+ }
}
}
catch (Exception exc)
{
- MessageBox.Show("Title.cs - Parse " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - Parse " + exc.ToString());
+ }
}
@@ -233,7 +283,10 @@ namespace Handbrake.Parsing }
catch (Exception exc)
{
- MessageBox.Show("Title.cs - ParseList " + exc.ToString());
+ if (Properties.Settings.Default.GuiDebug == "Checked")
+ {
+ MessageBox.Show("Title.cs - ParseList " + exc.ToString());
+ }
}
return titles.ToArray();
}
|