No-op: remove all trailing whitespace.
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 20a9f32fee031ddd99fc03f19ab1d5182614e6f7..3c7bffdda440295cdc8033bb943922b6e5ba743b 100644 (file)
@@ -17,9 +17,9 @@
 
 */
 
-#include <dcp/subtitle_content.h>
 #include "dcp_subtitle_decoder.h"
 #include "dcp_subtitle_content.h"
+#include <dcp/interop_subtitle_asset.h>
 
 using std::list;
 using std::cout;
@@ -28,8 +28,8 @@ using boost::shared_ptr;
 DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content)
        : SubtitleDecoder (content)
 {
-       dcp::SubtitleContent c (content->path (0), false);
-       _subtitles = c.subtitles ();
+       shared_ptr<dcp::SubtitleAsset> c (load (content->path (0)));
+       _subtitles = c->subtitles ();
        _next = _subtitles.begin ();
 }
 
@@ -40,7 +40,7 @@ DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
 
        _next = _subtitles.begin ();
        list<dcp::SubtitleString>::const_iterator i = _subtitles.begin ();
-       while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().to_seconds()) < time) {
+       while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().as_seconds()) < time) {
                ++i;
        }
 }
@@ -61,7 +61,13 @@ DCPSubtitleDecoder::pass ()
 }
 
 list<ContentTimePeriod>
-DCPSubtitleDecoder::subtitles_during (ContentTimePeriod p, bool starting) const
+DCPSubtitleDecoder::image_subtitles_during (ContentTimePeriod, bool) const
+{
+       return list<ContentTimePeriod> ();
+}
+
+list<ContentTimePeriod>
+DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const
 {
        /* XXX: inefficient */
 
@@ -69,10 +75,10 @@ DCPSubtitleDecoder::subtitles_during (ContentTimePeriod p, bool starting) const
 
        for (list<dcp::SubtitleString>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
                ContentTimePeriod period (
-                       ContentTime::from_seconds (i->in().to_seconds ()),
-                       ContentTime::from_seconds (i->out().to_seconds ())
+                       ContentTime::from_seconds (i->in().as_seconds ()),
+                       ContentTime::from_seconds (i->out().as_seconds ())
                        );
-               
+
                if ((starting && p.contains (period.from)) || (!starting && p.overlaps (period))) {
                        d.push_back (period);
                }