summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-02-02 20:34:09 +0000
committersr55 <[email protected]>2014-02-02 20:34:09 +0000
commit96dfced7fe9f278b8985ead77bd34d4ae39fb0fb (patch)
treeef1741266c56b8884bc5e5a40cdb9b97b440a4ba /win/CS/HandBrake.ApplicationServices
parent2c2aae581e34e3ba891fc0374be17d29718b41ff (diff)
WinGui: Use libhb for subtitle burnin / forced checking.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6012 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs2
3 files changed, 35 insertions, 7 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
index 02bacc429..512aa9b44 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
@@ -233,8 +233,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
{
if (this.SourceTrack != null)
{
- return this.SourceTrack.SubtitleType == SubtitleType.VobSub || this.SourceTrack.SubtitleType == SubtitleType.PGS
- || this.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch;
+ return this.SourceTrack.CanForce || this.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch;
}
return false;
@@ -247,11 +246,10 @@ namespace HandBrake.ApplicationServices.Model.Encoding
public bool CanBeBurned
{
get
- {
+ {
if (this.SourceTrack != null)
{
- return this.SourceTrack.SubtitleType == SubtitleType.VobSub || this.SourceTrack.SubtitleType == SubtitleType.PGS
- || this.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch || this.SourceTrack.SubtitleType == SubtitleType.SSA;
+ return this.SourceTrack.CanBurnIn || this.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch;
}
return false;
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs
index e40734b55..3b026bdf5 100644
--- a/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs
+++ b/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs
@@ -10,6 +10,7 @@
namespace HandBrake.ApplicationServices.Parsing
{
using System;
+ using System.Xml.Serialization;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Utilities;
@@ -29,6 +30,9 @@ namespace HandBrake.ApplicationServices.Parsing
/// <summary>
/// Initializes a new instance of the <see cref="Subtitle"/> class.
/// </summary>
+ /// <param name="sourceId">
+ /// The source Id.
+ /// </param>
/// <param name="trackNumber">
/// The track number.
/// </param>
@@ -41,15 +45,29 @@ namespace HandBrake.ApplicationServices.Parsing
/// <param name="subtitleType">
/// The subtitle type.
/// </param>
- public Subtitle(int trackNumber, string language, string languageCode, SubtitleType subtitleType)
+ /// <param name="canBurn">
+ /// The can Burn.
+ /// </param>
+ /// <param name="canForce">
+ /// The can Force.
+ /// </param>
+ public Subtitle(int sourceId, int trackNumber, string language, string languageCode, SubtitleType subtitleType, bool canBurn, bool canForce)
{
+ this.SourceId = sourceId;
this.TrackNumber = trackNumber;
this.Language = language;
this.LanguageCode = languageCode;
this.SubtitleType = subtitleType;
+ this.CanBurnIn = canBurn;
+ this.CanForce = canForce;
}
/// <summary>
+ /// Gets or sets the source id.
+ /// </summary>
+ public int SourceId { get; set; }
+
+ /// <summary>
/// Gets or sets the track number of this Subtitle
/// </summary>
public int TrackNumber { get; set; }
@@ -81,6 +99,18 @@ namespace HandBrake.ApplicationServices.Parsing
}
/// <summary>
+ /// Gets a value indicating whether can burn in.
+ /// </summary>
+ [XmlIgnore]
+ public bool CanBurnIn { get; private set; }
+
+ /// <summary>
+ /// Gets a value indicating whether can force.
+ /// </summary>
+ [XmlIgnore]
+ public bool CanForce { get; private set; }
+
+ /// <summary>
/// Gets or sets the Subtitle Type
/// </summary>
public SubtitleType SubtitleType { get; set; }
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
index 7831f6bb2..203459e9c 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
@@ -501,7 +501,7 @@ namespace HandBrake.ApplicationServices.Services
break;
}
- converted.Subtitles.Add(new Subtitle(track.TrackNumber, track.Language, track.LanguageCode, convertedType));
+ converted.Subtitles.Add(new Subtitle(track.SubtitleSourceInt, track.TrackNumber, track.Language, track.LanguageCode, convertedType, track.CanBurn, track.CanSetForcedOnly));
}
titleList.Add(converted);