+++ /dev/null
-// --------------------------------------------------------------------------------------------------------------------\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