diff options
author | sr55 <[email protected]> | 2014-11-29 18:36:54 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-11-29 18:36:54 +0000 |
commit | 0e8fddb81113a16689bb5c26a5844cb0c1260cec (patch) | |
tree | eda41ed99656ba86d225ec43802f7891e6d8436a /win/CS/HandBrake.ApplicationServices | |
parent | 7c0af498a9d5f7aae1e5c8d06b939c8189edcfbe (diff) |
WinGui: Part 1 - Restructuring the AppServices library in preparation for the new JSON API. Taking the opportunity to improve and simplify the API.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6568 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
26 files changed, 125 insertions, 125 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index d3d229d67..06a298a82 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -101,11 +101,7 @@ <Compile Include="EventArgs\QueueCompletedEventArgs.cs" />
<Compile Include="EventArgs\SettingChangedEventArgs.cs" />
<Compile Include="Exceptions\GeneralApplicationException.cs" />
- <Compile Include="EventArgs\EncodeCompletedEventArgs.cs" />
- <Compile Include="EventArgs\EncodeProgressEventArgs.cs" />
<Compile Include="EventArgs\QueueProgressEventArgs.cs" />
- <Compile Include="EventArgs\ScanCompletedEventArgs.cs" />
- <Compile Include="EventArgs\ScanProgressEventArgs.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Isolation\BackgroundServiceConnector.cs" />
<Compile Include="Isolation\IsolatedEncodeService.cs" />
@@ -117,9 +113,13 @@ <Compile Include="Model\Subtitle\SubtitleBehaviourModes.cs" />
<Compile Include="Model\Subtitle\SubtitleBehaviours.cs" />
<Compile Include="Model\VideoScaler.cs" />
- <Compile Include="Services\Interfaces\IEncodeServiceWrapper.cs" />
+ <Compile Include="Services\Encode\EventArgs\EncodeCompletedEventArgs.cs" />
+ <Compile Include="Services\Encode\EventArgs\EncodeProgressEventArgs.cs" />
+ <Compile Include="Services\Encode\Interfaces\IEncodeServiceWrapper.cs" />
<Compile Include="Services\Interfaces\IHbServiceCallback.cs" />
<Compile Include="Services\Interfaces\IServerService.cs" />
+ <Compile Include="Services\Scan\EventArgs\ScanCompletedEventArgs.cs" />
+ <Compile Include="Services\Scan\EventArgs\ScanProgressEventArgs.cs" />
<Compile Include="Services\ServerService.cs" />
<Compile Include="Utilities\Converters.cs" />
<Compile Include="Utilities\EnumHelper.cs" />
@@ -140,24 +140,24 @@ <Compile Include="Model\QueueItemStatus.cs" />
<Compile Include="Model\QueueTask.cs" />
<Compile Include="Model\Encoding\SubtitleType.cs" />
- <Compile Include="Parsing\Audio.cs" />
- <Compile Include="Parsing\Chapter.cs" />
- <Compile Include="Parsing\Source.cs" />
- <Compile Include="Parsing\Subtitle.cs" />
- <Compile Include="Parsing\Title.cs" />
+ <Compile Include="Services\Scan\Model\Audio.cs" />
+ <Compile Include="Services\Scan\Model\Chapter.cs" />
+ <Compile Include="Services\Scan\Model\Source.cs" />
+ <Compile Include="Services\Scan\Model\Subtitle.cs" />
+ <Compile Include="Services\Scan\Model\Title.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="ServicesWindsorInstaller.cs" />
- <Compile Include="Services\Base\EncodeBase.cs" />
- <Compile Include="Services\Encode.cs" />
- <Compile Include="Services\Interfaces\IEncode.cs" />
+ <Compile Include="Services\Encode\EncodeBase.cs" />
+ <Compile Include="Services\Encode\EncodeService.cs" />
+ <Compile Include="Services\Encode\Interfaces\IEncode.cs" />
<Compile Include="Services\Interfaces\IQueueProcessor.cs" />
- <Compile Include="Services\Interfaces\IScan.cs" />
- <Compile Include="Services\LibEncode.cs" />
- <Compile Include="Services\LibScan.cs" />
+ <Compile Include="Services\Scan\Interfaces\IScan.cs" />
+ <Compile Include="Services\Encode\LibEncode.cs" />
+ <Compile Include="Services\Scan\LibScan.cs" />
<Compile Include="Services\QueueProcessor.cs" />
<Compile Include="Utilities\CharCodesUtilities.cs" />
<Compile Include="Utilities\GeneralUtilities.cs" />
@@ -185,7 +185,9 @@ <Name>HandBrakeInterop</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup />
+ <ItemGroup>
+ <Folder Include="Services\Encode\Model\" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(ProgramFiles)\MSBuild\StyleCop\v4.*\StyleCop.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/win/CS/HandBrake.ApplicationServices/Isolation/BackgroundServiceConnector.cs b/win/CS/HandBrake.ApplicationServices/Isolation/BackgroundServiceConnector.cs index c92946bc1..5a1c69c72 100644 --- a/win/CS/HandBrake.ApplicationServices/Isolation/BackgroundServiceConnector.cs +++ b/win/CS/HandBrake.ApplicationServices/Isolation/BackgroundServiceConnector.cs @@ -18,6 +18,7 @@ namespace HandBrake.ApplicationServices.Isolation using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Isolation/IsolatedEncodeService.cs b/win/CS/HandBrake.ApplicationServices/Isolation/IsolatedEncodeService.cs index aeb99783c..a98941b1f 100644 --- a/win/CS/HandBrake.ApplicationServices/Isolation/IsolatedEncodeService.cs +++ b/win/CS/HandBrake.ApplicationServices/Isolation/IsolatedEncodeService.cs @@ -13,10 +13,10 @@ namespace HandBrake.ApplicationServices.Isolation using System;
using System.Threading;
- using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
/// <summary>
/// Isolated Scan Service.
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs index 157be8920..75e2bb1b3 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs @@ -15,7 +15,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding using Caliburn.Micro;
- using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs index 54861d75c..7be5dd3b9 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs @@ -13,7 +13,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding using Caliburn.Micro;
- using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
/// <summary>
/// Subtitle Information
diff --git a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs index 893ee6992..52ef771cb 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs @@ -11,7 +11,7 @@ namespace HandBrake.ApplicationServices.Model {
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
/// <summary>
/// The QueueTask.
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/EncodeBase.cs index d5ee86555..a805a714b 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/EncodeBase.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services.Base
+namespace HandBrake.ApplicationServices.Services.Encode
{
using System;
using System.Globalization;
@@ -15,10 +15,10 @@ namespace HandBrake.ApplicationServices.Services.Base using System.Text;
using System.Text.RegularExpressions;
- using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Utilities;
/// <summary>
@@ -56,7 +56,7 @@ namespace HandBrake.ApplicationServices.Services.Base public EncodeBase()
{
this.logBuffer = new StringBuilder();
- header = GeneralUtilities.CreateCliLogHeader();
+ this.header = GeneralUtilities.CreateCliLogHeader();
this.LogIndex = 0;
}
@@ -158,7 +158,7 @@ namespace HandBrake.ApplicationServices.Services.Base /// <param name="e">
/// The EventArgs.
/// </param>
- public void InvokeEncodeStarted(EventArgs e)
+ public void InvokeEncodeStarted(System.EventArgs e)
{
EventHandler handler = this.EncodeStarted;
if (handler != null)
@@ -304,7 +304,7 @@ namespace HandBrake.ApplicationServices.Services.Base /// </param>
protected void SetupLogging(QueueTask encodeQueueTask)
{
- ShutdownFileWriter();
+ this.ShutdownFileWriter();
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
string logFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.ProcessId));
string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", GeneralUtilities.ProcessId));
@@ -328,7 +328,7 @@ namespace HandBrake.ApplicationServices.Services.Base }
this.fileWriter = new StreamWriter(logFile) { AutoFlush = true };
- this.fileWriter.WriteLine(header);
+ this.fileWriter.WriteLine(this.header);
this.fileWriter.WriteLine(string.Format("CLI Query: {0}", query));
this.fileWriter.WriteLine();
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/EncodeService.cs index 318902c91..dad5b9597 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/EncodeService.cs @@ -1,5 +1,5 @@ // --------------------------------------------------------------------------------------------------------------------
-// <copyright file="Encode.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="EncodeService.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>
@@ -7,24 +7,23 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services
+namespace HandBrake.ApplicationServices.Services.Encode
{
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
- using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Base;
- using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Utilities;
/// <summary>
/// Class which handles the CLI
/// </summary>
- public class Encode : EncodeBase, IEncode
+ public class EncodeService : EncodeBase, IEncode
{
#region Private Variables
@@ -100,7 +99,7 @@ namespace HandBrake.ApplicationServices.Services {
try
{
- this.SetupLogging(currentTask);
+ this.SetupLogging(this.currentTask);
}
catch (Exception)
{
@@ -110,7 +109,7 @@ namespace HandBrake.ApplicationServices.Services }
// Make sure the path exists, attempt to create it if it doesn't
- this.VerifyEncodeDestinationPath(currentTask);
+ this.VerifyEncodeDestinationPath(this.currentTask);
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");
@@ -143,7 +142,7 @@ namespace HandBrake.ApplicationServices.Services this.HbProcess.BeginErrorReadLine();
}
- this.HbProcess.OutputDataReceived += HbProcess_OutputDataReceived;
+ this.HbProcess.OutputDataReceived += this.HbProcess_OutputDataReceived;
this.HbProcess.BeginOutputReadLine();
this.processId = this.HbProcess.Id;
@@ -179,7 +178,7 @@ namespace HandBrake.ApplicationServices.Services }
// Fire the Encode Started Event
- this.InvokeEncodeStarted(EventArgs.Empty);
+ this.InvokeEncodeStarted(System.EventArgs.Empty);
}
catch (Exception exc)
{
@@ -253,9 +252,9 @@ namespace HandBrake.ApplicationServices.Services /// <param name="e">
/// The EventArgs.
/// </param>
- private void HbProcessExited(object sender, EventArgs e)
+ private void HbProcessExited(object sender, System.EventArgs e)
{
- HbProcess.WaitForExit();
+ this.HbProcess.WaitForExit();
try
{
@@ -289,15 +288,15 @@ namespace HandBrake.ApplicationServices.Services {
if (!String.IsNullOrEmpty(e.Data))
{
- if (initShutdown && this.LogBuffer.Length < 25000000)
+ if (this.initShutdown && this.LogBuffer.Length < 25000000)
{
- initShutdown = false; // Reset this flag.
+ this.initShutdown = false; // Reset this flag.
}
- if (this.LogBuffer.Length > 25000000 && !initShutdown) // Approx 23.8MB and make sure it's only printed once
+ if (this.LogBuffer.Length > 25000000 && !this.initShutdown) // Approx 23.8MB and make sure it's only printed once
{
this.ProcessLogMessage("ERROR: Initiating automatic shutdown of encode process. The size of the log file indicates that there is an error! ");
- initShutdown = true;
+ this.initShutdown = true;
this.Stop();
}
diff --git a/win/CS/HandBrake.ApplicationServices/EventArgs/EncodeCompletedEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/EventArgs/EncodeCompletedEventArgs.cs index 2bbb7ab97..b77f3097c 100644 --- a/win/CS/HandBrake.ApplicationServices/EventArgs/EncodeCompletedEventArgs.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/EventArgs/EncodeCompletedEventArgs.cs @@ -7,17 +7,15 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.EventArgs
+namespace HandBrake.ApplicationServices.Services.Encode.EventArgs
{
using System;
using System.Runtime.Serialization;
- using HandBrake.ApplicationServices.Model;
-
/// <summary>
/// Encode Progress Event Args
/// </summary>
- [DataContractAttribute]
+ [DataContract]
public class EncodeCompletedEventArgs : EventArgs
{
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/EventArgs/EncodeProgressEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/EventArgs/EncodeProgressEventArgs.cs index 37cb76f25..1b93434da 100644 --- a/win/CS/HandBrake.ApplicationServices/EventArgs/EncodeProgressEventArgs.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/EventArgs/EncodeProgressEventArgs.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.EventArgs
+namespace HandBrake.ApplicationServices.Services.Encode.EventArgs
{
using System;
using System.Runtime.Serialization;
@@ -15,7 +15,7 @@ namespace HandBrake.ApplicationServices.EventArgs /// <summary>
/// Encode Progress Event Args
/// </summary>
- [DataContractAttribute]
+ [DataContract]
public class EncodeProgressEventArgs : EventArgs
{
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Interfaces/IEncode.cs index dec7d25b3..90c42149b 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Interfaces/IEncode.cs @@ -7,12 +7,12 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services.Interfaces
+namespace HandBrake.ApplicationServices.Services.Encode.Interfaces
{
using System;
- using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
/// <summary>
/// Encode Progess Status
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncodeServiceWrapper.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Interfaces/IEncodeServiceWrapper.cs index 95f20e455..6163bcffc 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncodeServiceWrapper.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Interfaces/IEncodeServiceWrapper.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services.Interfaces
+namespace HandBrake.ApplicationServices.Services.Encode.Interfaces
{
/// <summary>
/// EncodeServiceWrapper Interface
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index e62c1cc2c..8a046e0af 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -7,22 +7,21 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services
+namespace HandBrake.ApplicationServices.Services.Encode
{
using System;
using System.Diagnostics;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Base;
- using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
using HandBrake.Interop.EventArgs;
using HandBrake.Interop.Interfaces;
using HandBrake.Interop.Model;
- using EncodeCompletedEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs;
- using EncodeProgressEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs;
+ using EncodeCompletedEventArgs = HandBrake.ApplicationServices.Services.Encode.EventArgs.EncodeCompletedEventArgs;
+ using EncodeProgressEventArgs = HandBrake.ApplicationServices.Services.Encode.EventArgs.EncodeProgressEventArgs;
/// <summary>
/// LibHB Implementation of IEncode
@@ -98,10 +97,10 @@ namespace HandBrake.ApplicationServices.Services // Create a new HandBrake instance
// Setup the HandBrake Instance
- instance = new HandBrakeInstance();
- instance.Initialize(1);
- instance.EncodeCompleted += this.InstanceEncodeCompleted;
- instance.EncodeProgress += this.InstanceEncodeProgress;
+ this.instance = new HandBrakeInstance();
+ this.instance.Initialize(1);
+ this.instance.EncodeCompleted += this.InstanceEncodeCompleted;
+ this.instance.EncodeProgress += this.InstanceEncodeProgress;
try
{
@@ -132,11 +131,11 @@ namespace HandBrake.ApplicationServices.Services // We have to scan the source again but only the title so the HandBrake instance is initialised correctly.
// Since the UI sends the crop params down, we don't have to do all the previews.
- instance.StartScan(job.Task.Source, job.Configuration.PreviewScanCount, job.Task.Title);
+ this.instance.StartScan(job.Task.Source, job.Configuration.PreviewScanCount, job.Task.Title);
- instance.ScanCompleted += delegate
+ this.instance.ScanCompleted += delegate
{
- ScanCompleted(job, instance);
+ this.ScanCompleted(job, this.instance);
};
}
catch (Exception exc)
@@ -211,7 +210,7 @@ namespace HandBrake.ApplicationServices.Services instance.StartEncode(encodeJob, job.Configuration.PreviewScanCount);
// Fire the Encode Started Event
- this.InvokeEncodeStarted(EventArgs.Empty);
+ this.InvokeEncodeStarted(System.EventArgs.Empty);
// Set the Process Priority
switch (job.Configuration.ProcessPriority)
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs index 6f4d9a260..ce95bd8b5 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IHbServiceCallback.cs @@ -11,7 +11,7 @@ namespace HandBrake.ApplicationServices.Services.Interfaces {
using System.ServiceModel;
- using HandBrake.ApplicationServices.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
/// <summary>
/// HandBrake WCF Service Callbacks
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs index 8fb61109a..7cb0ef7b6 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs @@ -13,6 +13,7 @@ namespace HandBrake.ApplicationServices.Services.Interfaces using System.ComponentModel;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
/// <summary>
/// The Queue Processor
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index e74f25391..ab1b4c2cb 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -21,6 +21,8 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
diff --git a/win/CS/HandBrake.ApplicationServices/EventArgs/ScanCompletedEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/EventArgs/ScanCompletedEventArgs.cs index 6ab67d3ec..8e54cda12 100644 --- a/win/CS/HandBrake.ApplicationServices/EventArgs/ScanCompletedEventArgs.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/EventArgs/ScanCompletedEventArgs.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.EventArgs
+namespace HandBrake.ApplicationServices.Services.Scan.EventArgs
{
using System;
using System.Runtime.Serialization;
@@ -15,7 +15,7 @@ namespace HandBrake.ApplicationServices.EventArgs /// <summary>
/// Scan Progress Event Args
/// </summary>
- [DataContractAttribute]
+ [DataContract]
public class ScanCompletedEventArgs : EventArgs
{
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/EventArgs/ScanProgressEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/EventArgs/ScanProgressEventArgs.cs index ff84bd7d5..9c71cdd0f 100644 --- a/win/CS/HandBrake.ApplicationServices/EventArgs/ScanProgressEventArgs.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/EventArgs/ScanProgressEventArgs.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.EventArgs
+namespace HandBrake.ApplicationServices.Services.Scan.EventArgs
{
using System;
using System.Runtime.Serialization;
@@ -15,7 +15,7 @@ namespace HandBrake.ApplicationServices.EventArgs /// <summary>
/// Scan Progress Event Args
/// </summary>
- [DataContractAttribute]
+ [DataContract]
public class ScanProgressEventArgs : EventArgs
{
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Interfaces/IScan.cs index 05bc52499..ca0a10ea6 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Interfaces/IScan.cs @@ -7,14 +7,14 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services.Interfaces
+namespace HandBrake.ApplicationServices.Services.Scan.Interfaces
{
using System;
using System.Windows.Media.Imaging;
- using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Scan.EventArgs;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
/// <summary>
/// Encode Progess Status
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index 1bcde0aed..e50d5ac1b 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -7,19 +7,18 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Services
+namespace HandBrake.ApplicationServices.Services.Scan
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
- using System.Text.RegularExpressions;
using System.Windows.Media.Imaging;
- using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Services.Scan.EventArgs;
+ using HandBrake.ApplicationServices.Services.Scan.Interfaces;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
using HandBrake.Interop.EventArgs;
@@ -27,13 +26,12 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.Interop.Model;
using HandBrake.Interop.SourceData;
- using AudioTrack = HandBrake.ApplicationServices.Parsing.Audio;
- using Chapter = HandBrake.ApplicationServices.Parsing.Chapter;
+ using Chapter = HandBrake.ApplicationServices.Services.Scan.Model.Chapter;
using ScanProgressEventArgs = HandBrake.Interop.EventArgs.ScanProgressEventArgs;
using Size = System.Drawing.Size;
- using Subtitle = HandBrake.ApplicationServices.Parsing.Subtitle;
+ using Subtitle = HandBrake.ApplicationServices.Services.Scan.Model.Subtitle;
using SubtitleType = HandBrake.ApplicationServices.Model.Encoding.SubtitleType;
- using Title = HandBrake.ApplicationServices.Parsing.Title;
+ using Title = HandBrake.ApplicationServices.Services.Scan.Model.Title;
/// <summary>
/// Scan a Source
@@ -101,9 +99,9 @@ namespace HandBrake.ApplicationServices.Services /// </summary>
public LibScan()
{
- logging = new StringBuilder();
+ this.logging = new StringBuilder();
- header = GeneralUtilities.CreateCliLogHeader();
+ this.header = GeneralUtilities.CreateCliLogHeader();
try
{
@@ -182,13 +180,13 @@ namespace HandBrake.ApplicationServices.Services public void Scan(string sourcePath, int title, Action<bool> postAction, HBConfiguration configuraiton)
{
// Try to cleanup any previous scan instances.
- if (instance != null)
+ if (this.instance != null)
{
try
{
this.scanLog.Close();
this.scanLog.Dispose();
- instance.Dispose();
+ this.instance.Dispose();
}
catch (Exception)
{
@@ -197,7 +195,7 @@ namespace HandBrake.ApplicationServices.Services }
// Handle the post scan operation.
- postScanOperation = postAction;
+ this.postScanOperation = postAction;
// Clear down the logging
this.logging.Clear();
@@ -205,9 +203,9 @@ namespace HandBrake.ApplicationServices.Services try
{
// Make we don't pick up a stale last_scan_log_xyz.txt (and that we have rights to the file)
- if (File.Exists(dvdInfoPath))
+ if (File.Exists(this.dvdInfoPath))
{
- File.Delete(dvdInfoPath);
+ File.Delete(this.dvdInfoPath);
}
}
catch (Exception)
@@ -215,19 +213,19 @@ namespace HandBrake.ApplicationServices.Services // Do nothing.
}
- if (!Directory.Exists(Path.GetDirectoryName(dvdInfoPath)))
+ if (!Directory.Exists(Path.GetDirectoryName(this.dvdInfoPath)))
{
- Directory.CreateDirectory(Path.GetDirectoryName(dvdInfoPath));
+ Directory.CreateDirectory(Path.GetDirectoryName(this.dvdInfoPath));
}
// Create a new scan log.
- scanLog = new StreamWriter(dvdInfoPath);
+ this.scanLog = new StreamWriter(this.dvdInfoPath);
// Create a new HandBrake Instance.
- instance = new HandBrakeInstance();
- instance.Initialize(1);
- instance.ScanProgress += this.InstanceScanProgress;
- instance.ScanCompleted += this.InstanceScanCompleted;
+ this.instance = new HandBrakeInstance();
+ this.instance.Initialize(1);
+ this.instance.ScanProgress += this.InstanceScanProgress;
+ this.instance.ScanCompleted += this.InstanceScanCompleted;
// Start the scan on a back
this.ScanSource(sourcePath, title, configuraiton.PreviewScanCount, configuraiton);
@@ -238,7 +236,7 @@ namespace HandBrake.ApplicationServices.Services /// </summary>
public void Stop()
{
- instance.StopScan();
+ this.instance.StopScan();
try
{
@@ -315,11 +313,11 @@ namespace HandBrake.ApplicationServices.Services string source = sourcePath.ToString().EndsWith("\\") ? string.Format("\"{0}\\\\\"", sourcePath.ToString().TrimEnd('\\'))
: "\"" + sourcePath + "\"";
- currentSourceScanPath = source;
+ this.currentSourceScanPath = source;
- IsScanning = true;
+ this.IsScanning = true;
if (this.ScanStared != null)
- this.ScanStared(this, new EventArgs());
+ this.ScanStared(this, System.EventArgs.Empty);
TimeSpan minDuration =
TimeSpan.FromSeconds(
@@ -350,7 +348,7 @@ namespace HandBrake.ApplicationServices.Services /// <param name="e">
/// The EventArgs.
/// </param>
- private void InstanceScanCompleted(object sender, EventArgs e)
+ private void InstanceScanCompleted(object sender, System.EventArgs e)
{
// Write the log file out before we start processing incase we crash.
try
@@ -366,20 +364,20 @@ namespace HandBrake.ApplicationServices.Services }
// TODO -> Might be a better place to fix this.
- string path = currentSourceScanPath;
- if (currentSourceScanPath.Contains("\""))
+ string path = this.currentSourceScanPath;
+ if (this.currentSourceScanPath.Contains("\""))
{
- path = currentSourceScanPath.Trim('\"');
+ path = this.currentSourceScanPath.Trim('\"');
}
// Process into internal structures.
this.SouceData = new Source { Titles = ConvertTitles(this.instance.Titles, this.instance.FeatureTitle), ScanPath = path };
- IsScanning = false;
+ this.IsScanning = false;
- if (postScanOperation != null)
+ if (this.postScanOperation != null)
{
- postScanOperation(true);
+ this.postScanOperation(true);
}
else
{
@@ -400,8 +398,8 @@ namespace HandBrake.ApplicationServices.Services {
if (this.ScanStatusChanged != null)
{
- ApplicationServices.EventArgs.ScanProgressEventArgs eventArgs =
- new ApplicationServices.EventArgs.ScanProgressEventArgs
+ EventArgs.ScanProgressEventArgs eventArgs =
+ new EventArgs.ScanProgressEventArgs
{
CurrentTitle = e.CurrentTitle,
Titles = e.Titles,
@@ -496,7 +494,7 @@ namespace HandBrake.ApplicationServices.Services foreach (Interop.SourceData.AudioTrack track in title.AudioTracks)
{
- converted.AudioTracks.Add(new AudioTrack(track.TrackNumber, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.Bitrate));
+ converted.AudioTracks.Add(new Audio(track.TrackNumber, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.Bitrate));
}
foreach (Interop.SourceData.Subtitle track in title.Subtitles)
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Audio.cs index 942ae37a1..f8b40a430 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Audio.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Parsing
+namespace HandBrake.ApplicationServices.Services.Scan.Model
{
using System;
@@ -156,7 +156,7 @@ namespace HandBrake.ApplicationServices.Parsing return false;
}
- return Equals((Audio)obj);
+ return this.Equals((Audio)obj);
}
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Chapter.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Chapter.cs index 0b0a741a0..6bb2a3fcf 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Chapter.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Chapter.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Parsing
+namespace HandBrake.ApplicationServices.Services.Scan.Model
{
using System;
using System.Globalization;
@@ -64,7 +64,7 @@ namespace HandBrake.ApplicationServices.Parsing /// <returns>A string formatted as: {chapter #}</returns>
public override string ToString()
{
- return ChapterNumber.ToString(CultureInfo.InvariantCulture);
+ return this.ChapterNumber.ToString(CultureInfo.InvariantCulture);
}
}
}
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Source.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Source.cs index 5f721e3a6..27c7e938d 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Source.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Source.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Parsing
+namespace HandBrake.ApplicationServices.Services.Scan.Model
{
using System.Collections.Generic;
using System.Runtime.Serialization;
@@ -24,7 +24,7 @@ namespace HandBrake.ApplicationServices.Parsing /// </summary>
public Source()
{
- Titles = new List<Title>();
+ this.Titles = new List<Title>();
}
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Subtitle.cs index 3b026bdf5..3da9e4a2e 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Subtitle.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Parsing
+namespace HandBrake.ApplicationServices.Services.Scan.Model
{
using System;
using System.Xml.Serialization;
@@ -181,7 +181,7 @@ namespace HandBrake.ApplicationServices.Parsing return false;
}
- return Equals((Subtitle)obj);
+ return this.Equals((Subtitle)obj);
}
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs index 969640b20..ad6b291d1 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs @@ -7,7 +7,7 @@ // </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrake.ApplicationServices.Parsing
+namespace HandBrake.ApplicationServices.Services.Scan.Model
{
using System;
using System.Collections.Generic;
@@ -139,7 +139,7 @@ namespace HandBrake.ApplicationServices.Parsing this.Playlist = string.Format(" {0}", this.Playlist);
}
- return string.Format("{0}{1} ({2:00}:{3:00}:{4:00})", TitleNumber, Playlist, Duration.Hours, Duration.Minutes, Duration.Seconds);
+ return string.Format("{0}{1} ({2:00}:{3:00}:{4:00})", this.TitleNumber, this.Playlist, this.Duration.Hours, this.Duration.Minutes, this.Duration.Seconds);
}
}
}
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs b/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs index 39dc86471..d0f1b6a99 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs @@ -15,11 +15,11 @@ namespace HandBrake.ApplicationServices.Services using System.Threading;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Services.Encode;
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Interfaces;
- using EncodeCompletedEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs;
- using EncodeProgressEventArgs = HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs;
-
/// <summary>
/// HandBrake WCF Service
/// </summary>
|