X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Flib%2Fdcp_subtitle_decoder.h;h=16f89b53002b0023dd09e4baa37704aa6b3afdde;hb=e7efb7d651d4555ed8dd2b3c4980b5222d1e0521;hp=359d191457379f8713ed9ee78035c3ac0a6b0a42;hpb=eb135e8dcdf36ae82420bcd18e954ad593b3e9a5;p=dcpomatic.git diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h index 359d19145..16f89b530 100644 --- a/src/lib/dcp_subtitle_decoder.h +++ b/src/lib/dcp_subtitle_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,22 +18,28 @@ */ -#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, boost::shared_ptr log); + DCPSubtitleDecoder (std::shared_ptr film, std::shared_ptr); + + bool pass () override; + void seek (dcpomatic::ContentTime time, bool accurate) override; - bool pass (); - void seek (ContentTime time, bool accurate); + boost::optional first () const; private: - ContentTimePeriod content_time_period (dcp::SubtitleString s) const; + dcpomatic::ContentTimePeriod content_time_period (std::shared_ptr s) const; + void update_position(); - std::list _subtitles; - std::list::const_iterator _next; + std::vector> _subtitles; + std::vector>::const_iterator _next; };