summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-04-26 17:16:44 +0000
committersr55 <[email protected]>2013-04-26 17:16:44 +0000
commit4212965a7a90a5f2121dadea8c5d25b6212c344e (patch)
treed5a9fcdacc4c2403151287d19e6486d50880a34c /win/CS
parentdd06b511c635fbebed8c85b9073055b3c7620f52 (diff)
WinGui: Change the Audio Automatic behaviour to be a bit more sane. When Add All Remaining/Selected is turned on, changing title will now clear down first, then add the preset tracks with the preferred language, then add the remaining after with default settings.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5412 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 516fc7642..2146b1c6c 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -9,6 +9,7 @@
namespace HandBrakeWPF.ViewModels
{
+ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
@@ -37,6 +38,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private IEnumerable<Audio> sourceTracks;
+ private Preset currentPreset;
+
#region Constructors and Destructors
/// <summary>
@@ -196,6 +199,7 @@ namespace HandBrakeWPF.ViewModels
public void SetPreset(Preset preset, EncodeTask task)
{
this.Task = task;
+ this.currentPreset = preset;
if (preset != null && preset.Task != null)
{
@@ -357,7 +361,7 @@ namespace HandBrakeWPF.ViewModels
return;
}
- // Default all the language tracks to the preferred or first language of this source.
+ // We've changed source, so lets try reset the language, description and formats as close as possible to the previous track.
foreach (AudioTrack track in this.Task.AudioTracks)
{
track.ScannedTrack = this.GetPreferredAudioTrack();
@@ -365,6 +369,14 @@ namespace HandBrakeWPF.ViewModels
// Handle the default selection behaviour.
int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeAudio);
+ if (mode == 1 || mode == 2)
+ {
+ // First, we'll clear out all current tracks and go back to what the current preset has.
+ // This will alteast provide a consistent behavior when switching tracks.
+ this.Task.AudioTracks.Clear();
+ this.AddTracksFromPreset(this.currentPreset);
+ }
+
switch (mode)
{
case 1: // Adding all remaining audio tracks