// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // Defines the DenoisePresetConverter type. // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Converters.Filters { using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Windows.Data; using HandBrake.ApplicationServices.Interop.Model.Encoding; using DenoisePreset = HandBrakeWPF.Services.Encode.Model.Models.DenoisePreset; /// /// The denoise preset converter. /// public class DenoisePresetConverter : IMultiValueConverter { /// /// The convert. /// /// /// The values. /// /// /// The target type. /// /// /// The parameter. /// /// /// The culture. /// /// /// The . /// 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.Weak, DenoisePreset.Medium, DenoisePreset.Strong, DenoisePreset.Custom }; } if (denoiseChoice == Denoise.NLMeans) { return new List { DenoisePreset.Ultralight, DenoisePreset.Light, DenoisePreset.Medium, DenoisePreset.Strong, DenoisePreset.Custom }; } } return Enumerable.Empty(); } /// /// The convert back. Not used /// /// /// The value. /// /// /// The target types. /// /// /// The parameter. /// /// /// The culture. /// /// /// The Nothing. Not used /// public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }