diff options
author | sr55 <[email protected]> | 2013-03-09 22:32:07 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-03-09 22:32:07 +0000 |
commit | e6bbf3b9ecfd237eec98bd2711800f267ee9ddb1 (patch) | |
tree | ca11f6a3df993dd40d8c247d7c8ee5640ca2bc91 /win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs | |
parent | e318631790e818539c917f567cc39babe5def745 (diff) |
Merging Trunk to OpenCL branch
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5319 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Parsing/Parser.cs')
-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..7cb7100fc 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, CultureInfo.InvariantCulture));
return tmp;
}
|