OSDN Git Service

CLI: update the built in presets
[handbrake-jp/handbrake-jp-git.git] / win / C# / Model / Subtitle.cs
1 /*  Subtitle.cs $\r
2     This file is part of the HandBrake source code.\r
3     Homepage: <http://handbrake.fr>.\r
4     It may be used under the terms of the GNU General Public License. */\r
5 \r
6 namespace Handbrake.Model\r
7 {\r
8     using System.Windows.Forms;\r
9 \r
10     using HandBrake.ApplicationServices.Model;\r
11 \r
12     /// <summary>\r
13     /// Subtitle Information\r
14     /// </summary>\r
15     public class SubtitleInfo\r
16     {\r
17         /// <summary>\r
18         /// Gets or sets the Subtitle Track\r
19         /// </summary>\r
20         public string Track { get; set; }\r
21 \r
22         /// <summary>\r
23         /// Gets or sets the Forced Subtitle\r
24         /// </summary>\r
25         public bool Forced { get; set; }\r
26 \r
27         /// <summary>\r
28         /// Gets or sets the Burned In Subtitle\r
29         /// </summary>\r
30         public bool Burned { get; set; }\r
31 \r
32         /// <summary>\r
33         /// Gets or sets the Default Subtitle Track\r
34         /// </summary>\r
35         public bool Default { get; set; }\r
36 \r
37         /// <summary>\r
38         /// Gets or sets the SRT Language\r
39         /// </summary>\r
40         public string SrtLang { get; set; }\r
41 \r
42         /// <summary>\r
43         /// Gets or sets the SRT Character Code\r
44         /// </summary>\r
45         public string SrtCharCode { get; set; }\r
46 \r
47         /// <summary>\r
48         /// Gets or sets the SRT Offset\r
49         /// </summary>\r
50         public int SrtOffset { get; set; }\r
51 \r
52         /// <summary>\r
53         /// Gets or sets the Path to the SRT file\r
54         /// </summary>\r
55         public string SrtPath { get; set; }\r
56 \r
57         /// <summary>\r
58         /// Gets or sets the SRT Filename\r
59         /// </summary>\r
60         public string SrtFileName { get; set; }\r
61 \r
62         /// <summary>\r
63         /// Gets a value indicating whether this is an SRT subtitle.\r
64         /// </summary>\r
65         public bool IsSrtSubtitle\r
66         {\r
67             get { return this.SrtFileName != "-"; }\r
68         }\r
69 \r
70         /// <summary>\r
71         /// Gets or sets the type of the subtitle\r
72         /// </summary>\r
73         public SubtitleType SubtitleType { get; set; }\r
74 \r
75         /// <summary>\r
76         /// Gets A ListViewItem Containing information about this subitlte\r
77         /// </summary>\r
78         public ListViewItem ListView\r
79         {\r
80             get\r
81             {\r
82                 var listTrack = new ListViewItem(this.Track);\r
83                 listTrack.SubItems.Add(this.Forced ? "Yes" : "No");\r
84                 listTrack.SubItems.Add(this.Burned ? "Yes" : "No");\r
85                 listTrack.SubItems.Add(this.Default ? "Yes" : "No");\r
86                 listTrack.SubItems.Add(this.SrtLang);\r
87                 listTrack.SubItems.Add(this.SrtCharCode);\r
88                 listTrack.SubItems.Add(this.SrtOffset.ToString());\r
89                 return listTrack;\r
90             }\r
91         }\r
92     }\r
93 }