From 49c029031755e78e10cc4c0d004dc93d42714566 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 9 Jan 2011 14:37:29 +0000 Subject: WinGui: - Continuing on with the Application Services re-factoring: * Added new QueueManager - Manages queue jobs, add, remove, up, down, save, etc * Queue Processor - Processes a Queue * New Models (Encode Task + associated model objects) Used for storing jobs as an object rather than query. This code isn't used yet, that is coming later. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3738 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Controls/AudioPanel.cs | 3 +- win/C#/Controls/Subtitles.cs | 9 +- win/C#/Functions/Main.cs | 4 +- win/C#/Functions/QueryParser.cs | 3 + .../EventArgs/QueueProgressEventArgs.cs | 4 +- .../Functions/Logging.cs | 2 +- .../HandBrake.ApplicationServices.csproj | 29 +- .../Model/Cropping.cs | 56 ---- .../Model/EncodeTask.cs | 274 +++++++++++++++++ .../Model/Encoding/Anamorphic.cs | 19 ++ .../Model/Encoding/AudioEncoder.cs | 28 ++ .../Model/Encoding/AudioTrack.cs | 56 ++++ .../Model/Encoding/Cropping.cs | 56 ++++ .../Model/Encoding/Decomb.cs | 12 + .../Model/Encoding/Deinterlace.cs | 11 + .../Model/Encoding/Denoise.cs | 11 + .../Model/Encoding/Detelecine.cs | 9 + .../Model/Encoding/Mixdown.cs | 28 ++ .../Model/Encoding/OutputFormat.cs | 19 ++ .../Model/Encoding/PointToPointMode.cs | 12 + .../Model/Encoding/SubtitleTrack.cs | 95 ++++++ .../Model/Encoding/SubtitleType.cs | 30 ++ .../Model/Encoding/VideoEncodeRateType.cs | 9 + .../Model/Encoding/VideoEncoder.cs | 16 + win/C#/HandBrake.ApplicationServices/Model/Job.cs | 55 ---- .../Model/QueueTask.cs | 66 ++++ .../Model/SubtitleType.cs | 30 -- .../Parsing/Subtitle.cs | 2 +- .../HandBrake.ApplicationServices/Parsing/Title.cs | 1 + .../Services/Encode.cs | 6 +- .../Services/Interfaces/IQueue.cs | 6 +- .../Services/Interfaces/IQueueManager.cs | 113 +++++++ .../Services/Interfaces/IQueueProcessor.cs | 51 ++++ .../Services/Queue.cs | 34 +-- .../Services/QueueManager.cs | 338 +++++++++++++++++++++ .../Services/QueueProcessor.cs | 283 +++++++++++++++++ win/C#/HandBrake.ApplicationServices/app.config | 14 +- win/C#/HandBrake10.5.1.ReSharper | 1 + win/C#/HandBrakeCS.csproj | 2 - win/C#/Model/AudioTrack.cs | 56 ---- win/C#/Model/Subtitle.cs | 93 ------ win/C#/Presets/PlistPresetHandler.cs | 3 + win/C#/frmMain.cs | 4 +- win/C#/frmQueue.cs | 5 +- 44 files changed, 1618 insertions(+), 340 deletions(-) delete mode 100644 win/C#/HandBrake.ApplicationServices/Model/Cropping.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/EncodeTask.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Anamorphic.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/AudioEncoder.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Cropping.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Decomb.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Deinterlace.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Denoise.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Detelecine.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/Mixdown.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/OutputFormat.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/PointToPointMode.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/SubtitleType.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/VideoEncodeRateType.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/Encoding/VideoEncoder.cs delete mode 100644 win/C#/HandBrake.ApplicationServices/Model/Job.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Model/QueueTask.cs delete mode 100644 win/C#/HandBrake.ApplicationServices/Model/SubtitleType.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueueManager.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Services/QueueManager.cs create mode 100644 win/C#/HandBrake.ApplicationServices/Services/QueueProcessor.cs delete mode 100644 win/C#/Model/AudioTrack.cs delete mode 100644 win/C#/Model/Subtitle.cs (limited to 'win') diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs index e5f37d675..7226ed1de 100644 --- a/win/C#/Controls/AudioPanel.cs +++ b/win/C#/Controls/AudioPanel.cs @@ -14,7 +14,8 @@ namespace Handbrake.Controls using HandBrake.ApplicationServices.Parsing; using Presets; - using AudioTrack = Model.AudioTrack; + + using AudioTrack = HandBrake.ApplicationServices.Model.Encoding.AudioTrack; /// /// The AudioPanel Control diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs index 29c127244..0a5240955 100644 --- a/win/C#/Controls/Subtitles.cs +++ b/win/C#/Controls/Subtitles.cs @@ -13,6 +13,7 @@ namespace Handbrake.Controls using Functions; using HandBrake.ApplicationServices.Model; + using HandBrake.ApplicationServices.Model.Encoding; using Model; @@ -36,7 +37,7 @@ namespace Handbrake.Controls /// /// The Subtitle List /// - private readonly List subList = new List(); + private readonly List subList = new List(); #endregion @@ -82,7 +83,7 @@ namespace Handbrake.Controls int srtCount = 0; int subCount = 0; - foreach (SubtitleInfo item in subList) + foreach (SubtitleTrack item in subList) { string itemToAdd; @@ -273,7 +274,7 @@ namespace Handbrake.Controls ? srtLangVal + " (" + srtFile + ")" : drp_subtitleTracks.SelectedItem.ToString(); - SubtitleInfo track = new SubtitleInfo + SubtitleTrack track = new SubtitleTrack { Track = trackName, Forced = check_forced.Checked, @@ -347,7 +348,7 @@ namespace Handbrake.Controls // Set the dropdown controls based on the selected item in the List. if (lv_subList.Items.Count != 0 && lv_subList.SelectedIndices.Count != 0) { - SubtitleInfo track = subList[lv_subList.SelectedIndices[0]]; + SubtitleTrack track = subList[lv_subList.SelectedIndices[0]]; int c = 0; if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.ToLower().Contains(".srt")) diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 18919fee8..2edfd1568 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -35,7 +35,7 @@ namespace Handbrake.Functions /// /// The XML Serializer /// - private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List)); + private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List)); /// /// Calculate the duration of the selected title and chapters @@ -385,7 +385,7 @@ namespace Handbrake.Functions using (FileStream strm = new FileStream(Path.Combine(file.DirectoryName, file.Name), FileMode.Open, FileAccess.Read)) { - List list = Ser.Deserialize(strm) as List; + List list = Ser.Deserialize(strm) as List; if (list != null) { if (list.Count != 0) diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs index 01344c83c..076444660 100644 --- a/win/C#/Functions/QueryParser.cs +++ b/win/C#/Functions/QueryParser.cs @@ -9,6 +9,9 @@ namespace Handbrake.Functions using System.Collections; using System.Globalization; using System.Text.RegularExpressions; + + using HandBrake.ApplicationServices.Model.Encoding; + using Model; /// diff --git a/win/C#/HandBrake.ApplicationServices/EventArgs/QueueProgressEventArgs.cs b/win/C#/HandBrake.ApplicationServices/EventArgs/QueueProgressEventArgs.cs index c2af07fb1..8613187bc 100644 --- a/win/C#/HandBrake.ApplicationServices/EventArgs/QueueProgressEventArgs.cs +++ b/win/C#/HandBrake.ApplicationServices/EventArgs/QueueProgressEventArgs.cs @@ -20,7 +20,7 @@ namespace HandBrake.ApplicationServices.EventArgs /// /// The new job. /// - public QueueProgressEventArgs(Job newJob) + public QueueProgressEventArgs(QueueTask newJob) { this.NewJob = newJob; } @@ -28,6 +28,6 @@ namespace HandBrake.ApplicationServices.EventArgs /// /// Gets or sets the new job which is about to be processed. /// - public Job NewJob { get; set; } + public QueueTask NewJob { get; set; } } } diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs index 8231ba6cc..1bb08cdfb 100644 --- a/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs +++ b/win/C#/HandBrake.ApplicationServices/Functions/Logging.cs @@ -26,7 +26,7 @@ namespace HandBrake.ApplicationServices.Functions /// /// The create cli log header. /// - public static string CreateCliLogHeader(Job encJob) + public static string CreateCliLogHeader(QueueTask encJob) { StringBuilder logHeader = new StringBuilder(); diff --git a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 38a49c1f4..8938827bd 100644 --- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -16,6 +16,8 @@ 3.5 + + true @@ -90,9 +92,23 @@ - - - + + + + + + + + + + + + + + + + + @@ -108,8 +124,12 @@ + + + + @@ -133,6 +153,9 @@ HandBrake.Framework + + +