diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs | 40 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/OptionsView.xaml | 4 |
2 files changed, 5 insertions, 39 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;
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 8aadb7ce3..923876b8e 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -383,8 +383,8 @@ <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
- <CheckBox Content="Enable LibHB Scanning and Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
- <CheckBox Content="Enable Process Isolation (Run Scans and Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" />
+ <CheckBox Content="Enable LibHB based Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
+ <CheckBox Content="Enable Process Isolation (Run Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">
<TextBlock Text="Server Port:" VerticalAlignment="Center" />
<TextBox Width="50" MaxLength="5" Text="{Binding ServerPort}" />
|