--- /dev/null
+/* AudioTrack.cs $\r
+ \r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
+using System;\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.Text.RegularExpressions;\r
+\r
+namespace HandBrake.SourceData\r
+{\r
+ /// <summary>\r
+ /// An object represending an AudioTrack associated with a Title, in a DVD\r
+ /// </summary>\r
+ public class AudioTrack\r
+ {\r
+ /// <summary>\r
+ /// The track number of this Audio Track\r
+ /// </summary>\r
+ public int TrackNumber { get; set; }\r
+\r
+ /// <summary>\r
+ /// The language (if detected) of this Audio Track\r
+ /// </summary>\r
+ public string Language { get; set; }\r
+\r
+ public string LanguageCode { get; set; }\r
+\r
+ public string Description { get; set; }\r
+\r
+ /// <summary>\r
+ /// The frequency (in MHz) of this Audio Track\r
+ /// </summary>\r
+ public int SampleRate { get; set; }\r
+\r
+ /// <summary>\r
+ /// The bitrate (in kbps) of this Audio Track\r
+ /// </summary>\r
+ public int Bitrate { get; set; }\r
+\r
+ public string Display\r
+ {\r
+ get\r
+ {\r
+ return this.GetDisplayString(true);\r
+ }\r
+ }\r
+\r
+ public string NoTrackDisplay\r
+ {\r
+ get\r
+ {\r
+ return this.GetDisplayString(false);\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Override of the ToString method to make this object easier to use in the UI\r
+ /// </summary>\r
+ /// <returns>A string formatted as: {track #} {language} ({format}) ({sub-format})</returns>\r
+ public override string ToString()\r
+ {\r
+ return this.GetDisplayString(true);\r
+ }\r
+\r
+ private string GetDisplayString(bool includeTrackNumber)\r
+ {\r
+ if (includeTrackNumber)\r
+ {\r
+ return this.TrackNumber + " " + this.Description;\r
+ }\r
+ else\r
+ {\r
+ return this.Description;\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file