diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs | 40 |
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;
|