From f8e7adc789a0a426907bad279c0c6741da32aba5 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 24 Aug 2013 16:40:26 +0000 Subject: WinGui: Additional fixes to libhb logging, libdvdnav option and min duration setting. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5745 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrakeInterop/HandBrakeInstance.cs | 56 +++++++++++++--------- .../HandBrakeInterop/HbLib/HbFunctions.cs | 3 ++ .../Interfaces/IHandBrakeInstance.cs | 18 +++++++ 3 files changed, 54 insertions(+), 23 deletions(-) (limited to 'win/CS/HandBrake.Interop') 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) + /// + /// The start scan. + /// + /// + /// The path. + /// + /// + /// The preview count. + /// + 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); } + /// + /// Starts a scan of the given path. + /// + /// The path of the video to scan. + /// The number of previews to make on each title. + /// The minimum duration of a title to show up on the scan. + /// The title index to scan (1-based, 0 for all titles). + 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(); + } + + /// /// Stops an ongoing scan. /// @@ -721,28 +753,6 @@ namespace HandBrake.Interop return modulus * ((number + modulus / 2) / modulus); } - /// - /// Starts a scan of the given path. - /// - /// The path of the video to scan. - /// The number of previews to make on each title. - /// The minimum duration of a title to show up on the scan. - /// The title index to scan (1-based, 0 for all titles). - 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(); - } - /// /// Checks the status of the ongoing scan. /// diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index 861fdb82a..68f7d0177 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -400,5 +400,8 @@ namespace HandBrake.Interop.HbLib [DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)] public static extern int hb_qsv_available(); + + [DllImport("hb.dll", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_qsv_info_init(); } } diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs index 1b0f8b354..874fd1e23 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Interfaces/IHandBrakeInstance.cs @@ -212,6 +212,24 @@ namespace HandBrake.Interop.Interfaces /// void StartScan(string path, int previewCount, int titleIndex); + + /// + /// Starts a scan of the given path. + /// + /// + /// The path of the video to scan. + /// + /// + /// The number of previews to make on each title. + /// + /// + /// The min Duration. + /// + /// + /// The title index to scan (1-based, 0 for all titles). + /// + void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex); + /// /// Stops the current encode. /// -- cgit v1.2.3