diff options
author | Scott <[email protected]> | 2015-10-31 17:35:56 +0000 |
---|---|---|
committer | Scott <[email protected]> | 2015-10-31 17:35:56 +0000 |
commit | 19f3dc6e8f6f8ee25ef99526276d400753aaa0a7 (patch) | |
tree | 80e216247b44208312ba71539b68265fe0957e30 /win/CS/HandBrake.ApplicationServices/Interop | |
parent | 57902b23cd4a70505fdcf4361787150679a5e58e (diff) |
Allow the preview encode to run at the same time as an actual encode.
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs | 25 |
2 files changed, 26 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs index a862dc1e6..ca1a8367b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs @@ -43,7 +43,7 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// A wrapper for a HandBrake instance.
/// </summary>
- public class HandBrakeInstance : IHandBrakeInstance, IDisposable
+ public class HandBrakeInstance : IHandBrakeInstance, IDisposable
{
/// <summary>
/// The number of MS between status polls when scanning.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs index a74513f4a..5ceb70bdc 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs @@ -21,6 +21,7 @@ namespace HandBrake.ApplicationServices.Interop {
private static HandBrakeInstance scanInstance;
private static HandBrakeInstance encodeInstance;
+ private static HandBrakeInstance previewInstance;
private static HandBrakeInstance masterInstance;
/// <summary>
@@ -89,6 +90,30 @@ namespace HandBrake.ApplicationServices.Interop }
/// <summary>
+ /// The get encode instance.
+ /// </summary>
+ /// <param name="verbosity">
+ /// The verbosity.
+ /// </param>
+ /// <returns>
+ /// The <see cref="IHandBrakeInstance"/>.
+ /// </returns>
+ public static IHandBrakeInstance GetPreviewInstance(int verbosity)
+ {
+ if (previewInstance != null)
+ {
+ previewInstance.Dispose();
+ previewInstance = null;
+ }
+
+ HandBrakeInstance newInstance = new HandBrakeInstance();
+ newInstance.Initialize(verbosity);
+ previewInstance = newInstance;
+
+ return previewInstance;
+ }
+
+ /// <summary>
/// Gets the master instance.
/// </summary>
internal static IHandBrakeInstance MasterInstance
|