diff options
author | sr55 <[email protected]> | 2016-05-12 19:48:41 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2016-05-12 19:48:41 +0100 |
commit | 16314ab0db954c46f64632e4111836061bd9748d (patch) | |
tree | 31e4e782eef340b81be7c5ad435ca79295f49aa3 /win/CS/HandBrakeWPF/Services | |
parent | c2ddfa317feb249bc4c39e986e9e60f9208bde0a (diff) |
WinGui: Add a track list on the Audio Defaults screen. This changes the behaviour to match the Mac and Linux GUIs. So you no longer have to have a source audio track before you can create presets.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
3 files changed, 24 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs index 53b162f87..8e21820c2 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs @@ -20,6 +20,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models using HandBrake.ApplicationServices.Interop.Model.Encoding; using HandBrake.ApplicationServices.Utilities; + using HandBrakeWPF.Model.Audio; using HandBrakeWPF.Services.Scan.Model; using HandBrakeWPF.Utilities; @@ -94,6 +95,25 @@ namespace HandBrakeWPF.Services.Encode.Model.Models this.SetupLimits(); } + /// <summary> + /// Create a track from a behaviour track. + /// </summary> + /// <param name="track">The Behavior track</param> + public AudioTrack(AudioBehaviourTrack track) + { + this.drc = track.DRC; + this.encoder = track.Encoder; + this.gain = track.Gain; + this.mixDown = track.MixDown != null ? track.MixDown.ShortName : "dpl2"; + this.sampleRate = track.SampleRate; + this.scannedTrack = new Audio(); + this.encoderRateType = track.EncoderRateType; + this.quality = track.Quality; + this.bitrate = track.Bitrate; + + this.SetupLimits(); + } + #region Track Properties /// <summary> diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index c8331076b..051d78c5f 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -394,13 +394,13 @@ namespace HandBrakeWPF.Services.Presets.Factories {
foreach (var audioTrack in importedPreset.AudioList)
{
- AudioTrack track = new AudioTrack();
+ AudioBehaviourTrack track = new AudioBehaviourTrack();
track.Bitrate = audioTrack.AudioBitrate;
// track.CompressionLevel = audioTrack.AudioCompressionLevel;
// track.AudioDitherMethod = audioTrack.AudioDitherMethod;
track.Encoder = EnumHelper<AudioEncoder>.GetValue(audioTrack.AudioEncoder);
- track.MixDown = audioTrack.AudioMixdown;
+ track.MixDown = HandBrakeEncoderHelpers.GetMixdown(audioTrack.AudioMixdown);
// track.AudioNormalizeMixLevel = audioTrack.AudioNormalizeMixLevel;
track.SampleRate = audioTrack.AudioSamplerate == "auto" ? 0 : double.Parse(audioTrack.AudioSamplerate);
@@ -410,7 +410,7 @@ namespace HandBrakeWPF.Services.Presets.Factories track.Gain = (int)audioTrack.AudioTrackGainSlider;
track.DRC = audioTrack.AudioTrackDRCSlider;
- preset.Task.AudioTracks.Add(track);
+ preset.AudioTrackBehaviours.BehaviourTracks.Add(track);
}
}
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index 79d35e2ab..55915329b 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -43,7 +43,7 @@ namespace HandBrakeWPF.Services.Presets {
#region Private Variables
- public const int ForcePresetReset = 2;
+ public const int ForcePresetReset = 3;
public static string UserPresetCatgoryName = "User Presets";
private readonly string presetFile = Path.Combine(DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly()), "presets.json");
private readonly ObservableCollection<Preset> presets = new ObservableCollection<Preset>();
|