diff options
author | sr55 <[email protected]> | 2019-09-01 20:08:03 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-09-01 20:08:13 +0100 |
commit | a7c69adc115b9b25680061284f614329072502f7 (patch) | |
tree | 4a15f15a65d1e413011ee92dd3473be0bc362855 /win/CS | |
parent | b4dbb30c9d87530755a6c4f9d0b4284a7e43296c (diff) |
WinGui: Fix 2 issues with audio track names. First, Name was not updating correctly when changing source track. Second, user defined names were overwritten during json creation for the encode. Fixes #2286
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs | 23 |
1 files changed, 19 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 f81d281d2..4ad2cd11d 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs @@ -44,6 +44,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models private IEnumerable<double> encoderQualityValues; private AudioEncoderRateType encoderRateType; private double? quality; + private string trackName; /// <summary> /// Initializes a new instance of the <see cref = "AudioTrack" /> class. @@ -92,14 +93,18 @@ namespace HandBrakeWPF.Services.Encode.Model.Models this.scannedTrack = track.ScannedTrack ?? new Audio(); } - this.TrackName = track.TrackName; - this.Quality = track.Quality; - if (!string.IsNullOrEmpty(this.scannedTrack?.Name)) { this.TrackName = this.scannedTrack.Name; } + if (!string.IsNullOrEmpty(track.TrackName)) + { + this.TrackName = track.TrackName; + } + + this.Quality = track.Quality; + // Setup Backing Properties this.encoderRateType = track.EncoderRateType; this.SetupLimits(); @@ -337,7 +342,17 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// <summary> /// Gets or sets the track name. /// </summary> - public string TrackName { get; set; } + public string TrackName + { + get => this.trackName; + set + { + if (value == this.trackName) return; + this.trackName = value; + this.NotifyOfPropertyChange(); + } + } + #endregion /// <summary> |