// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // An object represending an AudioTrack associated with a Title, in a DVD // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.Interop.SourceData { /// /// An object represending an AudioTrack associated with a Title, in a DVD /// public class AudioTrack { /// /// Gets or sets the track number of this Audio Track /// public int TrackNumber { get; set; } /// /// Gets or sets the audio codec of this Track. /// public AudioCodec Codec { get; set; } /// /// Gets or sets the language (if detected) of this Audio Track /// public string Language { get; set; } /// /// Gets or sets the language code for this audio track. /// public string LanguageCode { get; set; } /// /// Gets or sets the description for this audio track. /// public string Description { get; set; } /// /// Gets or sets the channel layout of this Audio Track. /// public int ChannelLayout { get; set; } /// /// Gets or sets the frequency (in Hz) of this Audio Track /// public int SampleRate { get; set; } /// /// Gets or sets the bitrate (in bits/sec) of this Audio Track. /// public int Bitrate { get; set; } /// /// Gets the display string for this audio track. /// public string Display { get { return this.GetDisplayString(true); } } /// /// Gets the display string for this audio track (not including track number) /// public string NoTrackDisplay { get { return this.GetDisplayString(false); } } /// /// Override of the ToString method to make this object easier to use in the UI /// /// A string formatted as: {track #} {language} ({format}) ({sub-format}) public override string ToString() { return this.GetDisplayString(true); } private string GetDisplayString(bool includeTrackNumber) { if (includeTrackNumber) { return this.TrackNumber + " " + this.Description; } else { return this.Description; } } } }