diff options
author | sr55 <[email protected]> | 2019-09-08 12:39:35 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-09-08 12:39:35 +0100 |
commit | 3639be01cf58aa2085ddd48836c52c11a1597c73 (patch) | |
tree | 916a34db6122975685e9a83977949d70ab87eb28 /win/CS/HandBrakeWPF/Services | |
parent | 258118e4fdc674fde411c8a4131c611e9e35c773 (diff) |
WinGui: Make a note of what the base preset was in the log when starting an encode #2298
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
5 files changed, 21 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs b/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs index 871f31615..0a75ce009 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs @@ -78,7 +78,10 @@ namespace HandBrakeWPF.Services.Encode.Interfaces /// <param name="configuration"> /// The configuration. /// </param> - void Start(EncodeTask job, HBConfiguration configuration); + /// <param name="basePresetName"> + /// Name of the base preset used for logging purposes. + /// </param> + void Start(EncodeTask job, HBConfiguration configuration, string basePresetName); /// <summary> /// The pause. @@ -95,7 +98,6 @@ namespace HandBrakeWPF.Services.Encode.Interfaces /// </summary> void Stop(); - /// <summary> /// Get a copy of the Active job /// </summary> diff --git a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs index f3ff75fcc..188e6bb35 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs @@ -60,7 +60,7 @@ namespace HandBrakeWPF.Services.Encode /// <param name="configuration"> /// The configuration. /// </param> - public void Start(EncodeTask task, HBConfiguration configuration) + public void Start(EncodeTask task, HBConfiguration configuration, string basePresetName) { try { @@ -96,6 +96,10 @@ namespace HandBrakeWPF.Services.Encode } this.ServiceLogMessage("Starting Encode ..."); + if (!string.IsNullOrEmpty(basePresetName)) + { + this.TimedLogMessage(string.Format("base preset: {0}", basePresetName)); + } this.instance = task.IsPreviewEncode ? HandBrakeInstanceManager.GetPreviewInstance(configuration.Verbosity, configuration) : HandBrakeInstanceManager.GetEncodeInstance(configuration.Verbosity, configuration); @@ -191,6 +195,11 @@ namespace HandBrakeWPF.Services.Encode this.log.LogMessage(string.Format("{0}# {1}{0}", Environment.NewLine, message), LogMessageType.ScanOrEncode, LogLevel.Info); } + protected void TimedLogMessage(string message) + { + this.log.LogMessage(string.Format("[{0}] {1}", DateTime.Now.ToString("hh:mm:ss"), message), LogMessageType.ScanOrEncode, LogLevel.Info); + } + /// <summary> /// Encode Progress Event Handler /// </summary> diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index a61cd0bf0..56a45ba9e 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -36,7 +36,6 @@ namespace HandBrakeWPF.Services.Encode.Model public class EncodeTask { - public EncodeTask() { this.Cropping = new Cropping(); diff --git a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs index f3d7bb6e4..52a77f714 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs @@ -22,7 +22,6 @@ namespace HandBrakeWPF.Services.Queue.Model using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
-
public class QueueTask : PropertyChangedBase
{
private static int id;
@@ -37,7 +36,7 @@ namespace HandBrakeWPF.Services.Queue.Model this.Statistics = new QueueStats();
}
- public QueueTask(EncodeTask task, HBConfiguration configuration, string scannedSourcePath, Preset currentPreset)
+ public QueueTask(EncodeTask task, HBConfiguration configuration, string scannedSourcePath, Preset currentPreset, bool isPresetModified)
{
this.Task = task;
this.Configuration = configuration;
@@ -46,6 +45,10 @@ namespace HandBrakeWPF.Services.Queue.Model if (currentPreset != null)
{
this.presetKey = currentPreset.Name;
+ if (isPresetModified)
+ {
+ this.presetKey = this.presetKey + " (Modified)";
+ }
}
id = id + 1;
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs index 90c9d7ded..c5fe5e9e3 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs @@ -16,6 +16,7 @@ namespace HandBrakeWPF.Services.Queue using System.Diagnostics; using System.IO; using System.Linq; + using System.Windows.Media.Imaging; using HandBrake.Interop.Interop.Json.Queue; using HandBrake.Interop.Model; @@ -508,7 +509,7 @@ namespace HandBrakeWPF.Services.Queue return; } - this.EncodeService.Start(job.Task, job.Configuration); + this.EncodeService.Start(job.Task, job.Configuration, job.SelectedPresetKey); this.BackupQueue(string.Empty); } else |