From c921f0242dd7da08ea07b9ef5e02d37dd91b020d Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 16 Apr 2011 18:36:23 +0000 Subject: WinGui: - Switching Audio Selection dropdown to be databound. Added The scanned source track to the Audio Track model. - Added new Move to Top / Bottom options on the right click. - Further UI tweaks and fixes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3935 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Model/Encoding/AudioTrack.cs | 56 +++++++++++++++++----- 1 file changed, 43 insertions(+), 13 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Model/Encoding') diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs index 159beb8e8..b9ecca97d 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs @@ -5,6 +5,8 @@ namespace HandBrake.ApplicationServices.Model.Encoding { + using HandBrake.ApplicationServices.Parsing; + /// /// An Audio Track for the Audio Panel /// @@ -20,6 +22,11 @@ namespace HandBrake.ApplicationServices.Model.Encoding /// The DRC Value /// private double drc; + + /// + /// The Scanned Audio Track + /// + private Audio scannedTrack; #endregion /// @@ -33,7 +40,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding this.SampleRate = 48; this.Bitrate = 160; this.DRC = 1; - this.SourceTrack = "Automatic"; + this.ScannedTrack = new Audio(); } /// @@ -43,16 +50,43 @@ namespace HandBrake.ApplicationServices.Model.Encoding { get { - string[] tempSub = SourceTrack.Split(' '); - int value; - if (int.TryParse(tempSub[0], out value)) + if (this.ScannedTrack != null) { - return value; + return this.ScannedTrack.TrackNumber; } + return null; } } + /// + /// Gets or sets the Scanned Audio Tracks + /// + public Audio ScannedTrack + { + get + { + return this.scannedTrack; + } + + set + { + this.scannedTrack = value; + this.OnPropertyChanged("ScannedTrack"); + } + } + + /// + /// Gets the Display Value for this model. + /// + public string TrackDisplay + { + get + { + return this.ScannedTrack.ToString(); + } + } + /// /// Gets the The UI display value for sample rate /// @@ -60,7 +94,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding { get { - return SampleRate == 0 ? "Auto" : SampleRate.ToString(); + return this.SampleRate == 0 ? "Auto" : this.SampleRate.ToString(); } } @@ -71,16 +105,10 @@ namespace HandBrake.ApplicationServices.Model.Encoding { get { - return Bitrate == 0 ? "Auto" : Bitrate.ToString(); + return this.Bitrate == 0 ? "Auto" : this.Bitrate.ToString(); } } - /// - /// Gets or sets the Source Track - /// Used for display purposes only. - /// - public string SourceTrack { get; set; } - /// /// Gets or sets Audio Mixdown /// @@ -110,6 +138,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding { return this.drc; } + set { if (!object.Equals(value, this.drc)) @@ -129,6 +158,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding { return this.gain; } + set { if (!object.Equals(value, this.gain)) -- cgit v1.2.3