From 55ae87db22c7ca2657a29c0939cfd513bdc6c2b9 Mon Sep 17 00:00:00 2001 From: randomengy Date: Mon, 15 Jun 2015 01:05:43 +0000 Subject: Interop: Updated to return PassId as well as Pass on encode progress. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7297 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Interop/EventArgs/EncodeProgressEventArgs.cs | 13 ++++++++++++- .../Interop/HandBrakeInstance.cs | 3 ++- .../Interop/HbLib/NativeConstants.cs | 2 +- .../Interop/Json/State/Working.cs | 15 +++++++++++++-- 4 files changed, 28 insertions(+), 5 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs index bbb9a6d07..82003719f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs @@ -36,8 +36,19 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs /// public TimeSpan EstimatedTimeLeft { get; set; } + /// + /// Gets or sets the pass ID. + /// + /// + /// -1: Subtitle scan + /// 0: Encode + /// 1: Encode first pass + /// 2: Encode second pass + /// + public int PassId { get; set; } + /// - /// Gets or sets the current encoding pass. (-1: subtitle scan, 1: first pass, 2: second pass) + /// Gets or sets the current encoding pass. (1-based) /// public int Pass { get; set; } diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs index b44136095..62e4e1b5c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs @@ -562,7 +562,8 @@ namespace HandBrake.ApplicationServices.Interop FractionComplete = state.Working.Progress, CurrentFrameRate = state.Working.Rate, AverageFrameRate = state.Working.RateAvg, - EstimatedTimeLeft = new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds), + EstimatedTimeLeft = new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds), + PassId = state.Working.PassID, Pass = state.Working.Pass, PassCount = state.Working.PassCount }; diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs index 355a023d8..80f9e33be 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs @@ -31,7 +31,7 @@ namespace HandBrake.ApplicationServices.Interop.HbLib public const uint HB_ACODEC_FDK_HAAC = 0x00800000; public const uint HB_ACODEC_FFEAC3 = 0x01000000; public const uint HB_ACODEC_FFTRUEHD = 0x02000000; - public const uint HB_ACODEC_FF_MASK = 0x00FF2800; + public const uint HB_ACODEC_FF_MASK = 0x03FF2800; public const uint HB_ACODEC_PASS_FLAG = 0x40000000; public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFFLAC | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD); public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG); diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs index dfc301b10..2347eb4c2 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs @@ -20,12 +20,23 @@ namespace HandBrake.ApplicationServices.Interop.Json.State public int Hours { get; set; } /// - /// Gets or sets the job. + /// Gets or sets the Pass ID. + /// + /// + /// -1: Subtitle scan + /// 0: Encode + /// 1: Encode first pass + /// 2: Encode second pass + /// + public int PassID { get; set; } + + /// + /// Gets or sets the pass number (1-based). /// public int Pass { get; set; } /// - /// Gets or sets the job count. + /// Gets or sets the pass count. /// public int PassCount { get; set; } -- cgit v1.2.3