OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / interop / SourceData / Title.cs
1 // --------------------------------------------------------------------------------------------------------------------\r
2 // <copyright file="Title.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 that represents a single Title of a DVD\r
7 // </summary>\r
8 // --------------------------------------------------------------------------------------------------------------------\r
9 \r
10 using System.Drawing;\r
11 \r
12 namespace HandBrake.Interop.SourceData\r
13 {\r
14     using System;\r
15     using System.Collections.Generic;\r
16     using Model;\r
17 \r
18     /// <summary>\r
19     /// An object that represents a single Title of a DVD\r
20     /// </summary>\r
21     public class Title\r
22     {\r
23         /// <summary>\r
24         /// Initializes a new instance of the <see cref="Title"/> class. \r
25         /// </summary>\r
26         public Title()\r
27         {\r
28             this.AudioTracks = new List<AudioTrack>();\r
29             this.Chapters = new List<Chapter>();\r
30             this.Subtitles = new List<Subtitle>();\r
31         }\r
32 \r
33         /// <summary>\r
34         /// Gets Collection of chapters in this Title\r
35         /// </summary>\r
36         public List<Chapter> Chapters { get; private set; }\r
37 \r
38         /// <summary>\r
39         /// Gets Collection of audio tracks associated with this Title\r
40         /// </summary>\r
41         public List<AudioTrack> AudioTracks { get; private set; }\r
42 \r
43         /// <summary>\r
44         /// Gets Collection of subtitles associated with this Title\r
45         /// </summary>\r
46         public List<Subtitle> Subtitles { get; private set; }\r
47 \r
48         /// <summary>\r
49         /// Gets or sets The track number of this Title (1-based).\r
50         /// </summary>\r
51         public int TitleNumber { get; set; }\r
52 \r
53         /// <summary>\r
54         /// Gets or sets The length in time of this Title\r
55         /// </summary>\r
56         public TimeSpan Duration { get; set; }\r
57 \r
58         /// <summary>\r
59         /// Gets or sets The resolution (width/height) of this Title\r
60         /// </summary>\r
61         public Size Resolution { get; set; }\r
62 \r
63         /// <summary>\r
64         /// Gets or sets The aspect ratio of this Title\r
65         /// </summary>\r
66         public double AspectRatio { get; set; }\r
67 \r
68         /// <summary>\r
69         /// Gets or sets AngleCount.\r
70         /// </summary>\r
71         public int AngleCount { get; set; }\r
72 \r
73         /// <summary>\r
74         /// Gets or sets Par Value\r
75         /// </summary>\r
76         public Size ParVal { get; set; }\r
77 \r
78         /// <summary>\r
79         /// Gets or sets the automatically detected crop region for this Title.\r
80         /// This is an int array with 4 items in it as so:\r
81         /// 0: \r
82         /// 1: \r
83         /// 2: \r
84         /// 3: \r
85         /// </summary>\r
86         public Cropping AutoCropDimensions { get; set; }\r
87 \r
88         /// <summary>\r
89         /// Gets Display.\r
90         /// </summary>\r
91         public string Display\r
92         {\r
93             get\r
94             {\r
95                 return this.ToString();\r
96             }\r
97         }\r
98   \r
99         /// <summary>\r
100         /// Override of the ToString method to provide an easy way to use this object in the UI\r
101         /// </summary>\r
102         /// <returns>A string representing this track in the format: {title #} (00:00:00)</returns>\r
103         public override string ToString()\r
104         {\r
105             return string.Format("{0} ({1:00}:{2:00}:{3:00})", this.TitleNumber, this.Duration.Hours,\r
106                                  this.Duration.Minutes, this.Duration.Seconds);\r
107         }\r
108     }\r
109 }