diff options
4 files changed, 56 insertions, 7 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index 59d45029f..e06d9dc5d 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -1825,6 +1825,8 @@ namespace HandBrake.Interop newSubtitle.SubtitleType = SubtitleType.Text;
}
+ newSubtitle.SubtitleSourceInt = (int)subtitle.source;
+
switch (subtitle.source)
{
case hb_subtitle_s_subsource.CC608SUB:
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index 9fc20ede6..423afad1c 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -230,6 +230,14 @@ namespace HandBrake.Interop.HbLib [DllImport("hb.dll", EntryPoint = "hb_srt_add", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_srt_add(ref hb_job_s job, ref hb_subtitle_config_s subtitleConfig, string lang);
+ [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_force", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_subtitle_can_force(int source);
+
+ [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_burn", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_subtitle_can_burn(int source);
+
+ [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_pass", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_subtitle_can_pass(int source, int mux);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs index 1914e758f..50ecffdda 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.50.0.0")]
-[assembly: AssemblyFileVersion("1.50.0.0")]
+[assembly: AssemblyVersion("1.51.0.0")]
+[assembly: AssemblyFileVersion("1.51.0.0")]
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs index 570bc174e..fbb08402f 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Subtitle.cs @@ -9,7 +9,9 @@ namespace HandBrake.Interop.SourceData
{
- /// <summary>
+ using HandBrake.Interop.HbLib;
+
+ /// <summary>
/// An object that represents a subtitle associated with a Title, in a DVD
/// </summary>
public class Subtitle
@@ -40,6 +42,43 @@ namespace HandBrake.Interop.SourceData public SubtitleSource SubtitleSource { get; set; }
/// <summary>
+ /// Gets or sets the subtitle source raw integer.
+ /// </summary>
+ public int SubtitleSourceInt { get; set; }
+
+ /// <summary>
+ /// Gets a value indicating whether the "forced only" flag can be set on this subtitle.
+ /// </summary>
+ public bool CanSetForcedOnly
+ {
+ get
+ {
+ return HBFunctions.hb_subtitle_can_force(this.SubtitleSourceInt) > 0;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this subtitle can be burned into the picture.
+ /// </summary>
+ public bool CanBurn
+ {
+ get
+ {
+ return HBFunctions.hb_subtitle_can_burn(this.SubtitleSourceInt) > 0;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if the subtitle can be passed through using the given muxer.
+ /// </summary>
+ /// <param name="muxer">The muxer ID.</param>
+ /// <returns>True if the subtitle can be passed through.</returns>
+ public bool CanPass(int muxer)
+ {
+ return HBFunctions.hb_subtitle_can_pass(this.SubtitleSourceInt, muxer) > 0;
+ }
+
+ /// <summary>
/// Override of the ToString method to make this object easier to use in the UI
/// </summary>
/// <returns>A string formatted as: {track #} {language}</returns>
@@ -48,10 +87,10 @@ namespace HandBrake.Interop.SourceData return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.SubtitleSource);
}
- /// <summary>
- /// Gets the display.
- /// </summary>
- public string Display
+ /// <summary>
+ /// Gets the display.
+ /// </summary>
+ public string Display
{
get
{
|