summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Converters
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-06-19 20:26:35 +0100
committersr55 <[email protected]>2020-06-19 20:26:35 +0100
commite8d5cc79660cf7e3671c4cfab51da54451e5b14c (patch)
tree94d8421e26f6a4e710ff8522e519d408779cccca /win/CS/HandBrakeWPF/Converters
parent0dc75f3ec8a6724a5c0315003948d1957dffe0f2 (diff)
WinGui: Minor tweaks to the queue summary screen.
- Added the same Filters summary that exists on the main window summary tab to the queue summary window. - Compacted the Advanced summary from 5 to 3 lines. - Match the mac UI and show default/forced on the subtitle tracks. Fixes #2922
Diffstat (limited to 'win/CS/HandBrakeWPF/Converters')
-rw-r--r--win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs80
-rw-r--r--win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs10
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs3
3 files changed, 92 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs b/win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs
new file mode 100644
index 000000000..d9ef55f22
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs
@@ -0,0 +1,80 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="FilterSettingsDescConverter.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>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Queue
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.Windows.Data;
+ using HandBrake.Interop.Interop.Model.Encoding;
+
+ using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Encode.Model;
+ using HandBrakeWPF.Utilities;
+ using HandBrakeWPF.ViewModelItems.Filters;
+
+ public class FilterSettingsDescConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ EncodeTask task = value as EncodeTask;
+ if (task != null)
+ {
+ List<string> filters = new List<string>();
+
+ if (task.Detelecine != Detelecine.Off)
+ {
+ filters.Add(Resources.SummaryView_Detelecine);
+ }
+
+ if (task.DeinterlaceFilter != DeinterlaceFilter.Off)
+ {
+ filters.Add(EnumHelper<DeinterlaceFilter>.GetShortName(task.DeinterlaceFilter));
+ }
+
+ if (task.Denoise != Denoise.Off)
+ {
+ filters.Add(task.Denoise.ToString());
+ }
+
+ if (task.Sharpen != Sharpen.Off)
+ {
+ filters.Add(task.Sharpen.ToString());
+ }
+
+ if (task.DeblockPreset != null && task.DeblockPreset.Key != DeblockFilter.Off)
+ {
+ filters.Add(Resources.SummaryView_Deblock);
+ }
+
+ if (task.Grayscale)
+ {
+ filters.Add(Resources.SummaryView_Grayscale);
+ }
+
+ if (task.Rotation != 0 || task.FlipVideo)
+ {
+ filters.Add(Resources.SummaryView_Rotation);
+ }
+
+ if (filters.Count == 0)
+ {
+ return Resources.SummaryView_NoFilters;
+ }
+
+ return string.Join(", ", filters).TrimEnd(',').Trim();
+ }
+
+ return Resources.SummaryView_NoFilters;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs
index 42f336273..f0a64b7b6 100644
--- a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs
@@ -53,6 +53,16 @@ namespace HandBrakeWPF.Converters.Subtitles
{
text = text + string.Format(", {0}", Resources.SummaryView_Burned);
}
+
+ if (track.Forced)
+ {
+ text = text + string.Format(", {0}", Resources.SummaryView_Forced);
+ }
+
+ if (track.Default)
+ {
+ text = text + string.Format(", {0}", Resources.SummaryView_Forced);
+ }
sutitleTracks.AppendLine(text);
}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
index c66b339cc..3fcc3e384 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
@@ -49,7 +49,8 @@ namespace HandBrakeWPF.Converters.Video
{
VideoTune tune = task.VideoTunes.FirstOrDefault();
- return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}",
+ return string.Format(
+ "Preset: {0}, Tune: {1}{5}Profile: {2}, Level: {3}{5}Extra Arguments: {4}{5}",
task.VideoPreset != null ? task.VideoPreset.ShortName : VideoPreset.None.DisplayName,
tune != null ? tune.ShortName : VideoTune.None.DisplayName,
task.VideoProfile != null ? task.VideoProfile.ShortName : VideoProfile.Auto.DisplayName,