]> granicus.if.org Git - handbrake/commitdiff
WinGui: Missing file from a previous commit.
authorsr55 <sr55.hb@outlook.com>
Sun, 18 Aug 2013 17:22:09 +0000 (17:22 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 18 Aug 2013 17:22:09 +0000 (17:22 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5713 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs [new file with mode: 0644]

diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
new file mode 100644 (file)
index 0000000..412d534
--- /dev/null
@@ -0,0 +1,67 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="x264QueueTooltipConverter.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+//   The x 264 queue tooltip converter.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Converters.Video\r
+{\r
+    using System;\r
+    using System.Globalization;\r
+    using System.Windows.Data;\r
+\r
+    using HandBrake.ApplicationServices.Model;\r
+    using HandBrake.ApplicationServices.Utilities;\r
+    using HandBrake.Interop.Model.Encoding;\r
+    using HandBrake.Interop.Model.Encoding.x264;\r
+\r
+    /// <summary>\r
+    /// The x 264 queue tooltip converter.\r
+    /// </summary>\r
+    public class EncoderOptionsTooltipConverter : IValueConverter\r
+    {\r
+        /// <summary>\r
+        /// Converts a value. \r
+        /// </summary>\r
+        /// <returns>\r
+        /// A converted value. If the method returns null, the valid null value is used.\r
+        /// </returns>\r
+        /// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>\r
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\r
+        {\r
+            EncodeTask task = value as EncodeTask;\r
+            if (task != null && task.VideoEncoder == VideoEncoder.X264)\r
+            {\r
+                if (task.ShowAdvancedTab)\r
+                {\r
+                    return task.AdvancedEncoderOptions;\r
+                }\r
+\r
+                return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}", \r
+                    EnumHelper<x264Preset>.GetDisplay(task.X264Preset),\r
+                    EnumHelper<x264Tune>.GetDisplay(task.X264Tune),\r
+                    task.H264Profile,\r
+                    task.H264Level, \r
+                    string.IsNullOrEmpty(task.ExtraAdvancedArguments) ? "None" : task.ExtraAdvancedArguments,\r
+                    Environment.NewLine);\r
+            }\r
+\r
+            return task != null ? task.AdvancedEncoderOptions.Trim() : string.Empty;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Converts a value. \r
+        /// </summary>\r
+        /// <returns>\r
+        /// A converted value. If the method returns null, the valid null value is used.\r
+        /// </returns>\r
+        /// <param name="value">The value that is produced by the binding target.</param><param name="targetType">The type to convert to.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>\r
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\r
+        {\r
+            throw new NotImplementedException();\r
+        }\r
+    }\r
+}\r