summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-08-22 16:45:03 +0000
committersr55 <[email protected]>2013-08-22 16:45:03 +0000
commit88cfc4524c3bb09c1316219c1f83517b35697736 (patch)
tree8b61d93332e725d4db321544bf88256fab3ec14b /win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs
parentedc9bf98907f9f794443facc7ce9072ee27af08c (diff)
WinGui: Use LibHB for scanning. CLI is no longer used. It seems to be stable enough now and it's quite a bit quicker at scanning. Encode is still optionally libhb.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5731 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs')
-rw-r--r--win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs40
1 files changed, 3 insertions, 37 deletions
diff --git a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs
index f66aff538..2dbc7d959 100644
--- a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs
+++ b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs
@@ -13,8 +13,6 @@ namespace HandBrakeWPF.Services
{
using System;
- using HandBrake.ApplicationServices.Exceptions;
- using HandBrake.ApplicationServices.Isolation;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -47,42 +45,10 @@ namespace HandBrakeWPF.Services
/// <summary>
/// Initializes a new instance of the <see cref="ScanServiceWrapper"/> class.
/// </summary>
- /// <param name="userSettingService">
- /// The user setting service.
- /// </param>
- public ScanServiceWrapper(IUserSettingService userSettingService)
+ public ScanServiceWrapper()
{
- var useLibHb = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);
- var useProcessIsolation =
- userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
- string port = userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort);
-
- if (useLibHb)
- {
- try
- {
- if (useProcessIsolation)
- {
- this.scanService = new IsolatedScanService(port);
- }
- else
- {
- HandbrakeInstance = new HandBrakeInstance();
- this.scanService = new LibScan(HandbrakeInstance);
- }
- }
- catch(Exception exc)
- {
- // Try to recover from errors.
- userSettingService.SetUserSetting(UserSettingConstants.EnableLibHb, false);
- throw new GeneralApplicationException("Unable to initialise LibHB or Background worker service", "Falling back to using HandBrakeCLI.exe. Setting has been reset", exc);
- }
- }
- else
- {
- this.scanService = new ScanService(userSettingService);
- }
-
+ HandbrakeInstance = new HandBrakeInstance();
+ this.scanService = new LibScan(HandbrakeInstance);
this.scanService.ScanCompleted += this.ScanServiceScanCompleted;
this.scanService.ScanStared += this.ScanServiceScanStared;
this.scanService.ScanStatusChanged += this.ScanServiceScanStatusChanged;