]> granicus.if.org Git - handbrake/commitdiff
WinGui: Moving the Queue Code out to the UI level. The services library will be stric...
authorsr55 <sr55.hb@outlook.com>
Sun, 1 Mar 2015 18:03:28 +0000 (18:03 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 1 Mar 2015 18:03:28 +0000 (18:03 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6959 b64f7644-9d1e-0410-96f1-a4d463321fa5

20 files changed:
win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
win/CS/HandBrake.ApplicationServices/Services/Interfaces/IServerService.cs [deleted file]
win/CS/HandBrake.ApplicationServices/Services/ServerService.cs [deleted file]
win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs [deleted file]
win/CS/HandBrakeWPF/EventArgs/QueueCompletedEventArgs.cs [moved from win/CS/HandBrake.ApplicationServices/EventArgs/QueueCompletedEventArgs.cs with 93% similarity]
win/CS/HandBrakeWPF/EventArgs/QueueProgressEventArgs.cs [moved from win/CS/HandBrake.ApplicationServices/EventArgs/QueueProgressEventArgs.cs with 93% similarity]
win/CS/HandBrakeWPF/EventArgs/SettingChangedEventArgs.cs [moved from win/CS/HandBrake.ApplicationServices/EventArgs/SettingChangedEventArgs.cs with 92% similarity]
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
win/CS/HandBrakeWPF/Services/Interfaces/IQueueProcessor.cs [moved from win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs with 95% similarity]
win/CS/HandBrakeWPF/Services/Interfaces/IUserSettingService.cs
win/CS/HandBrakeWPF/Services/NotificationService.cs
win/CS/HandBrakeWPF/Services/PrePostActionService.cs
win/CS/HandBrakeWPF/Services/QueueProcessor.cs [moved from win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs with 95% similarity]
win/CS/HandBrakeWPF/Services/UserSettingService.cs
win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs

index 7b0c96fd85b70b511afa109453ead4ba0349a543..bb00bc2662a748b3650911cae436593d5244c0ec 100644 (file)
   </ItemGroup>\r
   <ItemGroup>\r
     <Compile Include="Converters\EnumToDescConverter.cs" />\r
-    <Compile Include="EventArgs\QueueCompletedEventArgs.cs" />\r
-    <Compile Include="EventArgs\SettingChangedEventArgs.cs" />\r
     <Compile Include="Exceptions\GeneralApplicationException.cs" />\r
-    <Compile Include="EventArgs\QueueProgressEventArgs.cs" />\r
     <Compile Include="Interop\Attributes\ShortName.cs" />\r
     <Compile Include="Interop\EventArgs\EncodeCompletedEventArgs.cs" />\r
     <Compile Include="Interop\EventArgs\EncodeProgressEventArgs.cs" />\r
     <Compile Include="Services\Encode\Model\Models\Video\VideoProfile.cs" />\r
     <Compile Include="Services\Encode\Model\Models\Video\VideoTune.cs" />\r
     <Compile Include="Services\Interfaces\IHbServiceCallback.cs" />\r
-    <Compile Include="Services\Interfaces\IServerService.cs" />\r
     <Compile Include="Services\Scan\EventArgs\ScanCompletedEventArgs.cs" />\r
     <Compile Include="Services\Scan\EventArgs\ScanProgressEventArgs.cs" />\r
-    <Compile Include="Services\ServerService.cs" />\r
     <Compile Include="Utilities\Converters.cs" />\r
     <Compile Include="Utilities\EnumHelper.cs" />\r
     <Compile Include="Utilities\InteropModelCreator.cs" />\r
       <DesignTime>True</DesignTime>\r
       <DependentUpon>Resources.resx</DependentUpon>\r
     </Compile>\r
-    <Compile Include="ServicesWindsorInstaller.cs" />\r
     <Compile Include="Services\Encode\EncodeBase.cs" />\r
     <Compile Include="Services\Encode\Interfaces\IEncode.cs" />\r
-    <Compile Include="Services\Interfaces\IQueueProcessor.cs" />\r
     <Compile Include="Services\Scan\Interfaces\IScan.cs" />\r
     <Compile Include="Services\Encode\LibEncode.cs" />\r
     <Compile Include="Services\Scan\LibScan.cs" />\r
-    <Compile Include="Services\QueueProcessor.cs" />\r
     <Compile Include="Utilities\CharCodesUtilities.cs" />\r
     <Compile Include="Utilities\GeneralUtilities.cs" />\r
     <Compile Include="Utilities\LanguageUtilities.cs" />\r
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IServerService.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IServerService.cs
deleted file mode 100644 (file)
index 3675554..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="IServerService.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
-//   Defines the IServerService type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.ApplicationServices.Services.Interfaces\r
-{\r
-    using System.Runtime.Serialization;\r
-    using System.ServiceModel;\r
-\r
-    using HandBrake.ApplicationServices.Model;\r
-\r
-    /// <summary>\r
-    /// The HandBrakeService interface.\r
-    /// </summary>\r
-    [ServiceContract(CallbackContract = typeof(IHbServiceCallback), SessionMode = SessionMode.Required)]\r
-    public interface IServerService\r
-    {\r
-        /// <summary>\r
-        /// Gets the activity log.\r
-        /// </summary>\r
-        [DataMember]\r
-        string EncodeActivityLog { get; }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether is encoding.\r
-        /// </summary>\r
-        bool IsEncoding\r
-        {\r
-            [OperationContract]\r
-            get;\r
-        }\r
-\r
-        /// <summary>\r
-        /// Start the WCF Service\r
-        /// </summary>\r
-        /// <param name="port">\r
-        /// The port.\r
-        /// </param>\r
-        void Start(string port);\r
-\r
-        /// <summary>\r
-        /// Stop the WCF Service\r
-        /// </summary>\r
-        void Stop();\r
-\r
-        /// <summary>\r
-        /// Start and Encode\r
-        /// </summary>\r
-        /// <param name="job">\r
-        /// The job.\r
-        /// </param>\r
-        [OperationContract]\r
-        void StartEncode(QueueTask job);\r
-\r
-        /// <summary>\r
-        /// The process encode logs.\r
-        /// </summary>\r
-        /// <param name="destination">\r
-        /// The destination.\r
-        /// </param>\r
-        /// <param name="configuration">\r
-        /// The configuration.\r
-        /// </param>\r
-        [OperationContract]\r
-        void ProcessEncodeLogs(string destination, HBConfiguration configuration);\r
-\r
-        /// <summary>\r
-        /// Stop and Encode\r
-        /// </summary>\r
-        [OperationContract]\r
-        void StopEncode();\r
-\r
-        /// <summary>\r
-        /// Subscribe for callbacks from the called functions\r
-        /// </summary>\r
-        /// <returns>\r
-        /// The System.Boolean.\r
-        /// </returns>\r
-        [OperationContract]\r
-        bool Subscribe();\r
-\r
-        /// <summary>\r
-        /// Unsubscribe from callbacks.\r
-        /// </summary>\r
-        /// <returns>\r
-        /// The System.Boolean.\r
-        /// </returns>\r
-        [OperationContract]\r
-        bool Unsubscribe();\r
-    }\r
-}
\ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs b/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs
deleted file mode 100644 (file)
index d0f1b6a..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="ServerService.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
-//   HandBrake WCF Service\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.ApplicationServices.Services\r
-{\r
-    using System;\r
-    using System.Collections.Generic;\r
-    using System.ServiceModel;\r
-    using System.Threading;\r
-\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
-    using HandBrake.ApplicationServices.Services.Interfaces;\r
-\r
-    /// <summary>\r
-    /// HandBrake WCF Service\r
-    /// </summary>\r
-    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, IncludeExceptionDetailInFaults = true, ConcurrencyMode = ConcurrencyMode.Single)]\r
-    public class ServerService : IServerService\r
-    {\r
-        #region Constants and Fields\r
-\r
-        /// <summary>\r
-        /// List of connected Clients. For now, this should only be one.\r
-        /// </summary>\r
-        private static readonly List<IHbServiceCallback> Subscribers = new List<IHbServiceCallback>();\r
-\r
-        /// <summary>\r
-        /// The encode service.\r
-        /// </summary>\r
-        private static IEncode encodeService;\r
-\r
-        /// <summary>\r
-        /// The host.\r
-        /// </summary>\r
-        private static ServiceHost host;\r
-\r
-        /// <summary>\r
-        /// The shutdown flag.\r
-        /// </summary>\r
-        private static ManualResetEvent shutdownFlag;\r
-\r
-        #endregion\r
-\r
-        #region Properties\r
-\r
-        /// <summary>\r
-        /// Gets the activity log.\r
-        /// </summary>\r
-        public string EncodeActivityLog { get; private set; }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether is encoding.\r
-        /// </summary>\r
-        public bool IsEncoding { get; private set; }\r
-\r
-        /// <summary>\r
-        /// Gets the activity log.\r
-        /// </summary>\r
-        public string ScanActivityLog { get; private set; }\r
-\r
-        #endregion\r
-\r
-        #region Implemented Interfaces\r
-\r
-        #region IServerService\r
-\r
-        /// <summary>\r
-        /// The process encode logs.\r
-        /// </summary>\r
-        /// <param name="destination">\r
-        /// The destination.\r
-        /// </param>\r
-        /// <param name="configuration">\r
-        /// The configuration.\r
-        /// </param>\r
-        public void ProcessEncodeLogs(string destination, HBConfiguration configuration)\r
-        {\r
-            encodeService.ProcessLogs(destination, configuration);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Start the service\r
-        /// </summary>\r
-        /// <param name="port">\r
-        /// The port.\r
-        /// </param>\r
-        public void Start(string port)\r
-        {\r
-            using (host = new ServiceHost(typeof(ServerService), new Uri(string.Format("net.tcp://127.0.0.1:{0}", port))))\r
-            {\r
-                // Setup a listener\r
-                host.AddServiceEndpoint(typeof(IServerService), new NetTcpBinding(), "IHbService");\r
-                host.Open();\r
-                Console.WriteLine("::: HandBrake Isolation Server - Debug Console:::");\r
-                Console.WriteLine("Service Started. Waiting for Clients...");\r
-\r
-                // Setup the services we are going to use.\r
-                encodeService = new LibEncode(); \r
-                shutdownFlag = new ManualResetEvent(false);\r
-                shutdownFlag.WaitOne();\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Start and Encode\r
-        /// </summary>\r
-        /// <param name="job">\r
-        /// The job.\r
-        /// </param>\r
-        public void StartEncode(QueueTask job)\r
-        {\r
-            Console.WriteLine("Starting Source Encode for: " + job.Task.Source);\r
-            encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;\r
-            encodeService.EncodeStarted += this.encodeService_EncodeStarted;\r
-            encodeService.EncodeStatusChanged += this.encodeService_EncodeStatusChanged;\r
-            encodeService.Start(job);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Stop this service\r
-        /// </summary>\r
-        public void Stop()\r
-        {\r
-            if (host != null)\r
-            {\r
-                host.BeginClose(null, null);\r
-                // host.Abort();            \r
-                shutdownFlag.Set();\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Stop and Encode\r
-        /// </summary>\r
-        public void StopEncode()\r
-        {\r
-            encodeService.Stop();\r
-        }\r
-\r
-        /// <summary>\r
-        /// The subscribe.\r
-        /// </summary>\r
-        /// <returns>\r
-        /// The System.Boolean.\r
-        /// </returns>\r
-        public bool Subscribe()\r
-        {\r
-            try\r
-            {\r
-                // Get the hashCode of the connecting app and store it as a connection\r
-                var callback = OperationContext.Current.GetCallbackChannel<IHbServiceCallback>();\r
-                if (!Subscribers.Contains(callback))\r
-                {\r
-                    Console.WriteLine("Client Connected");\r
-                    Subscribers.Add(callback);\r
-                }\r
-                return true;\r
-            }\r
-            catch (Exception e)\r
-            {\r
-                Console.WriteLine(e.Message);\r
-                return false;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// The unsubscribe.\r
-        /// </summary>\r
-        /// <returns>\r
-        /// The System.Boolean.\r
-        /// </returns>\r
-        public bool Unsubscribe()\r
-        {\r
-            try\r
-            {\r
-                var callback = OperationContext.Current.GetCallbackChannel<IHbServiceCallback>();\r
-                if (Subscribers.Contains(callback))\r
-                {\r
-                    Subscribers.Remove(callback);\r
-                    if (Subscribers.Count == 0)\r
-                    {\r
-                        Console.WriteLine("Client Disconnected, Shutting down...");\r
-\r
-                        // Shutdown the service. We no longer have any clients to serve.\r
-                        // It is the responsibility of the UI to maintain a subscription while this service is in use.\r
-                        this.Stop();\r
-                    }\r
-                }\r
-                return true;\r
-            }\r
-            catch\r
-            {\r
-                return false;\r
-            }\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 e.\r
-        /// </param>\r
-        private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e)\r
-        {\r
-            encodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;\r
-            encodeService.EncodeStarted -= this.encodeService_EncodeStarted;\r
-            encodeService.EncodeStatusChanged -= this.encodeService_EncodeStatusChanged;\r
-\r
-            Subscribers.ForEach(\r
-                delegate(IHbServiceCallback callback)\r
-                    {\r
-                        if (((ICommunicationObject)callback).State == CommunicationState.Opened)\r
-                        {\r
-                            Console.WriteLine("Encode Completed Callback");\r
-                            callback.EncodeCompletedCallback(e);\r
-                        }\r
-                        else\r
-                        {\r
-                            Subscribers.Remove(callback);\r
-                        }\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 e.\r
-        /// </param>\r
-        private void encodeService_EncodeStarted(object sender, EventArgs e)\r
-        {\r
-            Subscribers.ForEach(\r
-                delegate(IHbServiceCallback callback)\r
-                    {\r
-                        if (((ICommunicationObject)callback).State == CommunicationState.Opened)\r
-                        {\r
-                            Console.WriteLine("Encode Started Callback");\r
-                            callback.EncodeStartedCallback();\r
-                        }\r
-                        else\r
-                        {\r
-                            Subscribers.Remove(callback);\r
-                        }\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 e.\r
-        /// </param>\r
-        private void encodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)\r
-        {\r
-            Subscribers.ForEach(\r
-                delegate(IHbServiceCallback callback)\r
-                    {\r
-                        if (((ICommunicationObject)callback).State == CommunicationState.Opened)\r
-                        {\r
-                            Console.WriteLine("Encode Status Callback");\r
-                            callback.EncodeProgressCallback(e);\r
-                        }\r
-                        else\r
-                        {\r
-                            Subscribers.Remove(callback);\r
-                        }\r
-                    });\r
-        }\r
-\r
-        #endregion\r
-    }\r
-}
\ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs b/win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs
deleted file mode 100644 (file)
index 72b32ef..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="ServicesWindsorInstaller.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
-//   The Windsor Installer Interface Implementation\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.ApplicationServices\r
-{\r
-    using Castle.MicroKernel.Registration;\r
-    using Castle.MicroKernel.SubSystems.Configuration;\r
-    using Castle.Windsor;\r
-\r
-    using HandBrake.ApplicationServices.Services;\r
-    using HandBrake.ApplicationServices.Services.Interfaces;\r
-\r
-    /// <summary>\r
-    /// An Implimentation of IWindsorInstaller for this library.\r
-    /// </summary>\r
-    public class ServicesWindsorInstaller : IWindsorInstaller\r
-    {\r
-        #region Implementation of IWindsorInstaller\r
-\r
-        /// <summary>\r
-        /// Performs the installation in the <see cref="T:Castle.Windsor.IWindsorContainer"/>.\r
-        /// </summary>\r
-        /// <param name="container">The container.</param><param name="store">The configuration store.</param>\r
-        public void Install(IWindsorContainer container, IConfigurationStore store)\r
-        {\r
-            container.Register(Component.For<IQueueProcessor>().ImplementedBy<QueueProcessor>());\r
-        }\r
-\r
-        #endregion\r
-    }\r
-}\r
similarity index 93%
rename from win/CS/HandBrake.ApplicationServices/EventArgs/QueueCompletedEventArgs.cs
rename to win/CS/HandBrakeWPF/EventArgs/QueueCompletedEventArgs.cs
index a98e784c370db820d6a37a4e99ad63a662dc0c99..e7e1fc813767f3af4cfbe7515a3dcd3f690e9c6a 100644 (file)
@@ -7,7 +7,7 @@
 // </summary>\r
 // --------------------------------------------------------------------------------------------------------------------\r
 \r
-namespace HandBrake.ApplicationServices.EventArgs\r
+namespace HandBrakeWPF.EventArgs\r
 {\r
     using System;\r
     using System.Runtime.Serialization;\r
similarity index 93%
rename from win/CS/HandBrake.ApplicationServices/EventArgs/QueueProgressEventArgs.cs
rename to win/CS/HandBrakeWPF/EventArgs/QueueProgressEventArgs.cs
index 016b853fa9bb7637165ee824ca6fcfafef27a81e..3fa93fe7e0a1ca918a962f9802d711890c0e12ac 100644 (file)
@@ -7,7 +7,7 @@
 // </summary>\r
 // --------------------------------------------------------------------------------------------------------------------\r
 \r
-namespace HandBrake.ApplicationServices.EventArgs\r
+namespace HandBrakeWPF.EventArgs\r
 {\r
     using System;\r
 \r
similarity index 92%
rename from win/CS/HandBrake.ApplicationServices/EventArgs/SettingChangedEventArgs.cs
rename to win/CS/HandBrakeWPF/EventArgs/SettingChangedEventArgs.cs
index 2687508b27c2240e65c294f4f4cd1db92199332a..edd27b11ca19f918ddb71677180157fbfe1aa55a 100644 (file)
@@ -7,7 +7,7 @@
 // </summary>\r
 // --------------------------------------------------------------------------------------------------------------------\r
 \r
-namespace HandBrake.ApplicationServices.EventArgs\r
+namespace HandBrakeWPF.EventArgs\r
 {\r
     /// <summary>\r
     /// The setting changed event args.\r
index a5bde0f972c685b38146d0bb8b4a7e75ef2451f0..e44fd25d7fcff08c36b6af95b3ec699cf6d297da 100644 (file)
     <Compile Include="Converters\Subtitles\SubtitleBehaviourConverter.cs" />\r
     <Compile Include="Converters\Video\VideoOptionsTooltipConverter.cs" />\r
     <Compile Include="Converters\Video\ScalingConverter.cs" />\r
+    <Compile Include="EventArgs\QueueCompletedEventArgs.cs" />\r
+    <Compile Include="EventArgs\QueueProgressEventArgs.cs" />\r
+    <Compile Include="EventArgs\SettingChangedEventArgs.cs" />\r
     <Compile Include="Extensions\StringExtensions.cs" />\r
     <Compile Include="Model\Audio\AudioBehaviourModes.cs" />\r
     <Compile Include="Model\Audio\AudioBehaviours.cs" />\r
     <Compile Include="Model\Picture\PresetPictureSettingsMode.cs" />\r
     <Compile Include="Model\Subtitles\SubtitleBehaviourModes.cs" />\r
     <Compile Include="Model\Subtitles\SubtitleBehaviours.cs" />\r
+    <Compile Include="Services\Interfaces\IQueueProcessor.cs" />\r
     <Compile Include="Services\Presets\Factories\PlistPresetFactory.cs" />\r
     <Compile Include="Helpers\FileHelper.cs" />\r
     <Compile Include="Services\Presets\Model\Preset.cs" />\r
     <Compile Include="Services\Interfaces\IUserSettingService.cs" />\r
     <Compile Include="Services\Presets\Model\PresetContainer.cs" />\r
     <Compile Include="Services\Presets\PresetService.cs" />\r
+    <Compile Include="Services\QueueProcessor.cs" />\r
     <Compile Include="Services\UserSettingService.cs" />\r
     <Compile Include="Utilities\AppcastReader.cs" />\r
     <Compile Include="Utilities\DelayedActionProcessor.cs" />\r
index 53ab407e27dba71fd1958511de332b7136884d87..ceb8943b8ffe6373a004dff472a7c2a11ea2b55c 100644 (file)
@@ -24,6 +24,8 @@ namespace HandBrakeWPF.Helpers
 \r
     using HandBrakeWPF.Services.Interfaces;\r
 \r
+    using IQueueProcessor = HandBrakeWPF.Services.Interfaces.IQueueProcessor;\r
+\r
     /// <summary>\r
     /// Queue Recovery Helper\r
     /// </summary>\r
similarity index 95%
rename from win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs
rename to win/CS/HandBrakeWPF/Services/Interfaces/IQueueProcessor.cs
index 4e5b51d930266e35e9d028c2ca589f80b1977559..b04c825d916eb77c2a27a5aec323b572c840d73a 100644 (file)
@@ -7,7 +7,7 @@
 // </summary>\r
 // --------------------------------------------------------------------------------------------------------------------\r
 \r
-namespace HandBrake.ApplicationServices.Services.Interfaces\r
+namespace HandBrakeWPF.Services.Interfaces\r
 {\r
     using System;\r
     using System.ComponentModel;\r
index d2f433bc13495d0b2e1400767b3a4327d62967bc..c8b34b7cd598324747c04030512e9844b088d27d 100644 (file)
@@ -9,7 +9,7 @@
 \r
 namespace HandBrakeWPF.Services.Interfaces\r
 {\r
-    using HandBrake.ApplicationServices.EventArgs;\r
+    using SettingChangedEventArgs = HandBrakeWPF.EventArgs.SettingChangedEventArgs;\r
 \r
     /// <summary>\r
     /// The setting event handler.\r
index 1a647a97083ead546554561ec4b5b8393fcb066f..0f387fec3d2459edc8f922022eb83406ff5217cd 100644 (file)
@@ -15,6 +15,8 @@ namespace HandBrakeWPF.Services
 \r
     using HandBrakeWPF.Services.Interfaces;\r
 \r
+    using IQueueProcessor = HandBrakeWPF.Services.Interfaces.IQueueProcessor;\r
+\r
     /// <summary>\r
     /// The Notification Service (Growl Connector)\r
     /// </summary>\r
index c579352392e3cd7facbcf61e93bbc233e63462eb..b8501b999985698966a52a157e1d85806b61300b 100644 (file)
@@ -9,21 +9,19 @@
 \r
 namespace HandBrakeWPF.Services\r
 {\r
+    using System;\r
     using System.Diagnostics;\r
     using System.Windows.Forms;\r
 \r
     using Caliburn.Micro;\r
 \r
-    using HandBrake.ApplicationServices.EventArgs;\r
     using HandBrake.ApplicationServices.Services.Encode.EventArgs;\r
-    using HandBrake.ApplicationServices.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Utilities;\r
 \r
+    using HandBrakeWPF.EventArgs;\r
     using HandBrakeWPF.Services.Interfaces;\r
     using HandBrakeWPF.ViewModels.Interfaces;\r
 \r
-    using Application = System.Windows.Application;\r
-\r
     /// <summary>\r
     /// The when done service.\r
     /// </summary>\r
@@ -76,7 +74,7 @@ namespace HandBrakeWPF.Services
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void EncodeService_EncodeStarted(object sender, System.EventArgs e)\r
+        private void EncodeService_EncodeStarted(object sender, EventArgs e)\r
         {\r
             if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep))\r
             {\r
@@ -134,7 +132,7 @@ namespace HandBrakeWPF.Services
 \r
             // Give the user the ability to cancel the shutdown. Default 60 second timer.\r
             ICountdownAlertViewModel titleSpecificView = IoC.Get<ICountdownAlertViewModel>();\r
-            Caliburn.Micro.Execute.OnUIThread(\r
+            Execute.OnUIThread(\r
                 () =>\r
                     {\r
                         titleSpecificView.SetAction(this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction));\r
@@ -153,16 +151,16 @@ namespace HandBrakeWPF.Services
                         Win32.ExitWindowsEx(0, 0);\r
                         break;\r
                     case "Suspend":\r
-                        System.Windows.Forms.Application.SetSuspendState(PowerState.Suspend, true, true);\r
+                        Application.SetSuspendState(PowerState.Suspend, true, true);\r
                         break;\r
                     case "Hibernate":\r
-                        System.Windows.Forms.Application.SetSuspendState(PowerState.Hibernate, true, true);\r
+                        Application.SetSuspendState(PowerState.Hibernate, true, true);\r
                         break;\r
                     case "Lock System":\r
                         Win32.LockWorkStation();\r
                         break;\r
                     case "Quit HandBrake":\r
-                        Execute.OnUIThread(() => Application.Current.Shutdown());\r
+                        Execute.OnUIThread(() => System.Windows.Application.Current.Shutdown());\r
                         break;\r
                 }\r
             }\r
@@ -180,8 +178,8 @@ namespace HandBrakeWPF.Services
                 !string.IsNullOrEmpty(this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo)))\r
             {\r
                 string args = string.Format(\r
-                    "{0} \"{1}\"",\r
-                    this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs),\r
+                    "{0} \"{1}\"", \r
+                    this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs), \r
                     file);\r
                 var vlc =\r
                     new ProcessStartInfo(\r
similarity index 95%
rename from win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
rename to win/CS/HandBrakeWPF/Services/QueueProcessor.cs
index ba6a3a92e74255cc102880e7a3c7f1be06190b83..414113d2fe7dd36aeaef06f4cf9595ea605f5ed8 100644 (file)
@@ -7,7 +7,7 @@
 // </summary>\r
 // --------------------------------------------------------------------------------------------------------------------\r
 \r
-namespace HandBrake.ApplicationServices.Services\r
+namespace HandBrakeWPF.Services\r
 {\r
     using System;\r
     using System.Collections.Generic;\r
@@ -18,14 +18,16 @@ namespace HandBrake.ApplicationServices.Services
 \r
     using Caliburn.Micro;\r
 \r
-    using HandBrake.ApplicationServices.EventArgs;\r
     using HandBrake.ApplicationServices.Exceptions;\r
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Services.Encode.EventArgs;\r
     using HandBrake.ApplicationServices.Services.Encode.Interfaces;\r
-    using HandBrake.ApplicationServices.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Utilities;\r
 \r
+    using IQueueProcessor = HandBrakeWPF.Services.Interfaces.IQueueProcessor;\r
+    using QueueCompletedEventArgs = HandBrakeWPF.EventArgs.QueueCompletedEventArgs;\r
+    using QueueProgressEventArgs = HandBrakeWPF.EventArgs.QueueProgressEventArgs;\r
+\r
     /// <summary>\r
     /// The HandBrake Queue\r
     /// </summary>\r
@@ -444,7 +446,7 @@ namespace HandBrake.ApplicationServices.Services
                 throw new Exception("Already Processing the Queue");\r
             }\r
 \r
-            clearCompleted = isClearCompleted;\r
+            this.clearCompleted = isClearCompleted;\r
 \r
             this.EncodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted;\r
             this.EncodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;\r
@@ -480,7 +482,7 @@ namespace HandBrake.ApplicationServices.Services
             this.LastProcessedJob.Status = QueueItemStatus.Completed;\r
 \r
             // Clear the completed item of the queue if the setting is set.\r
-            if (clearCompleted)\r
+            if (this.clearCompleted)\r
             {\r
                 this.ClearCompleted();\r
             }\r
index 6b7d87f1becdd3457ad0a5d42076acb52729f215..6c5c6629b690bb0bb049700112980f3ad4694fa1 100644 (file)
@@ -16,11 +16,12 @@ namespace HandBrakeWPF.Services
     using System.Reflection;\r
     using System.Xml.Serialization;\r
 \r
-    using HandBrake.ApplicationServices.EventArgs;\r
     using HandBrake.ApplicationServices.Exceptions;\r
 \r
     using HandBrakeWPF.Services.Interfaces;\r
 \r
+    using SettingChangedEventArgs = HandBrakeWPF.EventArgs.SettingChangedEventArgs;\r
+\r
     /// <summary>\r
     /// The User Setting Serivce\r
     /// </summary>\r
index c8b327cd368aacf2b7ca7bddca30d211a39ca7f9..617413bc8d925107157911520318d64dfe6d7f48 100644 (file)
@@ -56,8 +56,8 @@ namespace HandBrakeWPF.Startup
             this.windsorContainer.Register(Component.For<IEventAggregator>().ImplementedBy<EventAggregator>());\r
 \r
             // Initialise the ApplicationServices IWindsorInstaller\r
-            this.windsorContainer.Register(Component.For<IWindsorInstaller>().ImplementedBy<ServicesWindsorInstaller>());\r
-            this.windsorContainer.Install(windsorContainer.ResolveAll<IWindsorInstaller>());\r
+            // this.windsorContainer.Register(Component.For<IWindsorInstaller>().ImplementedBy<ServicesWindsorInstaller>());\r
+            // this.windsorContainer.Install(windsorContainer.ResolveAll<IWindsorInstaller>());\r
 \r
             // Services\r
             this.windsorContainer.Register(Component.For<IUpdateService>().ImplementedBy<UpdateService>().LifeStyle.Is(LifestyleType.Singleton));\r
@@ -67,6 +67,7 @@ namespace HandBrakeWPF.Startup
             this.windsorContainer.Register(Component.For<IPrePostActionService>().ImplementedBy<PrePostActionService>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<IUserSettingService>().ImplementedBy<UserSettingService>());\r
             this.windsorContainer.Register(Component.For<IPresetService>().ImplementedBy<PresetService>());\r
+            this.windsorContainer.Register(Component.For<IQueueProcessor>().ImplementedBy<QueueProcessor>());\r
 \r
             // Commands\r
             this.windsorContainer.Register(Component.For<IAdvancedEncoderOptionsCommand>().ImplementedBy<AdvancedEncoderOptionsCommand>().LifeStyle.Is(LifestyleType.Singleton));\r
index f204b084debad695c010e10c1ef1cee670ea0b9e..08662882c91243759bc3d796264cf4ef5fbeb635 100644 (file)
@@ -34,6 +34,7 @@ namespace HandBrakeWPF.ViewModels
     using HandBrake.ApplicationServices.Interop;\r
 \r
     using HandBrakeWPF.Commands;\r
+    using HandBrakeWPF.EventArgs;\r
     using HandBrakeWPF.Factories;\r
     using HandBrakeWPF.Helpers;\r
     using HandBrakeWPF.Model;\r
@@ -52,6 +53,8 @@ namespace HandBrakeWPF.ViewModels
 \r
     using Ookii.Dialogs.Wpf;\r
 \r
+    using IQueueProcessor = HandBrakeWPF.Services.Interfaces.IQueueProcessor;\r
+\r
     /// <summary>\r
     /// HandBrakes Main Window\r
     /// </summary>\r
@@ -2104,7 +2107,7 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        void QueueProcessorJobProcessingStarted(object sender, HandBrake.ApplicationServices.EventArgs.QueueProgressEventArgs e)\r
+        void QueueProcessorJobProcessingStarted(object sender, QueueProgressEventArgs e)\r
         {\r
             Execute.OnUIThread(\r
                () =>\r
@@ -2194,7 +2197,7 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void UserSettingServiceSettingChanged(object sender, HandBrake.ApplicationServices.EventArgs.SettingChangedEventArgs e)\r
+        private void UserSettingServiceSettingChanged(object sender, SettingChangedEventArgs e)\r
         {\r
             if (e.Key == UserSettingConstants.ShowAdvancedTab)\r
             {\r
index 7f5ba9b0073f41d673c658b707fdae5eeb74aa37..7191ad9b517f185eb32ce667c7deff314d583b4a 100644 (file)
@@ -15,12 +15,11 @@ namespace HandBrakeWPF.ViewModels
 \r
     using Caliburn.Micro;\r
 \r
-    using HandBrake.ApplicationServices.EventArgs;\r
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Services.Encode.EventArgs;\r
     using HandBrake.ApplicationServices.Services.Encode.Model;\r
-    using HandBrake.ApplicationServices.Services.Interfaces;\r
 \r
+    using HandBrakeWPF.EventArgs;\r
     using HandBrakeWPF.Properties;\r
     using HandBrakeWPF.Services.Interfaces;\r
     using HandBrakeWPF.ViewModels.Interfaces;\r
@@ -245,7 +244,7 @@ namespace HandBrakeWPF.ViewModels
             this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count);\r
             this.IsEncoding = false;\r
 \r
-            MessageBox.Show("The Queue has been paused. The currently running job will run to completion and no further jobs will start.", "Queue",\r
+            MessageBox.Show("The Queue has been paused. The currently running job will run to completion and no further jobs will start.", "Queue", \r
                 MessageBoxButton.OK, MessageBoxImage.Information);\r
         }\r
 \r
@@ -261,9 +260,9 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 MessageBoxResult result =\r
                     this.errorService.ShowMessageBox(\r
-                        "This encode is currently in progress. If you delete it, the encode will be stopped. Are you sure you wish to proceed?",\r
-                        Resources.Warning,\r
-                        MessageBoxButton.YesNo,\r
+                        "This encode is currently in progress. If you delete it, the encode will be stopped. Are you sure you wish to proceed?", \r
+                        Resources.Warning, \r
+                        MessageBoxButton.YesNo, \r
                         MessageBoxImage.Question);\r
 \r
                 if (result == MessageBoxResult.Yes)\r
@@ -317,9 +316,9 @@ namespace HandBrakeWPF.ViewModels
         {\r
             SaveFileDialog dialog = new SaveFileDialog\r
                 {\r
-                    Filter = "HandBrake Queue Files (*.hbq)|*.hbq",\r
-                    OverwritePrompt = true,\r
-                    DefaultExt = ".hbq",\r
+                    Filter = "HandBrake Queue Files (*.hbq)|*.hbq", \r
+                    OverwritePrompt = true, \r
+                    DefaultExt = ".hbq", \r
                     AddExtension = true\r
                 };\r
             if (dialog.ShowDialog() == true)\r
@@ -349,9 +348,9 @@ namespace HandBrakeWPF.ViewModels
         public void EditJob(QueueTask task)\r
         {\r
             MessageBoxResult result = this.errorService.ShowMessageBox(\r
-                "Are you sure you wish to edit this job? It will be removed from the queue and sent to the main window.",\r
-                "Modify Job?",\r
-                MessageBoxButton.YesNo,\r
+                "Are you sure you wish to edit this job? It will be removed from the queue and sent to the main window.", \r
+                "Modify Job?", \r
+                MessageBoxButton.YesNo, \r
                 MessageBoxImage.Question);\r
 \r
             if (result != MessageBoxResult.Yes)\r
@@ -420,17 +419,17 @@ namespace HandBrakeWPF.ViewModels
         /// </param>\r
         private void EncodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)\r
         {\r
-            Caliburn.Micro.Execute.OnUIThread(() =>\r
+            Execute.OnUIThread(() =>\r
             {\r
                 this.JobStatus =\r
                     string.Format(\r
-                        "Encoding: Pass {0} of {1},  {2:00.00}%, FPS: {3:000.0},  Avg FPS: {4:000.0},  Time Remaining: {5},  Elapsed: {6:hh\\:mm\\:ss}",\r
-                        e.Task,\r
-                        e.TaskCount,\r
-                        e.PercentComplete,\r
-                        e.CurrentFrameRate,\r
-                        e.AverageFrameRate,\r
-                        e.EstimatedTimeLeft,\r
+                        "Encoding: Pass {0} of {1},  {2:00.00}%, FPS: {3:000.0},  Avg FPS: {4:000.0},  Time Remaining: {5},  Elapsed: {6:hh\\:mm\\:ss}", \r
+                        e.Task, \r
+                        e.TaskCount, \r
+                        e.PercentComplete, \r
+                        e.CurrentFrameRate, \r
+                        e.AverageFrameRate, \r
+                        e.EstimatedTimeLeft, \r
                         e.ElapsedTime);\r
             });\r
         }\r
index e297db4224f4ba0aa2781af52045665a3b41667c..6d4fcc84a3ed9efa2d79b1eb0b02fb65956a556c 100644 (file)
@@ -20,6 +20,8 @@ namespace HandBrakeWPF.ViewModels
     using HandBrakeWPF.Services.Interfaces;\r
     using HandBrakeWPF.ViewModels.Interfaces;\r
 \r
+    using IQueueProcessor = HandBrakeWPF.Services.Interfaces.IQueueProcessor;\r
+\r
     /// <summary>\r
     /// The Shell View Model\r
     /// </summary>\r
index a975a8bcda112f772687e4eda40de86bde4577c1..5f1193cc79119cccbb435565375dd1769c7c0e61 100644 (file)
@@ -17,7 +17,6 @@ namespace HandBrakeWPF.ViewModels
 \r
     using Caliburn.Micro;\r
 \r
-    using HandBrake.ApplicationServices.EventArgs;\r
     using HandBrake.ApplicationServices.Services.Encode.Model;\r
     using HandBrake.ApplicationServices.Services.Encode.Model.Models;\r
     using HandBrake.ApplicationServices.Services.Encode.Model.Models.Video;\r
@@ -33,6 +32,7 @@ namespace HandBrakeWPF.ViewModels
     using HandBrakeWPF.ViewModels.Interfaces;\r
 \r
     using Clipboard = System.Windows.Clipboard;\r
+    using SettingChangedEventArgs = HandBrakeWPF.EventArgs.SettingChangedEventArgs;\r
 \r
     /// <summary>\r
     /// The Video View Model\r