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
6 // An object that represents a single Title of a DVD
\r
8 // --------------------------------------------------------------------------------------------------------------------
\r
10 using System.Drawing;
\r
12 namespace HandBrake.Interop.SourceData
\r
15 using System.Collections.Generic;
\r
19 /// An object that represents a single Title of a DVD
\r
24 /// Initializes a new instance of the <see cref="Title"/> class.
\r
28 this.AudioTracks = new List<AudioTrack>();
\r
29 this.Chapters = new List<Chapter>();
\r
30 this.Subtitles = new List<Subtitle>();
\r
34 /// Gets Collection of chapters in this Title
\r
36 public List<Chapter> Chapters { get; private set; }
\r
39 /// Gets Collection of audio tracks associated with this Title
\r
41 public List<AudioTrack> AudioTracks { get; private set; }
\r
44 /// Gets Collection of subtitles associated with this Title
\r
46 public List<Subtitle> Subtitles { get; private set; }
\r
49 /// Gets or sets The track number of this Title (1-based).
\r
51 public int TitleNumber { get; set; }
\r
54 /// Gets or sets The length in time of this Title
\r
56 public TimeSpan Duration { get; set; }
\r
59 /// Gets or sets The resolution (width/height) of this Title
\r
61 public Size Resolution { get; set; }
\r
64 /// Gets or sets The aspect ratio of this Title
\r
66 public double AspectRatio { get; set; }
\r
69 /// Gets or sets AngleCount.
\r
71 public int AngleCount { get; set; }
\r
74 /// Gets or sets Par Value
\r
76 public Size ParVal { get; set; }
\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
86 public Cropping AutoCropDimensions { get; set; }
\r
91 public string Display
\r
95 return this.ToString();
\r
100 /// Override of the ToString method to provide an easy way to use this object in the UI
\r
102 /// <returns>A string representing this track in the format: {title #} (00:00:00)</returns>
\r
103 public override string ToString()
\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