diff options
author | brianmario <[email protected]> | 2007-07-15 17:46:50 +0000 |
---|---|---|
committer | brianmario <[email protected]> | 2007-07-15 17:46:50 +0000 |
commit | c2162ba1f399eec309e12c328e82de32d81b856a (patch) | |
tree | 8fa2a8e6c4a6e556221cf0f09037ba5288daca15 /win/C#/frmMain.cs | |
parent | 33d6ae36a4859fbc46e730e4e7630acf2db264e1 (diff) |
updated some ToString overrides for proper use in the UI
small change to frmMain to allow for easier tracking of Handbrake CLI process (which we will code soon)
cleaned up function drop_chapterStart_SelectedIndexChanged
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@689 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r-- | win/C#/frmMain.cs | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 2e3912e6e..92c5301e7 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -14,6 +14,8 @@ namespace Handbrake {
public partial class frmMain : Form
{
+ System.Diagnostics.Process hbProc;
+
public frmMain()
{
InitializeComponent();
@@ -137,8 +139,8 @@ namespace Handbrake // Some windows that require only 1 instance.
// --------------------------------------------------------------
- private frmDvdInfo dvdInfoWindow = (frmDvdInfo)new frmDvdInfo();
- private frmQueue queueWindow = (frmQueue)new frmQueue();
+ private frmDvdInfo dvdInfoWindow = new frmDvdInfo();
+ private frmQueue queueWindow = new frmQueue();
// --------------------------------------------------------------
// The Menu Bar
@@ -595,7 +597,7 @@ namespace Handbrake query = QueryEditorText.Text;
}
- System.Diagnostics.Process hbProc = new System.Diagnostics.Process();
+ hbProc = new System.Diagnostics.Process();
hbProc.StartInfo.FileName = "hbcli.exe";
hbProc.StartInfo.Arguments = query;
hbProc.StartInfo.UseShellExecute = false;
@@ -624,17 +626,18 @@ namespace Handbrake hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;
break;
}
- MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- //hbProc.WaitForExit;
- //hbProc.Close;
+
ThreadPool.QueueUserWorkItem(procMonitor);
// TODO: Need to write a bit of code here to do process monitoring.
- // Note: hbProc.waitForExit will freeze the app, meaning one cannot add additional items to the queue during an encode.
}
private void procMonitor(object state)
{
- MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ hbProc.WaitForExit();
+ hbProc.Close();
+ hbProc.Dispose();
+ MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
@@ -979,6 +982,32 @@ namespace Handbrake // Otheriwse if its not, title data has to be loased from parsing.
if (drp_dvdtitle.Text != "Automatic")
{
+ Parsing.Title selectedTitle = drp_dvdtitle.SelectedItem as Parsing.Title;
+ lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();
+ lbl_RecomendedCrop.Text = string.Format("{0}/{1}/{2}/{3}", selectedTitle.AutoCropDimensions[0], selectedTitle.AutoCropDimensions[1], selectedTitle.AutoCropDimensions[2], selectedTitle.AutoCropDimensions[3]);
+
+ drop_chapterStart.Items.Clear();
+ drop_chapterStart.Items.AddRange(selectedTitle.Chapters.ToArray());
+ drop_chapterStart.Text = selectedTitle.Chapters[0].ToString();
+
+ drop_chapterFinish.Items.Clear();
+ drop_chapterFinish.Items.AddRange(selectedTitle.Chapters.ToArray());
+ drop_chapterFinish.Text = selectedTitle.Chapters[selectedTitle.Chapters.Count - 1].ToString();
+
+ drp_audioChannels.Items.Clear();
+ drp_audioChannels.Items.AddRange(selectedTitle.AudioTracks.ToArray());
+ if (drp_audioChannels.Items.Count > 0)
+ {
+ drp_audioChannels.Text = drp_audioChannels.Items[0].ToString();
+ }
+
+ drp_subtitle.Items.Clear();
+ drp_subtitle.Items.AddRange(selectedTitle.Subtitles.ToArray());
+ if (drp_subtitle.Items.Count > 0)
+ {
+ drp_subtitle.Text = drp_subtitle.Items[0].ToString();
+ }
+ /*
string[] temp;
string title;
temp = drp_dvdtitle.Text.Split(' ');
@@ -1032,7 +1061,7 @@ namespace Handbrake }
}
counter++;
- }
+ }*/
}
}
|