summaryrefslogtreecommitdiffstats
path: root/win/C#/frmReadDVD.cs
diff options
context:
space:
mode:
authorbrianmario <[email protected]>2007-07-18 19:24:04 +0000
committerbrianmario <[email protected]>2007-07-18 19:24:04 +0000
commita86e63089a22839b51890db36481c88e25a0a0c6 (patch)
tree837935de2c825a1b47bb8dae89cfaa2f34ddda11 /win/C#/frmReadDVD.cs
parentcdac5d3a33743512011783afc9dd7f90c4f3a762 (diff)
WinGui:
added OnScanProgress event to Parser class which is raised upon noticing "Scanning title # of #..." in the output added progress bar to frmReadDVD to give better visual notification of scan progress git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@711 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmReadDVD.cs')
-rw-r--r--win/C#/frmReadDVD.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/win/C#/frmReadDVD.cs b/win/C#/frmReadDVD.cs
index 2958bdf65..eaecf823f 100644
--- a/win/C#/frmReadDVD.cs
+++ b/win/C#/frmReadDVD.cs
@@ -27,13 +27,15 @@ namespace Handbrake
this.inputFile = inputFile;
this.mainWindow = parent;
this.dvdInfo = dvdInfoWindow;
+ Parsing.Parser.OnScanProgress += Parser_OnScanProgress;
}
private void btn_ok_Click(object sender, EventArgs e)
{
- lbl_status.Visible = true;
btn_ok.Enabled = false;
lbl_pressOk.Visible = false;
+ scanProgress.Value = 0;
+ scanProgress.Visible = true;
// throw cli call and parsing on it's own thread
ThreadPool.QueueUserWorkItem(startProc);
}
@@ -71,5 +73,15 @@ namespace Handbrake
updateUIElements();
}
+ private void Parser_OnScanProgress(object Sender, int CurrentTitle, int TitleCount)
+ {
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new Parsing.ScanProgressEventHandler(Parser_OnScanProgress), new object[] { Sender, CurrentTitle, TitleCount });
+ return;
+ }
+ this.scanProgress.Value = Convert.ToInt32(Convert.ToDouble(CurrentTitle) / Convert.ToDouble(TitleCount) * 100) + 1;
+ }
+
}
} \ No newline at end of file