diff options
author | sr55 <[email protected]> | 2014-07-05 14:37:53 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-07-05 14:37:53 +0000 |
commit | 2412d4a92123b2f20b43987a65a4fbd645be1443 (patch) | |
tree | efaa258ae72aa99e1473f740be87d0327fb0bccd /win/CS/HandBrakeWPF/Converters | |
parent | d4a760ecd14a39772c0f9a5b7b35d0bc15d9a77f (diff) |
WinGui: Adding support for Nlmeans to the front-end. Plist keys still tbd.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6227 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Converters')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs b/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs new file mode 100644 index 000000000..bb0ec1b7e --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs @@ -0,0 +1,86 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DenoisePresetConverter.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>
+// Defines the DenoisePresetConverter type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Filters
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.Linq;
+ using System.Windows.Data;
+
+ using HandBrake.Interop.Model.Encoding;
+
+ /// <summary>
+ /// The denoise preset converter.
+ /// </summary>
+ public class DenoisePresetConverter : IMultiValueConverter
+ {
+ /// <summary>
+ /// The convert.
+ /// </summary>
+ /// <param name="values">
+ /// The values.
+ /// </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[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values.Any() && values.Count() == 2)
+ {
+ Denoise denoiseChoice = (Denoise)values[1];
+
+ if (denoiseChoice == Denoise.hqdn3d)
+ {
+ return new List<DenoisePreset> { DenoisePreset.Weak, DenoisePreset.Medium, DenoisePreset.Strong, DenoisePreset.Custom };
+ }
+
+ if (denoiseChoice == Denoise.NlMeans)
+ {
+ return new List<DenoisePreset> { DenoisePreset.Ultralight, DenoisePreset.Light, DenoisePreset.Medium, DenoisePreset.Strong };
+ }
+ }
+
+ return Enumerable.Empty<DenoisePreset>();
+ }
+
+ /// <summary>
+ /// The convert back. Not used
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetTypes">
+ /// The target types.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The Nothing. Not used
+ /// </returns>
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
|