diff options
author | sr55 <[email protected]> | 2015-01-22 16:32:22 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-22 16:32:22 +0000 |
commit | acf831a1c78044a01e470102385334d183d1d5b1 (patch) | |
tree | f508c79182ff84f33617dcf826110bd21312adeb /win/CS/HandBrakeWPF/Converters | |
parent | 1ccc7a6a3caedda77d6e62972129727fb1598f35 (diff) |
WinGui: Initial re-factoring of the Video Tab. Replaces encoder specific preset/tune/profile/level options with generic versions. This will break all existing user presets so the version number for the presets has been bumped. This should trigger the old presets to be archived.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6789 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Converters')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs | 48 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs | 17 |
2 files changed, 11 insertions, 54 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs index b488470e2..a0f2c78ed 100644 --- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs @@ -18,7 +18,6 @@ namespace HandBrakeWPF.Converters using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Encoding.x264;
using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
@@ -47,19 +46,12 @@ namespace HandBrakeWPF.Converters /// </returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- // Lists
- if (value is IEnumerable<x264Preset>)
- {
- return EnumHelper<x264Preset>.GetEnumDisplayValues(typeof(x264Preset));
- }
- if (value is IEnumerable<x264Profile>)
+ if (value == null)
{
- return EnumHelper<x264Profile>.GetEnumDisplayValues(typeof(x264Profile));
- }
- if (value is IEnumerable<x264Tune>)
- {
- return EnumHelper<x264Tune>.GetEnumDisplayValues(typeof(x264Tune));
+ return null;
}
+
+ // Lists
if (value is IEnumerable<VideoEncoder>)
{
return EnumHelper<VideoEncoder>.GetEnumDisplayValues(typeof(VideoEncoder));
@@ -68,10 +60,6 @@ namespace HandBrakeWPF.Converters {
return EnumHelper<Mixdown>.GetEnumDisplayValues(typeof(Mixdown));
}
- if (targetType == typeof(QsvPreset) || value.GetType() == typeof(QsvPreset))
- {
- return EnumHelper<QsvPreset>.GetDisplay((QsvPreset)value);
- }
if (value is IEnumerable<PresetPictureSettingsMode>)
{
return EnumHelper<PresetPictureSettingsMode>.GetEnumDisplayValues(typeof(PresetPictureSettingsMode));
@@ -102,18 +90,6 @@ namespace HandBrakeWPF.Converters }
// Single Items
- if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
- {
- return EnumHelper<x264Preset>.GetDisplay((x264Preset)value);
- }
- if (targetType == typeof(x264Profile) || value.GetType() == typeof(x264Profile))
- {
- return EnumHelper<x264Profile>.GetDisplay((x264Profile)value);
- }
- if (targetType == typeof(x264Tune) || value.GetType() == typeof(x264Tune))
- {
- return EnumHelper<x264Tune>.GetDisplay((x264Tune)value);
- }
if (targetType == typeof(VideoEncoder) || value.GetType() == typeof(VideoEncoder))
{
return EnumHelper<VideoEncoder>.GetDisplay((VideoEncoder)value);
@@ -184,18 +160,6 @@ namespace HandBrakeWPF.Converters /// </exception>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
- {
- return EnumHelper<x264Preset>.GetValue(value.ToString());
- }
- if (targetType == typeof(x264Profile) || value.GetType() == typeof(x264Profile))
- {
- return EnumHelper<x264Profile>.GetValue(value.ToString());
- }
- if (targetType == typeof(x264Tune) || value.GetType() == typeof(x264Tune))
- {
- return EnumHelper<x264Tune>.GetValue(value.ToString());
- }
if (targetType == typeof(VideoEncoder) || value.GetType() == typeof(VideoEncoder))
{
return EnumHelper<VideoEncoder>.GetValue(value.ToString());
@@ -204,10 +168,6 @@ namespace HandBrakeWPF.Converters {
return EnumHelper<Mixdown>.GetValue(value.ToString());
}
- if (targetType == typeof(QsvPreset) || value.GetType() == typeof(QsvPreset))
- {
- return EnumHelper<QsvPreset>.GetValue(value.ToString());
- }
if (targetType == typeof(PresetPictureSettingsMode) || value.GetType() == typeof(PresetPictureSettingsMode))
{
return EnumHelper<PresetPictureSettingsMode>.GetValue(value.ToString());
diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs index 18b246510..a67fc9ad8 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs @@ -13,11 +13,8 @@ namespace HandBrakeWPF.Converters.Video using System.Globalization;
using System.Windows.Data;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Encoding.x264;
/// <summary>
/// The x 264 queue tooltip converter.
@@ -41,13 +38,13 @@ namespace HandBrakeWPF.Converters.Video return task.AdvancedEncoderOptions;
}
- return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}",
- EnumHelper<x264Preset>.GetDisplay(task.X264Preset),
- EnumHelper<x264Tune>.GetDisplay(task.X264Tune),
- task.H264Profile,
- task.H264Level,
- string.IsNullOrEmpty(task.ExtraAdvancedArguments) ? "None" : task.ExtraAdvancedArguments,
- Environment.NewLine);
+ //return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}",
+ // EnumHelper<x264Preset>.GetDisplay(task.X264Preset),
+ // EnumHelper<x264Tune>.GetDisplay(task.X264Tune),
+ // task.H264Profile,
+ // task.H264Level,
+ // string.IsNullOrEmpty(task.ExtraAdvancedArguments) ? "None" : task.ExtraAdvancedArguments,
+ // Environment.NewLine);
}
return task != null ? task.AdvancedEncoderOptions.Trim() : string.Empty;
|