summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-01-26 16:21:27 +0000
committersr55 <[email protected]>2013-01-26 16:21:27 +0000
commit97d4f114df3e35c559e7f1564a542631b55f2845 (patch)
treeaa31b44c0f5fbc952c1648edcf76107a8959874a /win/CS/HandBrake.ApplicationServices/Utilities
parent5aa8001465c0e94ac2470969613042bff221c6d4 (diff)
WinGui: Code Tidyup.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5206 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs39
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;
}