]> granicus.if.org Git - handbrake/commitdiff
WinGui: Toolbar Consistency pt2 #833
authorsr55 <sr55.hb@outlook.com>
Mon, 25 Dec 2017 16:05:52 +0000 (16:05 +0000)
committersr55 <sr55.hb@outlook.com>
Mon, 25 Dec 2017 16:06:27 +0000 (16:06 +0000)
win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx

diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs
new file mode 100644 (file)
index 0000000..36bd408
--- /dev/null
@@ -0,0 +1,47 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="CanBurnSubtitleConverter.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>
+//   Subtitle Behaviour Converter
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+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();
+        }
+    }
+}
index 089502218bf47adfec799f3f436785b40bd8efe4..4868b37f51765ba6f1aac42382d2ac85212ba0ea 100644 (file)
@@ -1005,6 +1005,15 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Show Preview.\r
+        /// </summary>\r
+        public static string MainView_ShowPreview {\r
+            get {\r
+                return ResourceManager.GetString("MainView_ShowPreview", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Show Queue.\r
         /// </summary>\r
index 0b8c69afa880f8ccff49826a3b207bd0f77eca70..8379ecb7de08d87549f0a3b71584dfaab5dfa1c4 100644 (file)
@@ -1019,4 +1019,7 @@ This will not affect your current settings in the Subtitle tab.</value>
   <data name="MainView_SaveNewPreset" xml:space="preserve">\r
     <value>Save New Preset</value>\r
   </data>\r
+  <data name="MainView_ShowPreview" xml:space="preserve">\r
+    <value>Show Preview</value>\r
+  </data>\r
 </root>
\ No newline at end of file