OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / interop / SourceData / AudioTrack.cs
1 // --------------------------------------------------------------------------------------------------------------------\r
2 // <copyright file="AudioTrack.cs" company="HandBrake Project (http://handbrake.fr)">\r
3 //   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
4 // </copyright>\r
5 // <summary>\r
6 //   An object represending an AudioTrack associated with a Title, in a DVD\r
7 // </summary>\r
8 // --------------------------------------------------------------------------------------------------------------------\r
9 \r
10 namespace HandBrake.Interop.SourceData\r
11 {\r
12     /// <summary>\r
13     /// An object represending an AudioTrack associated with a Title, in a DVD\r
14     /// </summary>\r
15     public class AudioTrack\r
16     {\r
17         /// <summary>\r
18         /// Gets or sets the track number of this Audio Track\r
19         /// </summary>\r
20         public int TrackNumber { get; set; }\r
21 \r
22         /// <summary>\r
23         /// Gets or sets the language (if detected) of this Audio Track\r
24         /// </summary>\r
25         public string Language { get; set; }\r
26 \r
27         /// <summary>\r
28         /// Gets or sets LanguageCode.\r
29         /// </summary>\r
30         public string LanguageCode { get; set; }\r
31 \r
32         /// <summary>\r
33         /// Gets or sets Description.\r
34         /// </summary>\r
35         public string Description { get; set; }\r
36 \r
37         /// <summary>\r
38         /// Gets or sets the frequency (in MHz) of this Audio Track\r
39         /// </summary>\r
40         public int SampleRate { get; set; }\r
41 \r
42         /// <summary>\r
43         /// Gets or sets the bitrate (in kbps) of this Audio Track\r
44         /// </summary>\r
45         public int Bitrate { get; set; }\r
46 \r
47         /// <summary>\r
48         /// Gets Display.\r
49         /// </summary>\r
50         public string Display\r
51         {\r
52             get\r
53             {\r
54                 return this.GetDisplayString(true);\r
55             }\r
56         }\r
57 \r
58         /// <summary>\r
59         /// Gets NoTrackDisplay.\r
60         /// </summary>\r
61         public string NoTrackDisplay\r
62         {\r
63             get\r
64             {\r
65                 return this.GetDisplayString(false);\r
66             }\r
67         }\r
68 \r
69         /// <summary>\r
70         /// Override of the ToString method to make this object easier to use in the UI\r
71         /// </summary>\r
72         /// <returns>A string formatted as: {track #} {language} ({format}) ({sub-format})</returns>\r
73         public override string ToString()\r
74         {\r
75             return this.GetDisplayString(true);\r
76         }\r
77 \r
78         /// <summary>\r
79         /// Get the Display String\r
80         /// </summary>\r
81         /// <param name="includeTrackNumber">\r
82         /// The include track number.\r
83         /// </param>\r
84         /// <returns>\r
85         /// A String\r
86         /// </returns>\r
87         private string GetDisplayString(bool includeTrackNumber)\r
88         {\r
89             return includeTrackNumber ? (this.TrackNumber + " " + this.Description) : this.Description;\r
90         }\r
91     }\r
92 }