From a7c69adc115b9b25680061284f614329072502f7 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 1 Sep 2019 20:08:03 +0100 Subject: 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 --- .../Services/Encode/Model/Models/AudioTrack.cs | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'win') 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 encoderQualityValues; private AudioEncoderRateType encoderRateType; private double? quality; + private string trackName; /// /// Initializes a new instance of the 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 /// /// Gets or sets the track name. /// - public string TrackName { get; set; } + public string TrackName + { + get => this.trackName; + set + { + if (value == this.trackName) return; + this.trackName = value; + this.NotifyOfPropertyChange(); + } + } + #endregion /// -- cgit v1.2.3