summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs')
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs56
1 files changed, 33 insertions, 23 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
index 7557ed94f..b76592d9a 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
@@ -188,7 +188,16 @@ namespace HandBrake.Interop
this.StartScan(path, previewCount, minDuration, 0);
}
- public void StartScan(string path, int previewCount)
+ /// <summary>
+ /// The start scan.
+ /// </summary>
+ /// <param name="path">
+ /// The path.
+ /// </param>
+ /// <param name="previewCount">
+ /// The preview count.
+ /// </param>
+ public void StartScan(string path, int previewCount)
{
this.StartScan(path, previewCount, TimeSpan.FromSeconds(10), 0);
}
@@ -204,6 +213,29 @@ namespace HandBrake.Interop
this.StartScan(path, previewCount, TimeSpan.Zero, titleIndex);
}
+ /// <summary>
+ /// Starts a scan of the given path.
+ /// </summary>
+ /// <param name="path">The path of the video to scan.</param>
+ /// <param name="previewCount">The number of previews to make on each title.</param>
+ /// <param name="minDuration">The minimum duration of a title to show up on the scan.</param>
+ /// <param name="titleIndex">The title index to scan (1-based, 0 for all titles).</param>
+ public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)
+ {
+ this.previewCount = previewCount;
+ HBFunctions.hb_scan(this.hbHandle, path, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));
+ this.scanPollTimer = new System.Timers.Timer();
+ this.scanPollTimer.Interval = ScanPollIntervalMs;
+
+ // Lambda notation used to make sure we can view any JIT exceptions the method throws
+ this.scanPollTimer.Elapsed += (o, e) =>
+ {
+ this.PollScanProgress();
+ };
+ this.scanPollTimer.Start();
+ }
+
+
/// <summary>
/// Stops an ongoing scan.
/// </summary>
@@ -722,28 +754,6 @@ namespace HandBrake.Interop
}
/// <summary>
- /// Starts a scan of the given path.
- /// </summary>
- /// <param name="path">The path of the video to scan.</param>
- /// <param name="previewCount">The number of previews to make on each title.</param>
- /// <param name="minDuration">The minimum duration of a title to show up on the scan.</param>
- /// <param name="titleIndex">The title index to scan (1-based, 0 for all titles).</param>
- private void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)
- {
- this.previewCount = previewCount;
- HBFunctions.hb_scan(this.hbHandle, path, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));
- this.scanPollTimer = new System.Timers.Timer();
- this.scanPollTimer.Interval = ScanPollIntervalMs;
-
- // Lambda notation used to make sure we can view any JIT exceptions the method throws
- this.scanPollTimer.Elapsed += (o, e) =>
- {
- this.PollScanProgress();
- };
- this.scanPollTimer.Start();
- }
-
- /// <summary>
/// Checks the status of the ongoing scan.
/// </summary>
private void PollScanProgress()