Use plain git hash for VERSION when there is no exact tag.
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.h
index 4b52a1ac418d25582d9f6a70c9ad4e30c48e1c5b..9d085125382e82f55d237e52414585f3e3930cf4 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 "dcp_subtitle.h"
+#include "font_id_allocator.h"
+#include "text_decoder.h"
+
 
 class DCPSubtitleContent;
 
+
 class DCPSubtitleDecoder : public DCPSubtitle, public Decoder
 {
 public:
-       DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>);
+       DCPSubtitleDecoder (std::shared_ptr<const Film> film, std::shared_ptr<const DCPSubtitleContent>);
 
-protected:
-       bool pass (PassReason, bool accurate);
-       void seek (ContentTime time, bool accurate);
+       bool pass () override;
+       void seek (dcpomatic::ContentTime time, bool accurate) override;
+
+       boost::optional<dcpomatic::ContentTime> first () const;
 
 private:
-       std::list<ContentTimePeriod> image_subtitles_during (ContentTimePeriod, bool starting) const;
-       std::list<ContentTimePeriod> text_subtitles_during (ContentTimePeriod, bool starting) const;
-       ContentTimePeriod content_time_period (dcp::SubtitleString 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;
+
+       dcp::SubtitleStandard _subtitle_standard;
 
-       std::list<dcp::SubtitleString> _subtitles;
-       std::list<dcp::SubtitleString>::const_iterator _next;
+       std::shared_ptr<dcp::SubtitleAsset> _asset;
+       FontIDAllocator _font_id_allocator;
 };