diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs index 8f9260079..d5bcb930e 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs @@ -23,10 +23,6 @@ namespace HandBrake.ApplicationServices.Utilities /// </summary>
public class InteropModelCreator
{
- /*
- * TODO: This conversion class needs to be finished off before libencode will work.
- */
-
/// <summary>
/// Get an EncodeJob model for a LibHB Encode.
/// </summary>
@@ -180,12 +176,37 @@ namespace HandBrake.ApplicationServices.Utilities // job.SourceType = work.Type;
job.Title = work.Title;
- // TODO Setup subtitles
+ // Subtitles
job.Subtitles = new Subtitles { SourceSubtitles = new List<SourceSubtitle>(), SrtSubtitles = new List<SrtSubtitle>() };
- //foreach (SubtitleTrack track in work.SubtitleTracks)
- //{
- // // TODO
- //}
+ foreach (SubtitleTrack track in work.SubtitleTracks)
+ {
+ if (track.IsSrtSubtitle)
+ {
+ job.Subtitles.SrtSubtitles.Add(
+ new SrtSubtitle
+ {
+ CharacterCode = track.SrtCharCode,
+ Default = track.Default,
+ FileName = track.SrtFileName,
+ LanguageCode = track.SrtLang,
+ Offset = track.SrtOffset
+ });
+ }
+ else
+ {
+ if (track.SourceTrack != null)
+ {
+ job.Subtitles.SourceSubtitles.Add(
+ new SourceSubtitle
+ {
+ BurnedIn = track.Burned,
+ Default = track.Default,
+ Forced = track.Forced,
+ TrackNumber = track.SourceTrack.TrackNumber
+ });
+ }
+ }
+ }
return job;
}
|