summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Converters
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-09-21 22:12:56 +0000
committersr55 <[email protected]>2013-09-21 22:12:56 +0000
commita27b2c176c84d290339f3bb0dc5b9f9961817b30 (patch)
treea1b38d3c0bb432ec6fcb998d51dc32b397fe88ed /win/CS/HandBrakeWPF/Converters
parentab17c5c37fcc9a9f8a1617505b3131b9196f1549 (diff)
WinGui: Added a new tab in Options to host "Video" related settings including hardware acceleration. Only showing the QuickSync options. DXVA/OpenCl options are hidden for now.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5794 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Converters')
-rw-r--r--win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs17
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs3
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs79
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs6
4 files changed, 103 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
index d65b7f9f1..1d3a4e208 100644
--- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
@@ -19,6 +19,8 @@ namespace HandBrakeWPF.Converters
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrakeWPF.Model;
+
/// <summary>
/// Enum Combo Converter
/// </summary>
@@ -91,6 +93,11 @@ namespace HandBrakeWPF.Converters
return EnumHelper<Denoise>.GetEnumDisplayValues(typeof(Denoise));
}
+ if (value is IEnumerable<VideoScaler>)
+ {
+ return EnumHelper<VideoScaler>.GetEnumDisplayValues(typeof(VideoScaler));
+ }
+
// Single Items
@@ -140,6 +147,11 @@ namespace HandBrakeWPF.Converters
return EnumHelper<QueueItemStatus>.GetDisplay((QueueItemStatus)value);
}
+ if (targetType == typeof(VideoScaler) || value.GetType() == typeof(VideoScaler))
+ {
+ return EnumHelper<VideoScaler>.GetDisplay((VideoScaler)value);
+ }
+
return null;
}
@@ -190,7 +202,6 @@ namespace HandBrakeWPF.Converters
{
return EnumHelper<QsvPreset>.GetValue(value.ToString());
}
-
if (targetType == typeof(PresetPictureSettingsMode) || value.GetType() == typeof(PresetPictureSettingsMode))
{
return EnumHelper<PresetPictureSettingsMode>.GetValue(value.ToString());
@@ -211,6 +222,10 @@ namespace HandBrakeWPF.Converters
{
return EnumHelper<Detelecine>.GetValue(value.ToString());
}
+ if (targetType == typeof(VideoScaler) || value.GetType() == typeof(VideoScaler))
+ {
+ return EnumHelper<VideoScaler>.GetValue(value.ToString());
+ }
return null;
}
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
index 128596f3f..2911bb4fc 100644
--- a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
@@ -53,6 +53,9 @@ namespace HandBrakeWPF.Converters.Options
case OptionsTab.About:
if ((OptionsTab)parameter == OptionsTab.About) return Visibility.Visible;
break;
+ case OptionsTab.Video:
+ if ((OptionsTab)parameter == OptionsTab.Video) return Visibility.Visible;
+ break;
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs
new file mode 100644
index 000000000..1eeedd653
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs
@@ -0,0 +1,79 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ScalingConverter.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>
+// Scaling Converter
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Video
+{
+ using System;
+ using System.Globalization;
+ using System.Windows.Data;
+
+ using HandBrake.ApplicationServices.Utilities;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// Video Scaling Converter
+ /// </summary>
+ public class ScalingConverter : IValueConverter
+ {
+ /// <summary>
+ /// The convert.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ return EnumHelper<VideoScaler>.GetDisplay((VideoScaler)value);
+ }
+
+ return VideoScaler.Lanczos;
+ }
+
+ /// <summary>
+ /// The convert back.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ /// <exception cref="NotImplementedException">
+ /// Not Required.
+ /// </exception>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
index e7f76f813..594f2c912 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
@@ -15,8 +15,11 @@ namespace HandBrakeWPF.Converters.Video
using System.Linq;
using System.Windows.Data;
+ using Caliburn.Micro;
+
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
@@ -55,7 +58,8 @@ namespace HandBrakeWPF.Converters.Video
encoders.Remove(VideoEncoder.Theora);
}
- if (!SystemInfo.IsQsvAvailable)
+ IUserSettingService userSettingService = IoC.Get<IUserSettingService>();
+ if (!SystemInfo.IsQsvAvailable || !userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSync))
{
encoders.Remove(VideoEncoder.QuickSync);
}