diff options
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 681a73ed6..a40e76a46 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -983,25 +983,53 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.Task);
- if (preset.Task != null)
- {
- this.SetEncoder(preset.Task.VideoEncoder);
- this.X264PresetValue = preset.Task.VideoEncoder == VideoEncoder.X264
- ? (int)preset.Task.X264Preset
- : (int)x264Preset.Medium;
- this.H264Profile = preset.Task.VideoEncoder == VideoEncoder.X264 ? preset.Task.H264Profile : x264Profile.None;
- this.X264Tune = preset.Task.VideoEncoder == VideoEncoder.X264 ? preset.Task.X264Tune : x264Tune.None;
- this.H264Level = preset.Task.VideoEncoder == VideoEncoder.X264 ? preset.Task.H264Level : "Auto";
- this.FastDecode = preset.Task.VideoEncoder == VideoEncoder.X264 && preset.Task.FastDecode;
- this.ExtraArguments = preset.Task.ExtraAdvancedArguments;
-
- this.QsvPresetValue = preset.Task.VideoEncoder == VideoEncoder.QuickSync
- ? (int)preset.Task.QsvPreset
- : SystemInfo.IsHswOrNewer ? (int)QsvPreset.Quality : (int)QsvPreset.Balanced;
-
- this.UseAdvancedTab = !string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab;
- }
- }
+ if (preset.Task != null) + { + this.SetEncoder(preset.Task.VideoEncoder); + + // applies to both x264 and QSV + if (preset.Task.VideoEncoder == VideoEncoder.X264 || + preset.Task.VideoEncoder == VideoEncoder.QuickSync) + { + this.H264Profile = preset.Task.H264Profile; + this.H264Level = preset.Task.H264Level; + } + else + { + this.H264Profile = x264Profile.None; + this.H264Level = "Auto"; + } + + // x264 Only + if (preset.Task.VideoEncoder == VideoEncoder.X264) + { + this.X264PresetValue = (int)preset.Task.X264Preset; + this.X264Tune = preset.Task.X264Tune; + this.FastDecode = preset.Task.FastDecode; + } + else + { + this.X264PresetValue = (int)x264Preset.Medium; + this.X264Tune = x264Tune.None; + this.FastDecode = false; + } + + // QSV Only + if (preset.Task.VideoEncoder == VideoEncoder.QuickSync) + { + this.QsvPresetValue = (int)preset.Task.QsvPreset; + } + else + { + this.QsvPresetValue = SystemInfo.IsHswOrNewer + ? (int)QsvPreset.Quality + : (int)QsvPreset.Balanced; + } + + this.ExtraArguments = preset.Task.ExtraAdvancedArguments; + this.UseAdvancedTab = !string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab; + } + } /// <summary>
/// Update all the UI controls based on the encode task passed in.
|