diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 95 |
1 files changed, 48 insertions, 47 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index a40e76a46..d12798fef 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -30,6 +30,7 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -983,53 +984,53 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.Task);
- 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; - } - } + 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.
|