diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs | 27 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/NotificationService.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/UserSettingConstants.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 49 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/OptionsView.xaml | 16 |
9 files changed, 13 insertions, 105 deletions
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs index b63b74078..867f523c8 100644 --- a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs +++ b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs @@ -14,20 +14,17 @@ namespace HandBrakeWPF.Services using System;
using HandBrake.ApplicationServices.Exceptions;
- using HandBrake.ApplicationServices.Isolation;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode;
using HandBrake.ApplicationServices.Services.Encode.EventArgs;
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
- using HandBrakeWPF.Services.Interfaces;
-
/// <summary>
/// We have multiple implementations of Iencode. This is a wrapper class for the GUI so that the
/// implementation used is controllable via user settings.
/// Over time, this class will go away when the LibHB and process isolation code matures.
/// </summary>
- public class EncodeServiceWrapper : IEncodeServiceWrapper
+ public class EncodeServiceWrapper : IEncode
{
#region Constants and Fields
@@ -43,32 +40,18 @@ namespace HandBrakeWPF.Services /// <summary>
/// Initializes a new instance of the <see cref="EncodeServiceWrapper"/> class.
/// </summary>
- /// <param name="userSettingService">
- /// The user setting service.
- /// </param>
- public EncodeServiceWrapper(IUserSettingService userSettingService)
+ public EncodeServiceWrapper()
{
- var useProcessIsolation =
- userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
- var port = userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort);
-
try
{
- if (useProcessIsolation)
- {
- this.encodeService = new IsolatedEncodeService(port);
- }
- else
- {
- this.encodeService = new LibEncode();
- }
+ this.encodeService = new LibEncode();
}
catch (Exception exc)
{
// Try to recover from errors.
throw new GeneralApplicationException(
- "Unable to initialise LibHB or Background worker service",
- "HandBrake will not be able to operate correctly.",
+ "Unable to initialise LibHB or Background worker service",
+ "HandBrake will not be able to operate correctly.",
exc);
}
diff --git a/win/CS/HandBrakeWPF/Services/NotificationService.cs b/win/CS/HandBrakeWPF/Services/NotificationService.cs index ba3c0cf99..1a647a970 100644 --- a/win/CS/HandBrakeWPF/Services/NotificationService.cs +++ b/win/CS/HandBrakeWPF/Services/NotificationService.cs @@ -37,7 +37,7 @@ namespace HandBrakeWPF.Services /// <param name="userSettingService">
/// The user Setting Service.
/// </param>
- public NotificationService(IEncodeServiceWrapper encodeService, IQueueProcessor queueProcessor, IUserSettingService userSettingService)
+ public NotificationService(IEncode encodeService, IQueueProcessor queueProcessor, IUserSettingService userSettingService)
{
this.userSettingService = userSettingService;
// encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs index 10da855fa..c8b327cd3 100644 --- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs @@ -62,7 +62,7 @@ namespace HandBrakeWPF.Startup // Services
this.windsorContainer.Register(Component.For<IUpdateService>().ImplementedBy<UpdateService>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IScan>().ImplementedBy<LibScan>().LifeStyle.Is(LifestyleType.Singleton));
- this.windsorContainer.Register(Component.For<IEncodeServiceWrapper>().ImplementedBy<EncodeServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IEncode>().ImplementedBy<EncodeServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<INotificationService>().ImplementedBy<NotificationService>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IPrePostActionService>().ImplementedBy<PrePostActionService>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IUserSettingService>().ImplementedBy<UserSettingService>());
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index fb3f6a04b..1c5464079 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -97,16 +97,6 @@ namespace HandBrakeWPF public const string VLCPath = "VLC_Path";
/// <summary>
- /// The enable process isolation.
- /// </summary>
- public const string EnableProcessIsolation = "EnableProcessIsolation";
-
- /// <summary>
- /// The server port.
- /// </summary>
- public const string ServerPort = "ServerPort";
-
- /// <summary>
/// Growl Encodes
/// </summary>
public const string GrowlEncode = "GrowlEncode";
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs index 21921b5d6..008d70dcb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs @@ -30,7 +30,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Backing field for the encodeService service
/// </summary>
- private readonly IEncodeServiceWrapper encodeService;
+ private readonly IEncode encodeService;
/// <summary>
/// Backing field for the Scan Service
@@ -58,7 +58,7 @@ namespace HandBrakeWPF.ViewModels /// <param name="scanService">
/// The scan service.
/// </param>
- public LogViewModel(IEncodeServiceWrapper encodeService, IScan scanService)
+ public LogViewModel(IEncode encodeService, IScan scanService)
{
this.encodeService = encodeService;
this.scanService = scanService;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index d3fd9900c..f204b084d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -97,7 +97,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// The Encode Service
/// </summary>
- private readonly IEncodeServiceWrapper encodeService;
+ private readonly IEncode encodeService;
/// <summary>
/// Windows 7 API Pack wrapper
@@ -229,7 +229,7 @@ namespace HandBrakeWPF.ViewModels /// The when Done Service.
/// *** Leave in Constructor. ***
/// </param>
- public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
+ public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService,
IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, INotificationService notificationService,
IPrePostActionService whenDoneService)
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 77132cf11..31841a335 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -261,16 +261,6 @@ namespace HandBrakeWPF.ViewModels private UpdateCheckInformation updateInfo;
/// <summary>
- /// The enable process isolation.
- /// </summary>
- private bool enableProcessIsolation;
-
- /// <summary>
- /// The server port.
- /// </summary>
- private int serverPort;
-
- /// <summary>
/// The show advanced tab backing field.
/// </summary>
private bool showAdvancedTab;
@@ -1061,38 +1051,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Gets or sets a value indicating whether ClearQueueOnEncodeCompleted.
- /// </summary>
- public bool EnableProcessIsolation
- {
- get
- {
- return this.enableProcessIsolation;
- }
- set
- {
- this.enableProcessIsolation = value;
- this.NotifyOfPropertyChange(() => this.EnableProcessIsolation);
- }
- }
-
- /// <summary>
- /// Gets or sets the server port.
- /// </summary>
- public int ServerPort
- {
- get
- {
- return this.serverPort;
- }
- set
- {
- this.serverPort = value;
- this.NotifyOfPropertyChange(() => this.ServerPort);
- }
- }
-
- /// <summary>
/// Gets or sets a value indicating whether enable lib hb.
/// </summary>
public bool ShowAdvancedTab
@@ -1541,11 +1499,6 @@ namespace HandBrakeWPF.ViewModels // Use dvdnav
this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);
-
- int port;
- int.TryParse(userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort), out port);
- this.ServerPort = port;
- this.EnableProcessIsolation = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
}
/// <summary>
@@ -1606,8 +1559,6 @@ namespace HandBrakeWPF.ViewModels }
userSettingService.SetUserSetting(UserSettingConstants.DisableLibDvdNav, this.DisableLibdvdNav);
- userSettingService.SetUserSetting(UserSettingConstants.EnableProcessIsolation, this.EnableProcessIsolation);
- userSettingService.SetUserSetting(UserSettingConstants.ServerPort, this.ServerPort.ToString(CultureInfo.InvariantCulture));
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index 5099a2d9a..ff1b1a0c9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -55,7 +55,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Backing field for the encode service.
/// </summary>
- private readonly IEncodeServiceWrapper encodeService;
+ private readonly IEncode encodeService;
/// <summary>
/// The error service
@@ -134,7 +134,7 @@ namespace HandBrakeWPF.ViewModels // Live Preview
this.userSettingService = userSettingService;
- this.encodeService = new EncodeServiceWrapper(userSettingService); // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point
+ this.encodeService = new EncodeServiceWrapper(); // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point
this.Title = "Preview";
this.Percentage = "0.00%";
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 2315eea55..52f9568d2 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -325,22 +325,6 @@ </StackPanel>
-
- <StackPanel Orientation="Vertical" Margin="0,10,0,20" Visibility="Visible">
-
- <TextBlock Text="Encode Engine" FontSize="14" Margin="0,0,0,10" Visibility="Collapsed"/>
-
- <StackPanel Orientation="Vertical" Margin="20,0,0,0">
-
-
- <CheckBox Content="Enable Process Isolation (Run Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" Visibility="Collapsed" />
- <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="Collapsed">
- <TextBlock Text="Server Port:" VerticalAlignment="Center" />
- <TextBox Width="50" MaxLength="5" Text="{Binding ServerPort}" />
- </StackPanel>
-
- </StackPanel>
- </StackPanel>
</StackPanel>
<StackPanel Name="Updates" Orientation="Vertical" Margin="10,10,0,0"
|