/* AudioTrack.cs $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ namespace HandBrake.ApplicationServices.Model.Encoding { using System; using System.ComponentModel; using HandBrake.ApplicationServices.Parsing; /// /// An Audio Track for the Audio Panel /// public class AudioTrack : ModelBase { #region Private Variables /// /// The gain value /// private int gain; /// /// The DRC Value /// private double drc; /// /// The Scanned Audio Track /// [NonSerialized] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] private Audio scannedTrack; #endregion /// /// Initializes a new instance of the class. /// public AudioTrack() { // Default Values this.Encoder = AudioEncoder.Faac; this.MixDown = Mixdown.DolbyProLogicII; this.SampleRate = 48; this.Bitrate = 160; this.DRC = 0; this.ScannedTrack = new Audio(); } /// /// Gets the Audio Track Name /// public int? Track { get { if (this.ScannedTrack != null) { return this.ScannedTrack.TrackNumber; } return null; } } /// /// Gets or sets the Scanned Audio Tracks /// [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Audio ScannedTrack { get { return this.scannedTrack; } set { this.scannedTrack = value; this.OnPropertyChanged("ScannedTrack"); this.OnPropertyChanged("TrackDisplay"); } } /// /// Gets the Display Value for this model. /// public string TrackDisplay { get { return this.ScannedTrack == null ? string.Empty : this.ScannedTrack.ToString(); } } /// /// Gets the The UI display value for sample rate /// public string SampleRateDisplayValue { get { return this.SampleRate == 0 ? "Auto" : this.SampleRate.ToString(); } } /// /// Gets the The UI display value for bit rate /// public string BitRateDisplayValue { get { if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough || this.Encoder == AudioEncoder.DtsHDPassthrough) { return "Auto"; } return this.Bitrate.ToString(); } } /// /// Gets or sets Audio Mixdown /// public Mixdown MixDown { get; set; } /// /// Gets or sets Audio Encoder /// public AudioEncoder Encoder { get; set; } /// /// Gets or sets Audio Bitrate /// public int Bitrate { get; set; } /// /// Gets or sets Audio SampleRate /// public double SampleRate { get; set; } /// /// Gets or sets TrackName. /// public string TrackName { get; set; } /// /// Gets or sets Dynamic Range Compression /// public double DRC { get { return this.drc; } set { if (!object.Equals(value, this.drc)) { this.drc = value; this.OnPropertyChanged("DRC"); } } } /// /// Gets or sets the Gain for the audio track /// public int Gain { get { return this.gain; } set { if (!object.Equals(value, this.gain)) { this.gain = value; this.OnPropertyChanged("Gain"); } } } } }