* This will be converted to use Regex soon, I promise ;)\r
* brianmario - 7/9/07\r
*/\r
-\r
- string curLine = output.ReadLine();\r
- thisTitle.m_titleNumber = int.Parse(curLine.Substring(curLine.Length - 2, 1));\r
- curLine = output.ReadLine();\r
- string[] splitter = curLine.Split(',');\r
- //thisTitle.m_vts = int.Parse(splitter[0].Substring(8));\r
- //thisTitle.m_ttn = int.Parse(splitter[1].Substring(5));\r
- splitter = splitter[2].Trim().Split(' ', '(', ')');\r
- //thisTitle.m_blockCount = int.Parse(splitter[3]);\r
- splitter = splitter[1].Split('-', '>');\r
- //thisTitle.m_cellRange[0] = int.Parse(splitter[0]);\r
- //thisTitle.m_cellRange[1] = int.Parse(splitter[2]);\r
- curLine = output.ReadLine();\r
- splitter = curLine.Split(new string[] { " + duration: " }, StringSplitOptions.RemoveEmptyEntries);\r
- thisTitle.m_duration = TimeSpan.Parse(splitter[0]);\r
- curLine = output.ReadLine();\r
- splitter = curLine.Split(new string[] { " + size: ", "aspect: ", ", ", " fps", "x" }, StringSplitOptions.RemoveEmptyEntries);\r
- thisTitle.m_resolution = new Size(int.Parse(splitter[0]), int.Parse(splitter[1]));\r
- thisTitle.m_aspectRatio = float.Parse(splitter[2].ToString());\r
- //thisTitle.m_fps = float.Parse(splitter[3].ToString());\r
- curLine = output.ReadLine();\r
- splitter = curLine.Split(new string[] { " + autocrop: ", "/" }, StringSplitOptions.RemoveEmptyEntries);\r
- thisTitle.m_autoCrop = new int[4] { int.Parse(splitter[0]), int.Parse(splitter[1]), int.Parse(splitter[2]), int.Parse(splitter[3]) };\r
- thisTitle.m_chapters.AddRange(Chapter.ParseList(output));\r
- thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));\r
- thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));\r
+ try\r
+ {\r
+ string curLine = output.ReadLine();\r
+ thisTitle.m_titleNumber = int.Parse(curLine.Substring(curLine.Length - 2, 1));\r
+ curLine = output.ReadLine();\r
+ string[] splitter = curLine.Split(',');\r
+ //thisTitle.m_vts = int.Parse(splitter[0].Substring(8));\r
+ //thisTitle.m_ttn = int.Parse(splitter[1].Substring(5));\r
+ splitter = splitter[2].Trim().Split(' ', '(', ')');\r
+ //thisTitle.m_blockCount = int.Parse(splitter[3]);\r
+ splitter = splitter[1].Split('-', '>');\r
+ //thisTitle.m_cellRange[0] = int.Parse(splitter[0]);\r
+ //thisTitle.m_cellRange[1] = int.Parse(splitter[2]);\r
+ curLine = output.ReadLine();\r
+ splitter = curLine.Split(new string[] { " + duration: " }, StringSplitOptions.RemoveEmptyEntries);\r
+ thisTitle.m_duration = TimeSpan.Parse(splitter[0]);\r
+ curLine = output.ReadLine();\r
+ splitter = curLine.Split(new string[] { " + size: ", "aspect: ", ", ", " fps", "x" }, StringSplitOptions.RemoveEmptyEntries);\r
+ thisTitle.m_resolution = new Size(int.Parse(splitter[0]), int.Parse(splitter[1]));\r
+ thisTitle.m_aspectRatio = float.Parse(splitter[2].ToString());\r
+ //thisTitle.m_fps = float.Parse(splitter[3].ToString());\r
+ curLine = output.ReadLine();\r
+ splitter = curLine.Split(new string[] { " + autocrop: ", "/" }, StringSplitOptions.RemoveEmptyEntries);\r
+ thisTitle.m_autoCrop = new int[4] { int.Parse(splitter[0]), int.Parse(splitter[1]), int.Parse(splitter[2]), int.Parse(splitter[3]) };\r
+ thisTitle.m_chapters.AddRange(Chapter.ParseList(output));\r
+ thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));\r
+ thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));\r
+ }\r
+ catch (Exception)\r
+ {\r
+ // hbcli crashed caused an exception here. Just threw this in to prevent a program error.\r
+ // Can be debuged later.\r
+ }\r
\r
return thisTitle;\r
}\r
this.btn_queue = new System.Windows.Forms.Button();\r
this.btn_encode = new System.Windows.Forms.Button();\r
this.Version = new System.Windows.Forms.Label();\r
+ this.lbl_chptWarn = new System.Windows.Forms.Label();\r
Label38 = new System.Windows.Forms.Label();\r
this.frmMainMenu.SuspendLayout();\r
this.GroupBox1.SuspendLayout();\r
// DVD_Save\r
// \r
this.DVD_Save.DefaultExt = "mp4";\r
- this.DVD_Save.Filter = "mp4|*.mp4 |m4v|*.m4v |avi|*.avi |ogm|*.ogm";\r
+ this.DVD_Save.Filter = "mp4|*.mp4 |m4v|*.m4v |avi|*.avi |ogm|*.ogm |mkv|*.mkv";\r
// \r
// File_Save\r
// \r
// GroupBox1\r
// \r
this.GroupBox1.BackColor = System.Drawing.SystemColors.Control;\r
+ this.GroupBox1.Controls.Add(this.lbl_chptWarn);\r
this.GroupBox1.Controls.Add(this.Label13);\r
this.GroupBox1.Controls.Add(this.drop_chapterFinish);\r
this.GroupBox1.Controls.Add(this.drop_chapterStart);\r
this.Version.TabIndex = 415;\r
this.Version.Text = "Version 2.3";\r
// \r
+ // lbl_chptWarn\r
+ // \r
+ this.lbl_chptWarn.AutoSize = true;\r
+ this.lbl_chptWarn.Location = new System.Drawing.Point(287, 85);\r
+ this.lbl_chptWarn.Name = "lbl_chptWarn";\r
+ this.lbl_chptWarn.Size = new System.Drawing.Size(77, 13);\r
+ this.lbl_chptWarn.TabIndex = 43;\r
+ this.lbl_chptWarn.Text = "{Warning}";\r
+ this.lbl_chptWarn.Visible = false;\r
+ // \r
// frmMain\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
internal System.Windows.Forms.Button btn_queue;\r
internal System.Windows.Forms.Button btn_encode;\r
internal System.Windows.Forms.Label Version;\r
+ private System.Windows.Forms.Label lbl_chptWarn;\r
\r
}\r
}
\ No newline at end of file
}\r
\r
#region The Menu Bar\r
-\r
#region File Menu\r
\r
private void mnu_open_Click(object sender, EventArgs e)\r
}\r
\r
#endregion\r
-\r
#endregion\r
\r
// -------------------------------------------------------------- \r
\r
private void drop_chapterStart_SelectedIndexChanged(object sender, EventArgs e)\r
{\r
+ lbl_chptWarn.Visible = false;\r
QueryEditorText.Text = "";\r
if ((drop_chapterFinish.Text != "Auto") && (drop_chapterStart.Text != "Auto"))\r
{\r
\r
if (chapterFinish < chapterStart)\r
{\r
- MessageBox.Show("Invalid Chapter Range! - Final chapter can not be smaller than the starting chapter.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ lbl_chptWarn.Visible = true;\r
+ lbl_chptWarn.Text = "Invalid Chapter Range!";\r
}\r
}\r
catch (Exception)\r
{\r
- MessageBox.Show("Invalid Character Entered!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+ lbl_chptWarn.Visible = true;\r
+ lbl_chptWarn.Text = "Invalid Chapter Range!";\r
}\r
}\r
\r
\r
private void drop_chapterFinish_SelectedIndexChanged(object sender, EventArgs e)\r
{\r
+ lbl_chptWarn.Visible = false;\r
QueryEditorText.Text = "";\r
if ((drop_chapterFinish.Text != "Auto") && (drop_chapterStart.Text != "Auto"))\r
{\r
\r
if (chapterFinish < chapterStart)\r
{\r
- MessageBox.Show("Invalid Chapter Range! - Start chapter can not be larger than the Final chapter.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ lbl_chptWarn.Visible = true;\r
+ lbl_chptWarn.Text = "Invalid Chapter Range!";\r
}\r
}\r
catch (Exception)\r
{\r
- MessageBox.Show("Invalid Character Entered!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+ lbl_chptWarn.Visible = true;\r
+ lbl_chptWarn.Text = "Invalid Chapter Range!";\r
}\r
}\r
}\r
}\r
} \r
\r
- /// <summary>\r
- /// The Query Generation Function\r
- /// This function was imported from old vb.net version of this application.\r
- /// It could probably do with being cleaned up a good deal at some point\r
- /// </summary>\r
- /// <returns></returns>\r
+ // The Query Generation Function\r
+ // This function was imported from old vb.net version of this application.\r
+ // It could probably do with being cleaned up a good deal at some point\r
+ \r
public string GenerateTheQuery()\r
{\r
string source = text_source.Text;\r
\r
private void startProc(object state)\r
{\r
+ // Reminder: There is still a bug here where the loop suddenly halts for no good reson. UpdateUIelements runs, then the loop finishes several items early.\r
for (int i = 0; i < list_queue.Items.Count; i++)\r
{\r
- string query = list_queue.Items[i] as string;\r
+ string query = list_queue.Items[0] as string;\r
Process hbProc = new Process();\r
hbProc.StartInfo.FileName = "hbcli.exe";\r
hbProc.StartInfo.Arguments = query;\r
\r
hbProc.WaitForExit();\r
hbProc.Close();\r
+ hbProc.Dispose();\r
+ \r
\r
updateUIElements();\r
}\r
this.BeginInvoke(new ProgressUpdateHandler(updateUIElements));\r
return;\r
}\r
-\r
this.list_queue.Items.RemoveAt(0);\r
progressBar.PerformStep();\r
lbl_progressValue.Text = string.Format("{0} %", progressBar.Value);\r