diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs | 44 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 5 |
2 files changed, 36 insertions, 13 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs index a67fc9ad8..a94134fc1 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs @@ -11,9 +11,11 @@ namespace HandBrakeWPF.Converters.Video {
using System;
using System.Globalization;
+ using System.Linq;
using System.Windows.Data;
using HandBrake.ApplicationServices.Services.Encode.Model;
+ using HandBrake.ApplicationServices.Services.Encode.Model.Models.Video;
using HandBrake.Interop.Model.Encoding;
/// <summary>
@@ -27,7 +29,18 @@ namespace HandBrakeWPF.Converters.Video /// <returns>
/// A converted value. If the method returns null, the valid null value is used.
/// </returns>
- /// <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>
+ /// <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>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
EncodeTask task = value as EncodeTask;
@@ -38,13 +51,15 @@ 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);
+ VideoTune tune = task.VideoTunes.FirstOrDefault();
+
+ return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}",
+ task.VideoPreset != null ? task.VideoPreset.ShortName : VideoPreset.None.DisplayName,
+ tune != null ? tune.ShortName : VideoTune.None.DisplayName,
+ task.VideoProfile != null ? task.VideoProfile.ShortName : VideoProfile.Auto.DisplayName,
+ task.VideoLevel != null ? task.VideoLevel.ShortName : VideoLevel.Auto.DisplayName,
+ string.IsNullOrEmpty(task.ExtraAdvancedArguments) ? "None" : task.ExtraAdvancedArguments,
+ Environment.NewLine);
}
return task != null ? task.AdvancedEncoderOptions.Trim() : string.Empty;
@@ -56,7 +71,18 @@ namespace HandBrakeWPF.Converters.Video /// <returns>
/// A converted value. If the method returns null, the valid null value is used.
/// </returns>
- /// <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>
+ /// <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>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 9fe599fc2..a5d03cbb0 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -544,7 +544,6 @@ namespace HandBrakeWPF.ViewModels /// Gets or sets a value indicating whether display non qsv controls.
/// </summary>
public bool DisplayNonQSVControls
-
{
get
{
@@ -879,12 +878,10 @@ namespace HandBrakeWPF.ViewModels this.VideoProfile = preset.Task.VideoProfile != null ? preset.Task.VideoProfile.Clone() : this.VideoProfiles.FirstOrDefault();
this.VideoPresetValue = preset.Task.VideoPreset != null ? this.VideoPresets.IndexOf(preset.Task.VideoPreset) : 0;
this.FastDecode = preset.Task.VideoTunes != null && preset.Task.VideoTunes.Contains(VideoTune.FastDecode);
- this.VideoTune = preset.Task.VideoTunes != null ? preset.Task.VideoTunes.FirstOrDefault(t => !Equals(t, VideoTune.FastDecode)) : this.VideoTunes.FirstOrDefault();
+ this.VideoTune = preset.Task.VideoTunes != null && preset.Task.VideoTunes.Any() ? preset.Task.VideoTunes.FirstOrDefault(t => !Equals(t, VideoTune.FastDecode)) : this.VideoTunes.FirstOrDefault();
}
}
- // TODO Hide Controls.
-
this.ExtraArguments = preset.Task.ExtraAdvancedArguments;
this.UseAdvancedTab = !string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab;
}
|