summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs
blob: 30399519410b79c949db8f18883a64f81881ee8d (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
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EncodeProgressEventArgs.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 EncodeProgressEventArgs type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace HandBrake.Interop.Interop.EventArgs
{
    using System;

    /// <summary>s
    /// Encode Progress Event Args
    /// </summary>
    public class EncodeProgressEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EncodeProgressEventArgs"/> class.
        /// </summary>
        /// <param name="fractionComplete">
        /// The fraction complete.
        /// </param>
        /// <param name="currentFrameRate">
        /// The current frame rate.
        /// </param>
        /// <param name="averageFrameRate">
        /// The average frame rate.
        /// </param>
        /// <param name="estimatedTimeLeft">
        /// The estimated time left.
        /// </param>
        /// <param name="passId">
        /// The pass id.
        /// </param>
        /// <param name="pass">
        /// The pass.
        /// </param>
        /// <param name="passCount">
        /// The pass count.
        /// </param>
        /// <param name="stateCode">
        /// The code for the state the encode process is in.
        /// </param>
        public EncodeProgressEventArgs(double fractionComplete, double currentFrameRate, double averageFrameRate, TimeSpan estimatedTimeLeft, int passId, int pass, int passCount, string stateCode)
        {
            this.FractionComplete = fractionComplete;
            this.CurrentFrameRate = currentFrameRate;
            this.AverageFrameRate = averageFrameRate;
            this.EstimatedTimeLeft = estimatedTimeLeft;
            this.PassId = passId;
            this.Pass = pass;
            this.PassCount = passCount;
            this.StateCode = stateCode;
        }

        /// <summary>
        /// Gets the % Complete.
        /// </summary>
        public double FractionComplete { get; private set; }

        /// <summary>
        /// Gets the Current FrameRate.
        /// </summary>
        public double CurrentFrameRate { get; private set; }

        /// <summary>
        /// Gets the Average FrameRate.
        /// </summary>
        public double AverageFrameRate { get; private set; }

        /// <summary>
        /// Gets the Estimated Time Left.
        /// </summary>
        public TimeSpan EstimatedTimeLeft { get; private set; }

        /// <summary>
        /// Gets the pass ID.
        /// </summary>
        /// <remarks>
        /// -1: Subtitle scan
        ///  0: Encode
        ///  1: Encode first pass
        ///  2: Encode second pass
        /// </remarks>
        public int PassId { get; private set; }

        /// <summary>
        /// Gets the current encoding pass. (1-based)
        /// </summary>
        public int Pass { get; private set; }

        /// <summary>
        /// Gets the pass count.
        /// </summary>
        public int PassCount { get; private set; }

        /// <summary>
        /// Gets the state code of the encode process.
        /// </summary>
        public string StateCode { get; }

        /// <summary>
        /// Gets a value indicating that we are doing a subtitle scan pass.
        /// </summary>
        public bool IsSubtitleScan
        {
            get
            {
                if (this.PassId == -1)
                {
                    return true;
                }

                return false;
            }
        }
    }
}