diff options
author | sr55 <[email protected]> | 2013-03-02 19:38:24 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-03-02 19:38:24 +0000 |
commit | 76d7ab1861dbc85eb3e8ad35d365a35b4b681a96 (patch) | |
tree | 4c56986f82d4336cce37960fc8be15969bb576d0 /win/CS/HandBrake.ApplicationServices/Parsing | |
parent | 09843340c7c998e360bcc879674c0646f379077d (diff) |
WinGui: Update the scan parser to handle the new scan progress meter.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5283 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Parsing')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs index f17a6a51b..82b339278 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs @@ -28,7 +28,8 @@ namespace HandBrake.ApplicationServices.Parsing /// <param name="sender">The object who's raising the event</param>
/// <param name="currentTitle">The title number currently being processed</param>
/// <param name="titleCount">The total number of titiles to be processed</param>
- public delegate void ScanProgressEventHandler(object sender, int currentTitle, int titleCount);
+ /// <param name="percentage">Percentage complete.</param>
+ public delegate void ScanProgressEventHandler(object sender, int currentTitle, int titleCount, decimal percentage);
/// <summary>
/// A delegate to handle encode progress updates // EXPERIMENTAL
@@ -97,18 +98,18 @@ namespace HandBrake.ApplicationServices.Parsing {
string tmp = base.ReadLine();
- buffer.Append(tmp + Environment.NewLine);
-
Match m = null;
- if (tmp.Contains("Scanning title"))
- m = Regex.Match(tmp, "^Scanning title ([0-9]*) of ([0-9]*)");
+ if (tmp != null && tmp.Contains("Scanning title"))
+ m = Regex.Match(tmp, "^Scanning title ([0-9]*) of ([0-9]*)([a-z0-9 ,]*), ([0-9.]*)");
+ else if (!string.IsNullOrEmpty(tmp))
+ buffer.Append(tmp + Environment.NewLine);
if (OnReadLine != null)
OnReadLine(this, tmp);
if (m != null)
if (m.Success && OnScanProgress != null)
- OnScanProgress(this, int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
+ OnScanProgress(this, int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), decimal.Parse(m.Groups[4].Value));
return tmp;
}
|