]> granicus.if.org Git - handbrake/commitdiff
WinGui: Remove the EncodeServiceWrapper
authorsr55 <sr55.hb@outlook.com>
Tue, 3 Mar 2015 19:59:35 +0000 (19:59 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 3 Mar 2015 19:59:35 +0000 (19:59 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6963 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs [deleted file]
win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs

index 166d6782a5c72ac4a3fa94363382a8b364580005..2e3aaf53e3c9773293f9dfeca805580a376c291c 100644 (file)
     <Compile Include="Helpers\PictureSize.cs" />\r
     <Compile Include="Model\OptionsTab.cs" />\r
     <Compile Include="Model\SelectionTitle.cs" />\r
-    <Compile Include="Services\EncodeServiceWrapper.cs" />\r
     <Compile Include="Model\ShellWindow.cs" />\r
     <Compile Include="Model\SourceMenuItem.cs" />\r
     <Compile Include="Model\UpdateCheckInformation.cs" />\r
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
deleted file mode 100644 (file)
index 867f523..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="EncodeServiceWrapper.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   We have multiple implementations of IEncode. This is a wrapper class for the GUI so that the\r
-//   implementation used is controllable via user settings.\r
-//   Over time, this class will go away when the LibHB and process isolation code matures.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.Services\r
-{\r
-    using System;\r
-\r
-    using HandBrake.ApplicationServices.Exceptions;\r
-    using HandBrake.ApplicationServices.Model;\r
-    using HandBrake.ApplicationServices.Services.Encode;\r
-    using HandBrake.ApplicationServices.Services.Encode.EventArgs;\r
-    using HandBrake.ApplicationServices.Services.Encode.Interfaces;\r
-\r
-    /// <summary>\r
-    /// We have multiple implementations of Iencode. This is a wrapper class for the GUI so that the \r
-    /// implementation used is controllable via user settings.\r
-    /// Over time, this class will go away when the LibHB and process isolation code matures.\r
-    /// </summary>\r
-    public class EncodeServiceWrapper : IEncode\r
-    {\r
-        #region Constants and Fields\r
-\r
-        /// <summary>\r
-        /// The encode service.\r
-        /// </summary>\r
-        private readonly IEncode encodeService;\r
-\r
-        #endregion\r
-\r
-        #region Constructors and Destructors\r
-\r
-        /// <summary>\r
-        /// Initializes a new instance of the <see cref="EncodeServiceWrapper"/> class.\r
-        /// </summary>\r
-        public EncodeServiceWrapper()\r
-        {\r
-            try\r
-            {\r
-                this.encodeService = new LibEncode();\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                // Try to recover from errors.\r
-                throw new GeneralApplicationException(\r
-                    "Unable to initialise LibHB or Background worker service", \r
-                    "HandBrake will not be able to operate correctly.", \r
-                    exc);\r
-            }\r
-  \r
-            this.encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;\r
-            this.encodeService.EncodeStarted += this.EncodeServiceEncodeStarted;\r
-            this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged;\r
-        }\r
-\r
-        #endregion\r
-\r
-        #region Events\r
-\r
-        /// <summary>\r
-        /// The encode completed.\r
-        /// </summary>\r
-        public event EncodeCompletedStatus EncodeCompleted;\r
-\r
-        /// <summary>\r
-        /// The encode started.\r
-        /// </summary>\r
-        public event EventHandler EncodeStarted;\r
-\r
-        /// <summary>\r
-        /// The encode status changed.\r
-        /// </summary>\r
-        public event EncodeProgessStatus EncodeStatusChanged;\r
-\r
-        #endregion\r
-\r
-        #region Properties\r
-\r
-        /// <summary>\r
-        /// Gets ActivityLog.\r
-        /// </summary>\r
-        public string ActivityLog\r
-        {\r
-            get\r
-            {\r
-                return this.encodeService.ActivityLog;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets the log index.\r
-        /// </summary>\r
-        public int LogIndex\r
-        {\r
-            get\r
-            {\r
-                return this.encodeService.LogIndex;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether can pause.\r
-        /// </summary>\r
-        public bool CanPause\r
-        {\r
-            get\r
-            {\r
-                return this.encodeService.CanPause;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether is pasued.\r
-        /// </summary>\r
-        public bool IsPasued\r
-        {\r
-            get\r
-            {\r
-                return this.encodeService.IsPasued;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether IsEncoding.\r
-        /// </summary>\r
-        public bool IsEncoding\r
-        {\r
-            get\r
-            {\r
-                return this.encodeService.IsEncoding;\r
-            }\r
-        }\r
-\r
-        #endregion\r
-\r
-        #region Implemented Interfaces\r
-\r
-        #region IEncode\r
-\r
-        /// <summary>\r
-        /// Copy the log file to the desired destinations\r
-        /// </summary>\r
-        /// <param name="destination">\r
-        /// The destination.\r
-        /// </param>\r
-        /// <param name="configuration">\r
-        /// The configuration.\r
-        /// </param>\r
-        public void ProcessLogs(string destination, HBConfiguration configuration)\r
-        {\r
-            this.encodeService.ProcessLogs(destination, configuration);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Shutdown the service.\r
-        /// </summary>\r
-        public void Shutdown()\r
-        {\r
-            this.encodeService.Stop();\r
-            this.encodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;\r
-            this.encodeService.EncodeStarted -= this.EncodeServiceEncodeStarted;\r
-            this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged;\r
-        }\r
-\r
-        /// <summary>\r
-        /// Start with a LibHb EncodeJob Object\r
-        /// </summary>\r
-        /// <param name="job">\r
-        /// The job.\r
-        /// </param>\r
-        public void Start(QueueTask job)\r
-        {\r
-            this.encodeService.Start(job);\r
-        }\r
-\r
-        /// <summary>\r
-        /// The pause.\r
-        /// </summary>\r
-        public void Pause()\r
-        {\r
-            this.encodeService.Pause();\r
-        }\r
-\r
-        /// <summary>\r
-        /// The resume.\r
-        /// </summary>\r
-        public void Resume()\r
-        {\r
-            this.encodeService.Resume();\r
-        }\r
-\r
-        /// <summary>\r
-        /// Kill the CLI process\r
-        /// </summary>\r
-        public void Stop()\r
-        {\r
-            this.encodeService.Stop();\r
-        }\r
-\r
-        #endregion\r
-\r
-        #endregion\r
-\r
-        #region Methods\r
-\r
-        /// <summary>\r
-        /// The encode service_ encode completed.\r
-        /// </summary>\r
-        /// <param name="sender">\r
-        /// The sender.\r
-        /// </param>\r
-        /// <param name="e">\r
-        /// The EncodeCompletedEventArgs.\r
-        /// </param>\r
-        private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e)\r
-        {\r
-            if (EncodeCompleted != null)\r
-            {\r
-                this.EncodeCompleted(sender, e);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// The encode service_ encode started.\r
-        /// </summary>\r
-        /// <param name="sender">\r
-        /// The sender.\r
-        /// </param>\r
-        /// <param name="e">\r
-        /// The EventArgs\r
-        /// </param>\r
-        private void EncodeServiceEncodeStarted(object sender, EventArgs e)\r
-        {\r
-            if (EncodeStarted != null)\r
-            {\r
-                this.EncodeStarted(sender, e);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// The encode service_ encode status changed.\r
-        /// </summary>\r
-        /// <param name="sender">\r
-        /// The sender.\r
-        /// </param>\r
-        /// <param name="e">\r
-        /// The EncodeProgressEventArgs.\r
-        /// </param>\r
-        private void EncodeServiceEncodeStatusChanged(object sender, EncodeProgressEventArgs e)\r
-        {\r
-            if (EncodeStatusChanged != null)\r
-            {\r
-                this.EncodeStatusChanged(sender, e);\r
-            }\r
-        }\r
-\r
-        #endregion\r
-    }\r
-}
\ No newline at end of file
index 617413bc8d925107157911520318d64dfe6d7f48..406bbdbe7361c77cfbf32b905c69464eca202835 100644 (file)
@@ -21,6 +21,7 @@ namespace HandBrakeWPF.Startup
     using Castle.Windsor;\r
 \r
     using HandBrake.ApplicationServices;\r
+    using HandBrake.ApplicationServices.Services.Encode;\r
     using HandBrake.ApplicationServices.Services.Encode.Interfaces;\r
     using HandBrake.ApplicationServices.Services.Scan;\r
     using HandBrake.ApplicationServices.Services.Scan.Interfaces;\r
@@ -62,7 +63,7 @@ namespace HandBrakeWPF.Startup
             // Services\r
             this.windsorContainer.Register(Component.For<IUpdateService>().ImplementedBy<UpdateService>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<IScan>().ImplementedBy<LibScan>().LifeStyle.Is(LifestyleType.Singleton));\r
-            this.windsorContainer.Register(Component.For<IEncode>().ImplementedBy<EncodeServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));\r
+            this.windsorContainer.Register(Component.For<IEncode>().ImplementedBy<LibEncode>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<INotificationService>().ImplementedBy<NotificationService>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<IPrePostActionService>().ImplementedBy<PrePostActionService>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<IUserSettingService>().ImplementedBy<UserSettingService>());\r
index 012a4c15b15dddc3c8219349e7cb37583fbbbed8..3a3b4e6eb775694c380b28b91e1a3723aef29b13 100644 (file)
@@ -27,6 +27,7 @@ namespace HandBrakeWPF.ViewModels
     using HandBrake.ApplicationServices.Services.Scan.Interfaces;\r
     using HandBrake.ApplicationServices.Services.Scan.Model;\r
     using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
+    using HandBrake.ApplicationServices.Services.Encode;\r
 \r
     using HandBrakeWPF.Factories;\r
     using HandBrakeWPF.Properties;\r
@@ -133,7 +134,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             // Live Preview\r
             this.userSettingService = userSettingService;\r
-            this.encodeService = new EncodeServiceWrapper(); // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point\r
+            this.encodeService = new LibEncode(); // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point\r
 \r
             this.Title = "Preview";\r
             this.Percentage = "0.00%";\r