summaryrefslogtreecommitdiffstats
path: root/win/C#/interop/Model/EncodeJob.cs
blob: d454c6b3030783292d70c2eecf7482f575baa17c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EncodeJob.cs" company="HandBrake Project (http://handbrake.fr)">
//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
// <summary>
//   Defines the EncodeJob type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace HandBrake.Interop.Model
{
    using System;
    using System.Collections.Generic;
    using System.Xml.Serialization;
    using Encoding;

    /// <summary>
    /// An Encode Job
    /// </summary>
    public class EncodeJob
    {
        /// <summary>
        /// Gets or sets SourceType.
        /// </summary>
        public SourceType SourceType { get; set; }

        /// <summary>
        /// Gets or sets SourcePath.
        /// </summary>
        public string SourcePath { get; set; }

        /// <summary>
        /// Gets or sets the 1-based index of the title to encode.
        /// </summary>
        public int Title { get; set; }

        /// <summary>
        /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
        /// </summary>
        public int Angle { get; set; }

        /// <summary>
        /// Gets or sets ChapterStart.
        /// </summary>
        public int ChapterStart { get; set; }

        /// <summary>
        /// Gets or sets ChapterEnd.
        /// </summary>
        public int ChapterEnd { get; set; }

        /// <summary>
        /// Gets or sets the list of chosen audio tracks (1-based)
        /// </summary>
        public List<int> ChosenAudioTracks { get; set; }

        /// <summary>
        /// Gets or sets Subtitles.
        /// </summary>
        public Subtitles Subtitles { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether UseDefaultChapterNames.
        /// </summary>
        public bool UseDefaultChapterNames { get; set; }

        /// <summary>
        /// Gets or sets CustomChapterNames.
        /// </summary>
        public List<string> CustomChapterNames { get; set; }

        /// <summary>
        /// Gets or sets OutputPath.
        /// </summary>
        public string OutputPath { get; set; }

        /// <summary>
        /// Gets or sets EncodingProfile.
        /// </summary>
        public EncodingProfile EncodingProfile { get; set; }

        /// <summary>
        /// The length of video to encode.
        /// </summary>
        [XmlIgnore]
        public TimeSpan Length { get; set; }

        /// <summary>
        /// Gets or sets XmlLength.
        /// </summary>
        [XmlElement("Length")]
        public string XmlLength
        {
            get { return this.Length.ToString(); }
            set { this.Length = TimeSpan.Parse(value); }
        }

        /// <summary>
        /// Clone the Encode Job
        /// </summary>
        /// <returns>
        /// An EncodeJob Ojbect
        /// </returns>
        public EncodeJob Clone()
        {
            EncodeJob clone = new EncodeJob
            {
                SourceType = this.SourceType,
                SourcePath = this.SourcePath,
                Title = this.Title,
                ChapterStart = this.ChapterStart,
                ChapterEnd = this.ChapterEnd,
                ChosenAudioTracks = new List<int>(this.ChosenAudioTracks),
                Subtitles = this.Subtitles,
                UseDefaultChapterNames = this.UseDefaultChapterNames,
                OutputPath = this.OutputPath,
                EncodingProfile = this.EncodingProfile,
                Length = this.Length
            };

            return clone;
        }
    }
}