summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-31 15:19:14 +0000
committersr55 <[email protected]>2015-01-31 15:19:14 +0000
commit6d57e42b6b2cc38cf256f2970b23b94121e49479 (patch)
tree6841b6c50f50b6ac34bfa9dba954f959f030b480 /win/CS/HandBrakeWPF/Services
parenta4416e99f06e31e1da8767d071e882f32c5a4e67 (diff)
WinGui: Remove a bunch of CLI handling code.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6840 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs34
1 files changed, 13 insertions, 21 deletions
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
index bfcf24fc4..b63b74078 100644
--- a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
+++ b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
@@ -48,38 +48,30 @@ namespace HandBrakeWPF.Services
/// </param>
public EncodeServiceWrapper(IUserSettingService userSettingService)
{
- var useLibHb = true;
var useProcessIsolation =
userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
var port = userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort);
- if (useLibHb)
+ try
{
- try
+ if (useProcessIsolation)
{
- if (useProcessIsolation)
- {
- this.encodeService = new IsolatedEncodeService(port);
- }
- else
- {
- this.encodeService = new LibEncode();
- }
+ this.encodeService = new IsolatedEncodeService(port);
}
- catch (Exception exc)
+ else
{
- // Try to recover from errors.
- throw new GeneralApplicationException(
- "Unable to initialise LibHB or Background worker service",
- "Falling back to using HandBrakeCLI.exe. Setting has been reset",
- exc);
+ this.encodeService = new LibEncode();
}
}
- else
+ catch (Exception exc)
{
- this.encodeService = new EncodeService();
+ // Try to recover from errors.
+ throw new GeneralApplicationException(
+ "Unable to initialise LibHB or Background worker service",
+ "HandBrake will not be able to operate correctly.",
+ exc);
}
-
+
this.encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
this.encodeService.EncodeStarted += this.EncodeServiceEncodeStarted;
this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged;
@@ -188,7 +180,7 @@ namespace HandBrakeWPF.Services
/// </summary>
public void Shutdown()
{
- this.encodeService.Shutdown();
+ this.encodeService.Stop();
this.encodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;
this.encodeService.EncodeStarted -= this.EncodeServiceEncodeStarted;
this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged;