From: sr55 Date: Mon, 25 Dec 2017 16:05:52 +0000 (+0000) Subject: WinGui: Toolbar Consistency pt2 #833 X-Git-Tag: 1.1.0~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=903ceebfcd0eb6cd8b4c6651b3ec93520c25d18e;p=handbrake WinGui: Toolbar Consistency pt2 #833 --- diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs new file mode 100644 index 000000000..36bd40892 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs @@ -0,0 +1,47 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Subtitle Behaviour Converter +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Subtitles +{ + using System; + using System.Globalization; + using System.Windows.Data; + + using HandBrakeWPF.Services.Encode.Model; + using HandBrakeWPF.Services.Encode.Model.Models; + + public class CanBurnSubtitleConverter : IMultiValueConverter + { + + + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Length >= 1) + { + bool sourceTrackCanBurn = (bool)values[0]; + SubtitleType type = (SubtitleType)values[1]; + EncodeTask task = values[2] as EncodeTask; + + if (task != null && OutputFormat.Mp4.Equals(task.OutputFormat) && SubtitleType.PGS.Equals(type)) + { + return false; + } + + return sourceTrackCanBurn; + } + + return true; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 089502218..4868b37f5 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -1005,6 +1005,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Show Preview. + /// + public static string MainView_ShowPreview { + get { + return ResourceManager.GetString("MainView_ShowPreview", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show Queue. /// diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 0b8c69afa..8379ecb7d 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -1019,4 +1019,7 @@ This will not affect your current settings in the Subtitle tab. Save New Preset + + Show Preview + \ No newline at end of file