summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-05-24 21:47:12 +0100
committersr55 <[email protected]>2017-05-24 21:47:22 +0100
commit615db8abfd8864a7fc61cc3d25895912ef6c5dd4 (patch)
treeff1b4ae6818ab4068eb8db35eb166aa7a8f22db0 /win/CS/HandBrakeWPF
parente22fbb1a0faa3513dfdfbdd796f31c03df6e86bb (diff)
WinGui: Change the "For Additional Tracks" dropdown. Remove the "None" option. It doesn't make sense. This fixes an issue where we couldn't load "all" due to the preset key for it being a 2 state bollean rather than a 3 state option.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs2
-rw-r--r--win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs5
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs12
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs3
4 files changed, 4 insertions, 18 deletions
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs
index aa448d690..438117ce3 100644
--- a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs
+++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs
@@ -29,7 +29,7 @@ namespace HandBrakeWPF.Model.Audio
public AudioBehaviours()
{
this.SelectedBehaviour = AudioBehaviourModes.None;
- this.SelectedTrackDefaultBehaviour = AudioTrackDefaultsMode.None;
+ this.SelectedTrackDefaultBehaviour = AudioTrackDefaultsMode.FirstTrack;
this.SelectedLangauges = new BindingList<string>();
this.BehaviourTracks = new BindingList<AudioBehaviourTrack>();
}
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs
index 475c39e94..ffb03fc8a 100644
--- a/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs
+++ b/win/CS/HandBrakeWPF/Model/Audio/AudioTrackDefaultsMode.cs
@@ -16,11 +16,8 @@ namespace HandBrakeWPF.Model.Audio
/// </summary>
public enum AudioTrackDefaultsMode
{
- [DisplayName("Default")]
- None = 0,
-
[DisplayName("Use First Track as template")]
- FirstTrack,
+ FirstTrack = 0,
[DisplayName("Use All Tracks as templates")]
AllTracks,
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
index 59307e5ed..a1b2b30a5 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
@@ -339,15 +339,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
? AudioBehaviourModes.AllMatching
: AudioBehaviourModes.FirstMatch;
- // 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;
- }
+ preset.AudioTrackBehaviours.SelectedTrackDefaultBehaviour = importedPreset.AudioSecondaryEncoderMode ? AudioTrackDefaultsMode.FirstTrack : AudioTrackDefaultsMode.AllTracks;
if (importedPreset.AudioCopyMask != null)
{
@@ -537,7 +529,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 = export.AudioTrackBehaviours.SelectedTrackDefaultBehaviour == AudioTrackDefaultsMode.FirstTrack; // TODO -> We don't support AllTracks yet in other GUIs.
+ preset.AudioSecondaryEncoderMode = export.AudioTrackBehaviours.SelectedTrackDefaultBehaviour == AudioTrackDefaultsMode.FirstTrack; // 1 = First Track, 0 = All
preset.AudioList = new List<AudioList>();
foreach (var item in export.AudioTrackBehaviours.BehaviourTracks)
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index ffea2554e..ff7a8376f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -351,9 +351,6 @@ namespace HandBrakeWPF.ViewModels
switch (this.AudioBehaviours.SelectedTrackDefaultBehaviour)
{
- case AudioTrackDefaultsMode.None:
- this.Task.AudioTracks.Add(new AudioTrack { ScannedTrack = track });
- break;
case AudioTrackDefaultsMode.FirstTrack:
AudioBehaviourTrack template = this.AudioBehaviours.BehaviourTracks.FirstOrDefault();
this.Task.AudioTracks.Add(template != null ? new AudioTrack(template, track, this.Task.AllowedPassthruOptions.AudioEncoderFallback) : new AudioTrack { ScannedTrack = track });