]> granicus.if.org Git - handbrake/commitdiff
WinGui: Remove the scan service wrapper as it's no longer needed.
authorsr55 <sr55.hb@outlook.com>
Sat, 21 Sep 2013 16:25:39 +0000 (16:25 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 21 Sep 2013 16:25:39 +0000 (16:25 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5789 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScanServiceWrapper.cs [deleted file]
win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs [deleted file]
win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs
win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index bb85a50717feaa5b27f1c55edb78be06e895df8b..477392a05246476ee5a05b388ab3c538018b60c4 100644 (file)
@@ -99,7 +99,6 @@
     <Compile Include="LibHb\AudioVideoHelpers.cs" />\r
     <Compile Include="Services\Interfaces\IEncodeServiceWrapper.cs" />\r
     <Compile Include="Services\Interfaces\IHbServiceCallback.cs" />\r
-    <Compile Include="Services\Interfaces\IScanServiceWrapper.cs" />\r
     <Compile Include="Services\Interfaces\IServerService.cs" />\r
     <Compile Include="Services\ServerService.cs" />\r
     <Compile Include="Utilities\Converters.cs" />\r
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScanServiceWrapper.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScanServiceWrapper.cs
deleted file mode 100644 (file)
index febe4aa..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="IScanServiceWrapper.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
-//   ScanServiceWrapper Interface\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.ApplicationServices.Services.Interfaces\r
-{\r
-    /// <summary>\r
-    /// ScanServiceWrapper Interface\r
-    /// </summary>\r
-    public interface IScanServiceWrapper : IScan\r
-    {\r
-    }\r
-}\r
index e9ec9966aa7b918385294a2f36a8bd5d8bb10426..b00061068d8bdfa5d67adcfe4b6115b1885cdde7 100644 (file)
@@ -22,7 +22,7 @@ namespace HandBrakeWPF.Commands
         /// <summary>\r
         /// The scan service wrapper.\r
         /// </summary>\r
-        private readonly IScanServiceWrapper scanServiceWrapper;\r
+        private readonly IScan scanServiceWrapper;\r
 \r
         /// <summary>\r
         /// Initializes a new instance of the <see cref="CancelScanCommand"/> class.\r
@@ -30,7 +30,7 @@ namespace HandBrakeWPF.Commands
         /// <param name="ssw">\r
         /// The scan service wrapper.\r
         /// </param>\r
-        public CancelScanCommand(IScanServiceWrapper ssw)\r
+        public CancelScanCommand(IScan ssw)\r
         {\r
             this.scanServiceWrapper = ssw;\r
             this.scanServiceWrapper.ScanStared += this.ScanServiceWrapperScanStared;\r
index b0094ce2335f3a99fd73392ca654ba83e189ab59..66eb70257b9835ded6d18aa0b4989736b2437076 100644 (file)
     <Compile Include="Services\Interfaces\IUpdateService.cs" />\r
     <Compile Include="Services\Interfaces\IPrePostActionService.cs" />\r
     <Compile Include="Services\NotificationService.cs" />\r
-    <Compile Include="Services\ScanServiceWrapper.cs" />\r
     <Compile Include="Services\UpdateService.cs" />\r
     <Compile Include="Services\PrePostActionService.cs" />\r
     <Compile Include="ViewModels\AdvancedViewModel.cs" />\r
index 2dd1814ee0eae6cb5c004c66d46825ffd9226962..7fc3c76ffe943b3da9d3d5f1d11d4016f4c66a84 100644 (file)
@@ -64,12 +64,7 @@ namespace HandBrakeWPF.Services
                     }\r
                     else\r
                     {\r
-                        if (ScanServiceWrapper.HandbrakeInstance == null)\r
-                        {\r
-                            ScanServiceWrapper.HandbrakeInstance = new HandBrakeInstance();\r
-                        }\r
-\r
-                        this.encodeService = new LibEncode(userSettingService, ScanServiceWrapper.HandbrakeInstance);\r
+                        this.encodeService = new LibEncode(userSettingService, new HandBrakeInstance());\r
                     }\r
                 }\r
                 catch (Exception exc)\r
diff --git a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs
deleted file mode 100644 (file)
index 8180ac0..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="ScanServiceWrapper.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 IScan. 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.Parsing;\r
-    using HandBrake.ApplicationServices.Services;\r
-    using HandBrake.ApplicationServices.Services.Interfaces;\r
-    using HandBrake.Interop.Interfaces;\r
-\r
-    /// <summary>\r
-    /// We have multiple implementations of IScan. 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 ScanServiceWrapper : IScanServiceWrapper\r
-    {\r
-        #region Constants and Fields\r
-\r
-        /// <summary>\r
-        /// The handbrake instance.\r
-        /// </summary>\r
-        public static IHandBrakeInstance HandbrakeInstance;\r
-\r
-        /// <summary>\r
-        /// The scan service.\r
-        /// </summary>\r
-        private readonly IScan scanService;\r
-\r
-        #endregion\r
-\r
-        #region Constructors and Destructors\r
-\r
-        /// <summary>\r
-        /// Initializes a new instance of the <see cref="ScanServiceWrapper"/> class.\r
-        /// </summary>\r
-        /// <param name="userSettingService">\r
-        /// The user Setting Service.\r
-        /// </param>\r
-        public ScanServiceWrapper(IUserSettingService userSettingService)\r
-        {\r
-            this.scanService = new LibScan(userSettingService);\r
-            this.scanService.ScanCompleted += this.ScanServiceScanCompleted;\r
-            this.scanService.ScanStared += this.ScanServiceScanStared;\r
-            this.scanService.ScanStatusChanged += this.ScanServiceScanStatusChanged;\r
-        }\r
-\r
-        /// <summary>\r
-        /// The scan service scan status changed event\r
-        /// </summary>\r
-        /// <param name="sender">\r
-        /// The sender.\r
-        /// </param>\r
-        /// <param name="e">\r
-        /// The ScanProgressEventArgs.\r
-        /// </param>\r
-        private void ScanServiceScanStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.ScanProgressEventArgs e)\r
-        {\r
-            this.ScanStatusChanged(sender, e);\r
-        }\r
-\r
-        /// <summary>\r
-        /// The scan service scan stared event\r
-        /// </summary>\r
-        /// <param name="sender">\r
-        /// The sender.\r
-        /// </param>\r
-        /// <param name="e">\r
-        /// The EventArgs\r
-        /// </param>\r
-        private void ScanServiceScanStared(object sender, EventArgs e)\r
-        {\r
-            this.ScanStared(sender, e);\r
-        }\r
-\r
-        /// <summary>\r
-        /// The scan service scan completed event\r
-        /// </summary>\r
-        /// <param name="sender">\r
-        /// The sender.\r
-        /// </param>\r
-        /// <param name="e">\r
-        /// The ScanCompletedEventArgs\r
-        /// </param>\r
-        private void ScanServiceScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e)\r
-        {\r
-            this.ScanCompleted(sender, e);\r
-        }\r
-\r
-        #endregion\r
-\r
-        #region Events\r
-\r
-        /// <summary>\r
-        /// The scan completed.\r
-        /// </summary>\r
-        public event ScanCompletedStatus ScanCompleted;\r
-\r
-        /// <summary>\r
-        /// The scan stared.\r
-        /// </summary>\r
-        public event EventHandler ScanStared;\r
-\r
-        /// <summary>\r
-        /// The scan status changed.\r
-        /// </summary>\r
-        public event ScanProgessStatus ScanStatusChanged;\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.scanService.ActivityLog;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether IsScanning.\r
-        /// </summary>\r
-        public bool IsScanning\r
-        {\r
-            get\r
-            {\r
-                return this.scanService.IsScanning;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets the Souce Data.\r
-        /// </summary>\r
-        public Source SouceData\r
-        {\r
-            get\r
-            {\r
-                return this.scanService.SouceData;\r
-            }\r
-        }\r
-\r
-        #endregion\r
-\r
-        #region Implemented Interfaces\r
-\r
-        #region IScan\r
-\r
-        /// <summary>\r
-        /// Scan a Source Path.\r
-        /// Title 0: scan all\r
-        /// </summary>\r
-        /// <param name="sourcePath">\r
-        /// Path to the file to scan\r
-        /// </param>\r
-        /// <param name="title">\r
-        /// int title number. 0 for scan all\r
-        /// </param>\r
-        /// <param name="previewCount">\r
-        /// The preview Count.\r
-        /// </param>\r
-        /// <param name="postAction">\r
-        /// The post Action.\r
-        /// </param>\r
-        public void Scan(string sourcePath, int title, int previewCount, Action<bool> postAction)\r
-        {\r
-            this.scanService.Scan(sourcePath, title, previewCount, postAction);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Kill the scan\r
-        /// </summary>\r
-        public void Stop()\r
-        {\r
-            this.scanService.Stop();\r
-        }\r
-\r
-        #endregion\r
-\r
-        #endregion\r
-    }\r
-}
\ No newline at end of file
index 0debbbcce26dffa23ea4ac0da53d55ae15725437..34f58c862feb6a46588426dc0a2d572fcd9e65a7 100644 (file)
@@ -21,6 +21,7 @@ namespace HandBrakeWPF.Startup
     using Castle.Windsor;\r
 \r
     using HandBrake.ApplicationServices;\r
+    using HandBrake.ApplicationServices.Services;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
 \r
     using HandBrakeWPF.Commands;\r
@@ -57,7 +58,7 @@ namespace HandBrakeWPF.Startup
 \r
             // Services\r
             this.windsorContainer.Register(Component.For<IUpdateService>().ImplementedBy<UpdateService>().LifeStyle.Is(LifestyleType.Singleton));\r
-            this.windsorContainer.Register(Component.For<IScanServiceWrapper>().ImplementedBy<ScanServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));\r
+            this.windsorContainer.Register(Component.For<IScan>().ImplementedBy<LibScan>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<IEncodeServiceWrapper>().ImplementedBy<EncodeServiceWrapper>().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
index 8edfb3a8785b6f5d0c9bd2664ef6204efe8283a9..c99fb1c5142c81a2b7cee77dff3c9610d540b01a 100644 (file)
@@ -69,7 +69,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         ///     The scan service.\r
         /// </summary>\r
-        private readonly IScanServiceWrapper scanService;\r
+        private readonly IScan scanService;\r
 \r
         /// <summary>\r
         ///     The shell view model.\r
@@ -181,8 +181,8 @@ namespace HandBrakeWPF.ViewModels
         /// The when done service.\r
         /// </param>\r
         public InstantViewModel(\r
-            IUserSettingService userSettingService, \r
-            IScanServiceWrapper scanService, \r
+            IUserSettingService userSettingService,\r
+            IScan scanService, \r
             IEncodeServiceWrapper encodeService, \r
             IPresetService presetService, \r
             IErrorService errorService, \r
index ad5698b1b94a92275f0cdbabb1e9fd65d19be5e3..8356b124b9448b2add2e542fbbfa6345bd3c96b1 100644 (file)
@@ -33,7 +33,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Backing field for the Scan Service\r
         /// </summary>\r
-        private readonly IScanServiceWrapper scanService;\r
+        private readonly IScan scanService;\r
 \r
         /// <summary>\r
         /// The selected tab.\r
@@ -56,7 +56,7 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="scanService">\r
         /// The scan service.\r
         /// </param>\r
-        public LogViewModel(IEncodeServiceWrapper encodeService, IScanServiceWrapper scanService)\r
+        public LogViewModel(IEncodeServiceWrapper encodeService, IScan scanService)\r
         {\r
             this.encodeService = encodeService;\r
             this.scanService = scanService;\r
index b3be2b60eea01666b2e495ccfb7d17986fe07756..de6d7c06323e49e9ec15588d30d933ad7f588153 100644 (file)
@@ -84,7 +84,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The Source Scan Service.\r
         /// </summary>\r
-        private readonly IScanServiceWrapper scanService;\r
+        private readonly IScan scanService;\r
 \r
         /// <summary>\r
         /// The Encode Service\r
@@ -211,7 +211,7 @@ namespace HandBrakeWPF.ViewModels
         /// The when Done Service.\r
         /// *** Leave in Constructor. *** \r
         /// </param>\r
-        public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,\r
+        public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,\r
             IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, INotificationService notificationService,\r
             IPrePostActionService whenDoneService)\r
         {\r