Merge branch 'master' into 2.0
[dcpomatic.git] / src / lib / subtitle_decoder.cc
index 0ffe5e50158e1a70a9bf242b8dc43b3b00c07a1a..e5cadb7b48b4e513c3b11a7ad47babc10ecda689 100644 (file)
 
 #include <boost/shared_ptr.hpp>
 #include "subtitle_decoder.h"
-#include "subtitle.h"
 
+using std::list;
 using boost::shared_ptr;
+using boost::optional;
 
 SubtitleDecoder::SubtitleDecoder (shared_ptr<const Film> f)
        : Decoder (f)
@@ -30,12 +31,17 @@ SubtitleDecoder::SubtitleDecoder (shared_ptr<const Film> f)
 }
 
 
-/** Called by subclasses when a subtitle is ready.
- *  s may be 0 to say that there is no current subtitle.
- *  @param s New current subtitle, or 0.
+/** Called by subclasses when an image subtitle is ready.
+ *  Image may be 0 to say that there is no current subtitle.
  */
 void
-SubtitleDecoder::subtitle (shared_ptr<TimedSubtitle> s)
+SubtitleDecoder::image_subtitle (shared_ptr<Image> image, dcpomatic::Rect<double> rect, ContentTime from, ContentTime to)
 {
-       Subtitle (s);
+       _pending.push_back (shared_ptr<DecodedImageSubtitle> (new DecodedImageSubtitle (image, rect, from, to)));
+}
+
+void
+SubtitleDecoder::text_subtitle (list<libdcp::Subtitle> s)
+{
+       _pending.push_back (shared_ptr<DecodedTextSubtitle> (new DecodedTextSubtitle (s)));
 }