Add another believed-correct subtitle timing fix.
[dcpomatic.git] / src / lib / text_decoder.h
index 02afeeb94251132984f24b7ae215e0734433b224..6e96b6b914abd109f52a2c3f4af4c161a9cc385f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_CAPTION_DECODER_H
 #define DCPOMATIC_CAPTION_DECODER_H
 
+
 #include "decoder.h"
 #include "rect.h"
 #include "types.h"
 #include <dcp/subtitle_string.h>
 #include <boost/signals2.hpp>
 
+
 namespace sub {
        class Subtitle;
 }
 
 class Image;
 
+
 class TextDecoder : public DecoderPart
 {
 public:
        TextDecoder (
                Decoder* parent,
-               boost::shared_ptr<const TextContent>,
+               std::shared_ptr<const TextContent>,
                dcpomatic::ContentTime first
                );
 
-       dcpomatic::ContentTime position (boost::shared_ptr<const Film>) const {
+       boost::optional<dcpomatic::ContentTime> position (std::shared_ptr<const Film>) const {
                return _position;
        }
 
-       void emit_bitmap_start (dcpomatic::ContentTime from, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
-       void emit_bitmap (dcpomatic::ContentTimePeriod period, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
+       void emit_bitmap_start (dcpomatic::ContentTime from, std::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
+       void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
        void emit_plain_start (dcpomatic::ContentTime from, std::list<dcp::SubtitleString> s);
        void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle);
        void emit_plain (dcpomatic::ContentTimePeriod period, std::list<dcp::SubtitleString> s);
@@ -58,7 +62,7 @@ public:
 
        void seek ();
 
-       boost::shared_ptr<const TextContent> content () const {
+       std::shared_ptr<const TextContent> content () const {
                return _content;
        }
 
@@ -67,8 +71,9 @@ public:
        boost::signals2::signal<void (dcpomatic::ContentTime)> Stop;
 
 private:
-       boost::shared_ptr<const TextContent> _content;
-       dcpomatic::ContentTime _position;
+       std::shared_ptr<const TextContent> _content;
+       boost::optional<dcpomatic::ContentTime> _position;
 };
 
+
 #endif