diff options
author | Scott <[email protected]> | 2015-12-15 21:10:28 +0000 |
---|---|---|
committer | Scott <[email protected]> | 2015-12-15 21:10:28 +0000 |
commit | c0111a233492815ba3192edcfa48fca3719ca4a8 (patch) | |
tree | 784676548eb0b48208ce3128e5966363c23a5598 /win/CS | |
parent | 5cfc84b6024a137959b3f21287f6b6dce0a144f3 (diff) |
WinGui: Some fixes around the preset audio / subtitle configure default settings not being loaded correctly.
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 1282cf414..d7a406048 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -23,6 +23,7 @@ namespace HandBrakeWPF.Services.Presets.Factories using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Model.Picture;
using HandBrakeWPF.Model.Subtitles;
+ using HandBrakeWPF.Services.Encode.Model.Models;
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Utilities;
@@ -288,7 +289,16 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.AudioTrackBehaviours.SelectedBehaviour = importedPreset.AudioTrackSelectionBehavior == "all"
? AudioBehaviourModes.AllMatching
: AudioBehaviourModes.FirstMatch;
- preset.AudioTrackBehaviours.SelectedTrackDefaultBehaviour = AudioTrackDefaultsMode.None;
+
+ // TODO - The other GUI's don't support All Tracks yet. So for now we can only load / Save first track.
+ if (importedPreset.AudioSecondaryEncoderMode)
+ {
+ preset.AudioTrackBehaviours.SelectedTrackDefaultBehaviour = AudioTrackDefaultsMode.FirstTrack;
+ }
+ else
+ {
+ preset.AudioTrackBehaviours.SelectedTrackDefaultBehaviour = AudioTrackDefaultsMode.None;
+ }
if (importedPreset.AudioCopyMask != null)
{
@@ -347,8 +357,8 @@ namespace HandBrakeWPF.Services.Presets.Factories // track.AudioNormalizeMixLevel = audioTrack.AudioNormalizeMixLevel;
track.SampleRate = audioTrack.AudioSamplerate == "auto" ? 0 : double.Parse(audioTrack.AudioSamplerate);
- // track.IsQualityBased = audioTrack.AudioTrackQualityEnable;
- // track.Quality = audioTrack.AudioTrackQuality;
+ track.EncoderRateType = audioTrack.AudioTrackQualityEnable ? AudioEncoderRateType.Quality : AudioEncoderRateType.Bitrate;
+ track.Quality = audioTrack.AudioTrackQuality;
track.Gain = (int)audioTrack.AudioTrackGainSlider;
track.DRC = audioTrack.AudioTrackDRCSlider;
@@ -359,6 +369,8 @@ namespace HandBrakeWPF.Services.Presets.Factories /* Subtitle Settings */
preset.SubtitleTrackBehaviours = new SubtitleBehaviours();
preset.SubtitleTrackBehaviours.SelectedBehaviour = EnumHelper<SubtitleBehaviourModes>.GetValue(importedPreset.SubtitleTrackSelectionBehavior);
+ preset.SubtitleTrackBehaviours.SelectedBurnInBehaviour = EnumHelper<SubtitleBurnInBehaviourModes>.GetValue(importedPreset.SubtitleBurnBehavior);
+
preset.SubtitleTrackBehaviours.AddClosedCaptions = importedPreset.SubtitleAddCC;
preset.SubtitleTrackBehaviours.AddForeignAudioScanTrack = importedPreset.SubtitleAddForeignAudioSearch;
if (importedPreset.SubtitleLanguageList != null)
@@ -383,7 +395,6 @@ namespace HandBrakeWPF.Services.Presets.Factories // public bool VideoQSVDecode { get; set; }
// public int VideoQSVAsyncDepth { get; set; }
// public bool SubtitleAddForeignAudioSubtitle { get; set; }
- // public string SubtitleBurnBehavior { get; set; }
// public bool SubtitleBurnBDSub { get; set; }
// public bool SubtitleBurnDVDSub { get; set; }
// public bool PictureItuPAR { get; set; }
@@ -393,7 +404,6 @@ namespace HandBrakeWPF.Services.Presets.Factories // public int PictureRotate { get; set; }
// public int PictureForceHeight { get; set; }
// public int PictureForceWidth { get; set; }
- // public bool AudioSecondaryEncoderMode { get; set; }
// public List<object> ChildrenArray { get; set; }
// public bool Folder { get; set; }
// public bool FolderOpen { get; set; }
@@ -474,7 +484,7 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.AudioEncoderFallback = EnumHelper<AudioEncoder>.GetShortName(export.Task.AllowedPassthruOptions.AudioEncoderFallback);
preset.AudioLanguageList = LanguageUtilities.GetLanguageCodes(export.AudioTrackBehaviours.SelectedLangauges);
preset.AudioTrackSelectionBehavior = EnumHelper<AudioBehaviourModes>.GetShortName(export.AudioTrackBehaviours.SelectedBehaviour);
- preset.AudioSecondaryEncoderMode = false; // TODO -> Check what this is.
+ preset.AudioSecondaryEncoderMode = export.AudioTrackBehaviours.SelectedTrackDefaultBehaviour == AudioTrackDefaultsMode.FirstTrack; // TODO -> We don't support AllTracks yet in other GUIs.
preset.AudioList = new List<AudioList>();
foreach (var item in export.Task.AudioTracks)
{
@@ -578,7 +588,7 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.x264UseAdvancedOptions = export.Task.ShowAdvancedTab;
// Unknown
- preset.ChildrenArray = new List<object>(); // TODO
+ preset.ChildrenArray = new List<object>(); // We don't support nested presets.
preset.Folder = false; // TODO
preset.FolderOpen = false; // TODO
|