summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2019-09-08 12:39:35 +0100
committersr55 <[email protected]>2019-09-08 12:39:35 +0100
commit3639be01cf58aa2085ddd48836c52c11a1597c73 (patch)
tree916a34db6122975685e9a83977949d70ab87eb28 /win
parent258118e4fdc674fde411c8a4131c611e9e35c773 (diff)
WinGui: Make a note of what the base preset was in the log when starting an encode #2298
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs6
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs11
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs1
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs7
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/QueueService.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs4
7 files changed, 24 insertions, 10 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
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 4c322f5f4..6d1ce70ce 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1392,7 +1392,7 @@ namespace HandBrakeWPF.ViewModels
return new AddQueueError(Resources.Subtitles_WebmSubtitleIncompatibilityHeader, Resources.Main_PleaseFixSubtitleSettings, MessageBoxButton.OK, MessageBoxImage.Error);
}
- QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath, this.SelectedPreset);
+ QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath, this.SelectedPreset, this.IsModifiedPreset);
if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination))
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index afb3ea885..41b4fe84e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -619,7 +619,7 @@ namespace HandBrakeWPF.ViewModels
encodeTask.SubtitleTracks.Remove(scanTrack);
}
- QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource.ScanPath, null);
+ QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource.ScanPath, null, false);
ThreadPool.QueueUserWorkItem(this.CreatePreview, task);
}
@@ -705,7 +705,7 @@ namespace HandBrakeWPF.ViewModels
this.encodeService.EncodeCompleted += this.encodeService_EncodeCompleted;
this.encodeService.EncodeStatusChanged += this.encodeService_EncodeStatusChanged;
- this.encodeService.Start(((QueueTask)state).Task, ((QueueTask)state).Configuration);
+ this.encodeService.Start(((QueueTask)state).Task, ((QueueTask)state).Configuration, null);
this.userSettingService.SetUserSetting(UserSettingConstants.LastPreviewDuration, this.Duration);
}