summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
authorScott <[email protected]>2015-10-31 17:35:56 +0000
committerScott <[email protected]>2015-10-31 17:35:56 +0000
commit19f3dc6e8f6f8ee25ef99526276d400753aaa0a7 (patch)
tree80e216247b44208312ba71539b68265fe0957e30 /win/CS/HandBrake.ApplicationServices
parent57902b23cd4a70505fdcf4361787150679a5e58e (diff)
Allow the preview encode to run at the same time as an actual encode.
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs25
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