Handle vertical alignment of subs correctly wrt the difference between Interop and...
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.h
index 0756a278f4b475212e2313b2efe40c2dbf76d7d1..3eed4ad24cd5863dddd9197972c3773693c7b7dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "subtitle_decoder.h"
+
+#include "text_decoder.h"
 #include "dcp_subtitle.h"
 
+
 class DCPSubtitleContent;
 
+
 class DCPSubtitleDecoder : public DCPSubtitle, public Decoder
 {
 public:
-       DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>, boost::shared_ptr<Log> log);
+       DCPSubtitleDecoder (std::shared_ptr<const Film> film, std::shared_ptr<const DCPSubtitleContent>);
 
-       bool pass ();
-       void seek (ContentTime time, bool accurate);
+       bool pass () override;
+       void seek (dcpomatic::ContentTime time, bool accurate) override;
+
+       boost::optional<dcpomatic::ContentTime> first () const;
 
 private:
-       ContentTimePeriod content_time_period (boost::shared_ptr<dcp::Subtitle> s) const;
+       dcpomatic::ContentTimePeriod content_time_period (std::shared_ptr<const dcp::Subtitle> s) const;
+       void update_position();
+
+       std::vector<std::shared_ptr<const dcp::Subtitle>> _subtitles;
+       std::vector<std::shared_ptr<const dcp::Subtitle>>::const_iterator _next;
 
-       std::list<boost::shared_ptr<dcp::Subtitle> > _subtitles;
-       std::list<boost::shared_ptr<dcp::Subtitle> >::const_iterator _next;
+       dcp::Standard _standard;
 };