X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_decoder.h;h=6d0479638c6462a34ffbba190d3c9607b4b36743;hb=67a68bd971ebe1b35daa3f75873b4ccb53c00ba0;hp=726e898b1dcc979366b45f3a4557a95722e1a569;hpb=9b7e3d7d992f64da4bc78bc99d1eb706f181b798;p=dcpomatic.git diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h index 726e898b1..6d0479638 100644 --- a/src/lib/subtitle_decoder.h +++ b/src/lib/subtitle_decoder.h @@ -25,7 +25,9 @@ #include "rect.h" #include "types.h" #include "content_subtitle.h" +#include "decoder_part.h" #include +#include namespace sub { class Subtitle; @@ -33,7 +35,7 @@ namespace sub { class Image; -class SubtitleDecoder +class SubtitleDecoder : public DecoderPart { public: /** Second parameter to the _during functions is true if we @@ -43,36 +45,27 @@ public: SubtitleDecoder ( Decoder* parent, boost::shared_ptr, - boost::function (ContentTimePeriod, bool)> image_during, - boost::function (ContentTimePeriod, bool)> text_during + boost::shared_ptr log ); - std::list get_image (ContentTimePeriod period, bool starting, bool accurate); - std::list get_text (ContentTimePeriod period, bool starting, bool accurate); - - void seek (ContentTime, bool); - void reset (); + ContentTime position () const { + return _position; + } - void give_image (ContentTimePeriod period, boost::shared_ptr, dcpomatic::Rect); - void give_text (ContentTimePeriod period, std::list); - void give_text (ContentTimePeriod period, sub::Subtitle const & subtitle); + void emit_image (ContentTimePeriod period, boost::shared_ptr image, dcpomatic::Rect rect); + void emit_text (ContentTimePeriod period, std::list s); + void emit_text (ContentTimePeriod period, sub::Subtitle const & subtitle); boost::shared_ptr content () const { return _content; } -private: + boost::signals2::signal ImageData; + boost::signals2::signal TextData; - Decoder* _parent; - std::list _decoded_image; - std::list _decoded_text; +private: boost::shared_ptr _content; - - template - std::list get (std::list const & subs, std::list const & sp, ContentTimePeriod period, bool starting, bool accurate); - - boost::function (ContentTimePeriod, bool)> _image_during; - boost::function (ContentTimePeriod, bool)> _text_during; + ContentTime _position; }; #endif