summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-03-03 19:59:35 +0000
committersr55 <[email protected]>2015-03-03 19:59:35 +0000
commite008f370034803a0ca3d1389d919f2a145c0d605 (patch)
tree3569a3da1e712d096550576da4b60cd74a9a52ba /win/CS/HandBrakeWPF/Services
parentbb8c2ed96d9054391dea5908047b76f40bde0648 (diff)
WinGui: Remove the EncodeServiceWrapper
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6963 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs266
1 files changed, 0 insertions, 266 deletions
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
deleted file mode 100644
index 867f523c8..000000000
--- a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="EncodeServiceWrapper.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <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>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Services
-{
- using System;
-
- using HandBrake.ApplicationServices.Exceptions;
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Encode;
- using HandBrake.ApplicationServices.Services.Encode.EventArgs;
- using HandBrake.ApplicationServices.Services.Encode.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 : IEncode
- {
- #region Constants and Fields
-
- /// <summary>
- /// The encode service.
- /// </summary>
- private readonly IEncode encodeService;
-
- #endregion
-
- #region Constructors and Destructors
-
- /// <summary>
- /// Initializes a new instance of the <see cref="EncodeServiceWrapper"/> class.
- /// </summary>
- public EncodeServiceWrapper()
- {
- try
- {
- 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.",
- exc);
- }
-
- this.encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
- this.encodeService.EncodeStarted += this.EncodeServiceEncodeStarted;
- this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged;
- }
-
- #endregion
-
- #region Events
-
- /// <summary>
- /// The encode completed.
- /// </summary>
- public event EncodeCompletedStatus EncodeCompleted;
-
- /// <summary>
- /// The encode started.
- /// </summary>
- public event EventHandler EncodeStarted;
-
- /// <summary>
- /// The encode status changed.
- /// </summary>
- public event EncodeProgessStatus EncodeStatusChanged;
-
- #endregion
-
- #region Properties
-
- /// <summary>
- /// Gets ActivityLog.
- /// </summary>
- public string ActivityLog
- {
- get
- {
- return this.encodeService.ActivityLog;
- }
- }
-
- /// <summary>
- /// Gets the log index.
- /// </summary>
- public int LogIndex
- {
- get
- {
- return this.encodeService.LogIndex;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether can pause.
- /// </summary>
- public bool CanPause
- {
- get
- {
- return this.encodeService.CanPause;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether is pasued.
- /// </summary>
- public bool IsPasued
- {
- get
- {
- return this.encodeService.IsPasued;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether IsEncoding.
- /// </summary>
- public bool IsEncoding
- {
- get
- {
- return this.encodeService.IsEncoding;
- }
- }
-
- #endregion
-
- #region Implemented Interfaces
-
- #region IEncode
-
- /// <summary>
- /// Copy the log file to the desired destinations
- /// </summary>
- /// <param name="destination">
- /// The destination.
- /// </param>
- /// <param name="configuration">
- /// The configuration.
- /// </param>
- public void ProcessLogs(string destination, HBConfiguration configuration)
- {
- this.encodeService.ProcessLogs(destination, configuration);
- }
-
- /// <summary>
- /// Shutdown the service.
- /// </summary>
- public void Shutdown()
- {
- this.encodeService.Stop();
- this.encodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;
- this.encodeService.EncodeStarted -= this.EncodeServiceEncodeStarted;
- this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged;
- }
-
- /// <summary>
- /// Start with a LibHb EncodeJob Object
- /// </summary>
- /// <param name="job">
- /// The job.
- /// </param>
- public void Start(QueueTask job)
- {
- this.encodeService.Start(job);
- }
-
- /// <summary>
- /// The pause.
- /// </summary>
- public void Pause()
- {
- this.encodeService.Pause();
- }
-
- /// <summary>
- /// The resume.
- /// </summary>
- public void Resume()
- {
- this.encodeService.Resume();
- }
-
- /// <summary>
- /// Kill the CLI process
- /// </summary>
- public void Stop()
- {
- this.encodeService.Stop();
- }
-
- #endregion
-
- #endregion
-
- #region Methods
-
- /// <summary>
- /// The encode service_ encode completed.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EncodeCompletedEventArgs.
- /// </param>
- private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e)
- {
- if (EncodeCompleted != null)
- {
- this.EncodeCompleted(sender, e);
- }
- }
-
- /// <summary>
- /// The encode service_ encode started.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EventArgs
- /// </param>
- private void EncodeServiceEncodeStarted(object sender, EventArgs e)
- {
- if (EncodeStarted != null)
- {
- this.EncodeStarted(sender, e);
- }
- }
-
- /// <summary>
- /// The encode service_ encode status changed.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EncodeProgressEventArgs.
- /// </param>
- private void EncodeServiceEncodeStatusChanged(object sender, EncodeProgressEventArgs e)
- {
- if (EncodeStatusChanged != null)
- {
- this.EncodeStatusChanged(sender, e);
- }
- }
-
- #endregion
- }
-} \ No newline at end of file