summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Encode/Factories
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-04-11 11:11:40 +0100
committersr55 <[email protected]>2020-04-11 13:00:48 +0100
commitc3d62f1465fc9813d079bdf33f2e062a48ec8549 (patch)
tree9cdc71a68890a46a57c0982e563928fe40316e0d /win/CS/HandBrakeWPF/Services/Encode/Factories
parent30c15df16bc543f4d2ad828176c787cbc7b7c74e (diff)
WinGui: Stripping much of the remaining app config out of the Queue Jobs. Certain features such as QSV, while global options currently are not really global. I may move these out of perferences at a later point. Fixes #2753
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Encode/Factories')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/QueueFactory.cs70
1 files changed, 0 insertions, 70 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/QueueFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/QueueFactory.cs
deleted file mode 100644
index b17385b47..000000000
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/QueueFactory.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="QueueFactory.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>
-// Defines the QueueFactory type.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Services.Encode.Factories
-{
- using System.Collections.Generic;
-
- using Caliburn.Micro;
-
- using HandBrake.Interop.Interop.HbLib.Wrappers.Interfaces;
- using HandBrake.Interop.Interop.Json.Queue;
- using HandBrake.Interop.Interop.Providers.Interfaces;
- using HandBrake.Interop.Model;
-
- using HandBrakeWPF.Services.Encode.Model;
- using HandBrakeWPF.Services.Interfaces;
-
- using Newtonsoft.Json;
-
- /// <summary>
- /// The queue factory.
- /// </summary>
- public class QueueFactory
- {
- /// <summary>
- /// For a givent set of tasks, return the Queue JSON that can be used for the CLI.
- /// </summary>
- /// <param name="tasks">
- /// The tasks.
- /// </param>
- /// <param name="configuration">
- /// The configuration.
- /// </param>
- /// <returns>
- /// The <see cref="string"/>.
- /// </returns>
- public static string GetQueueJson(List<EncodeTask> tasks, HBConfiguration configuration)
- {
- JsonSerializerSettings settings = new JsonSerializerSettings
- {
- NullValueHandling = NullValueHandling.Ignore,
- };
-
- IHbFunctionsProvider provider = IoC.Get<IHbFunctionsProvider>(); // TODO remove IoC call.
- IHbFunctions hbFunctions = provider.GetHbFunctionsWrapper();
-
- List<Task> queueJobs = new List<Task>();
- foreach (var item in tasks)
- {
- Task task = new Task { Job = EncodeTaskFactory.Create(item, configuration, hbFunctions) };
- queueJobs.Add(task);
- }
-
- return JsonConvert.SerializeObject(queueJobs, Formatting.Indented, settings);
- }
-
- public static List<Task> GetQueue(string content)
- {
- JsonSerializerSettings settings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
- List<Task> tasks = JsonConvert.DeserializeObject<List<Task>>(content, settings);
- return tasks;
- }
- }
-}