OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / interop / Model / EncodeJob.cs
1 // --------------------------------------------------------------------------------------------------------------------\r
2 // <copyright file="EncodeJob.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 //   Defines the EncodeJob type.\r
7 // </summary>\r
8 // --------------------------------------------------------------------------------------------------------------------\r
9 \r
10 namespace HandBrake.Interop.Model\r
11 {\r
12     using System;\r
13     using System.Collections.Generic;\r
14     using System.Xml.Serialization;\r
15     using Encoding;\r
16 \r
17     /// <summary>\r
18     /// An Encode Job\r
19     /// </summary>\r
20     public class EncodeJob\r
21     {\r
22         /// <summary>\r
23         /// Gets or sets SourceType.\r
24         /// </summary>\r
25         public SourceType SourceType { get; set; }\r
26 \r
27         /// <summary>\r
28         /// Gets or sets SourcePath.\r
29         /// </summary>\r
30         public string SourcePath { get; set; }\r
31 \r
32         /// <summary>\r
33         /// Gets or sets the 1-based index of the title to encode.\r
34         /// </summary>\r
35         public int Title { get; set; }\r
36 \r
37         /// <summary>\r
38         /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.\r
39         /// </summary>\r
40         public int Angle { get; set; }\r
41 \r
42         /// <summary>\r
43         /// Gets or sets ChapterStart.\r
44         /// </summary>\r
45         public int ChapterStart { get; set; }\r
46 \r
47         /// <summary>\r
48         /// Gets or sets ChapterEnd.\r
49         /// </summary>\r
50         public int ChapterEnd { get; set; }\r
51 \r
52         /// <summary>\r
53         /// Gets or sets the list of chosen audio tracks (1-based)\r
54         /// </summary>\r
55         public List<int> ChosenAudioTracks { get; set; }\r
56 \r
57         /// <summary>\r
58         /// Gets or sets Subtitles.\r
59         /// </summary>\r
60         public Subtitles Subtitles { get; set; }\r
61 \r
62         /// <summary>\r
63         /// Gets or sets a value indicating whether UseDefaultChapterNames.\r
64         /// </summary>\r
65         public bool UseDefaultChapterNames { get; set; }\r
66 \r
67         /// <summary>\r
68         /// Gets or sets CustomChapterNames.\r
69         /// </summary>\r
70         public List<string> CustomChapterNames { get; set; }\r
71 \r
72         /// <summary>\r
73         /// Gets or sets OutputPath.\r
74         /// </summary>\r
75         public string OutputPath { get; set; }\r
76 \r
77         /// <summary>\r
78         /// Gets or sets EncodingProfile.\r
79         /// </summary>\r
80         public EncodingProfile EncodingProfile { get; set; }\r
81 \r
82         /// <summary>\r
83         /// The length of video to encode.\r
84         /// </summary>\r
85         [XmlIgnore]\r
86         public TimeSpan Length { get; set; }\r
87 \r
88         /// <summary>\r
89         /// Gets or sets XmlLength.\r
90         /// </summary>\r
91         [XmlElement("Length")]\r
92         public string XmlLength\r
93         {\r
94             get { return this.Length.ToString(); }\r
95             set { this.Length = TimeSpan.Parse(value); }\r
96         }\r
97 \r
98         /// <summary>\r
99         /// Clone the Encode Job\r
100         /// </summary>\r
101         /// <returns>\r
102         /// An EncodeJob Ojbect\r
103         /// </returns>\r
104         public EncodeJob Clone()\r
105         {\r
106             EncodeJob clone = new EncodeJob\r
107             {\r
108                 SourceType = this.SourceType,\r
109                 SourcePath = this.SourcePath,\r
110                 Title = this.Title,\r
111                 ChapterStart = this.ChapterStart,\r
112                 ChapterEnd = this.ChapterEnd,\r
113                 ChosenAudioTracks = new List<int>(this.ChosenAudioTracks),\r
114                 Subtitles = this.Subtitles,\r
115                 UseDefaultChapterNames = this.UseDefaultChapterNames,\r
116                 OutputPath = this.OutputPath,\r
117                 EncodingProfile = this.EncodingProfile,\r
118                 Length = this.Length\r
119             };\r
120 \r
121             return clone;\r
122         }\r
123     }\r
124 }\r