{\r
public partial class frmMain : Form\r
{\r
+ System.Diagnostics.Process hbProc;\r
+\r
public frmMain()\r
{\r
InitializeComponent();\r
// Some windows that require only 1 instance.\r
// --------------------------------------------------------------\r
\r
- private frmDvdInfo dvdInfoWindow = (frmDvdInfo)new frmDvdInfo();\r
- private frmQueue queueWindow = (frmQueue)new frmQueue();\r
+ private frmDvdInfo dvdInfoWindow = new frmDvdInfo();\r
+ private frmQueue queueWindow = new frmQueue();\r
\r
// --------------------------------------------------------------\r
// The Menu Bar\r
query = QueryEditorText.Text;\r
}\r
\r
- System.Diagnostics.Process hbProc = new System.Diagnostics.Process();\r
+ hbProc = new System.Diagnostics.Process();\r
hbProc.StartInfo.FileName = "hbcli.exe";\r
hbProc.StartInfo.Arguments = query;\r
hbProc.StartInfo.UseShellExecute = false;\r
hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;\r
break;\r
}\r
- MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
- //hbProc.WaitForExit;\r
- //hbProc.Close;\r
+\r
ThreadPool.QueueUserWorkItem(procMonitor);\r
// TODO: Need to write a bit of code here to do process monitoring.\r
- // Note: hbProc.waitForExit will freeze the app, meaning one cannot add additional items to the queue during an encode.\r
}\r
\r
private void procMonitor(object state)\r
{\r
- MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+ MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+ hbProc.WaitForExit();\r
+ hbProc.Close();\r
+ hbProc.Dispose();\r
+ MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
}\r
\r
\r
// Otheriwse if its not, title data has to be loased from parsing.\r
if (drp_dvdtitle.Text != "Automatic")\r
{\r
+ Parsing.Title selectedTitle = drp_dvdtitle.SelectedItem as Parsing.Title;\r
+ lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();\r
+ lbl_RecomendedCrop.Text = string.Format("{0}/{1}/{2}/{3}", selectedTitle.AutoCropDimensions[0], selectedTitle.AutoCropDimensions[1], selectedTitle.AutoCropDimensions[2], selectedTitle.AutoCropDimensions[3]);\r
+\r
+ drop_chapterStart.Items.Clear();\r
+ drop_chapterStart.Items.AddRange(selectedTitle.Chapters.ToArray());\r
+ drop_chapterStart.Text = selectedTitle.Chapters[0].ToString();\r
+\r
+ drop_chapterFinish.Items.Clear();\r
+ drop_chapterFinish.Items.AddRange(selectedTitle.Chapters.ToArray());\r
+ drop_chapterFinish.Text = selectedTitle.Chapters[selectedTitle.Chapters.Count - 1].ToString();\r
+\r
+ drp_audioChannels.Items.Clear();\r
+ drp_audioChannels.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
+ if (drp_audioChannels.Items.Count > 0)\r
+ {\r
+ drp_audioChannels.Text = drp_audioChannels.Items[0].ToString();\r
+ }\r
+\r
+ drp_subtitle.Items.Clear();\r
+ drp_subtitle.Items.AddRange(selectedTitle.Subtitles.ToArray());\r
+ if (drp_subtitle.Items.Count > 0)\r
+ {\r
+ drp_subtitle.Text = drp_subtitle.Items[0].ToString();\r
+ }\r
+ /*\r
string[] temp;\r
string title;\r
temp = drp_dvdtitle.Text.Split(' ');\r
} \r
}\r
counter++;\r
- }\r
+ }*/\r
}\r
} \r
\r