summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-01-31 17:45:19 +0000
committersr55 <[email protected]>2016-01-31 17:45:19 +0000
commit4a69d9887ff849673c21d2807afafb4c9f8fcb7d (patch)
treee6207656987948584fc7511d60af63a05dcae95c /win
parentba5eb77fefa51ef29b9e23e1ed5f8d3103dce5d2 (diff)
WinGui: Fix for configure audio tracks not behaving correctly with "Any" option.
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs19
1 files changed, 12 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 0966b18fd..05a904d5f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -582,7 +582,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void AddFirstForSelectedLanguages()
{
- foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
+ foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks(false))
{
// Step 2: Check if the track list already contrains this track
bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
@@ -612,7 +612,7 @@ namespace HandBrakeWPF.ViewModels
public void AddAllRemainingForSelectedLanguages()
{
// Add them if they are not already added.
- foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
+ foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks(true))
{
// Step 2: Check if the track list already contrains this track
bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
@@ -650,17 +650,22 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets a list of source tracks for the users selected languages.
/// </summary>
+ /// <param name="includeAny">
+ /// The include Any.
+ /// </param>
/// <returns>
/// A list of source audio tracks.
/// </returns>
- private IEnumerable<Audio> GetSelectedLanguagesTracks()
+ private IEnumerable<Audio> GetSelectedLanguagesTracks(bool includeAny)
{
List<Audio> trackList = new List<Audio>();
- List<string> isoCodes = this.AudioBehaviours.SelectedLangauges.Contains(Constants.Any)
- ? LanguageUtilities.GetIsoCodes()
- : LanguageUtilities.GetLanguageCodes(
- this.AudioBehaviours.SelectedLangauges.ToArray());
+ List<string> isoCodes = LanguageUtilities.GetLanguageCodes(this.AudioBehaviours.SelectedLangauges.ToArray());
+
+ if (includeAny)
+ {
+ isoCodes = LanguageUtilities.GetIsoCodes();
+ }
foreach (string code in isoCodes)
{