X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_decoder.h;h=5f11e27e7157a3c607175d994fbefdb63ea8f83e;hb=7ae514af0aea1b953a93f88d5507e6c1dd675908;hp=c25edad493a578160af52ec261214cbcaf0653aa;hpb=f1d30fb114b3b2c6ccd8fdf5823e7cd6b26c1eef;p=dcpomatic.git diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h index c25edad49..5f11e27e7 100644 --- a/src/lib/subtitle_decoder.h +++ b/src/lib/subtitle_decoder.h @@ -20,11 +20,11 @@ #ifndef DCPOMATIC_SUBTITLE_DECODER_H #define DCPOMATIC_SUBTITLE_DECODER_H -#include #include "decoder.h" #include "rect.h" #include "types.h" #include "content_subtitle.h" +#include class Film; class DCPTimedSubtitle; @@ -35,24 +35,28 @@ class SubtitleDecoder : public virtual Decoder public: SubtitleDecoder (boost::shared_ptr); - std::list > get_image_subtitles (ContentTimePeriod period); - std::list > get_text_subtitles (ContentTimePeriod period); + std::list get_image_subtitles (ContentTimePeriod period, bool starting); + std::list get_text_subtitles (ContentTimePeriod period, bool starting); protected: void seek (ContentTime, bool); - + void image_subtitle (ContentTimePeriod period, boost::shared_ptr, dcpomatic::Rect); - void text_subtitle (std::list); + void text_subtitle (ContentTimePeriod period, std::list); - std::list > _decoded_image_subtitles; - std::list > _decoded_text_subtitles; + std::list _decoded_image_subtitles; + std::list _decoded_text_subtitles; private: template - std::list > get (std::list > const & subs, ContentTimePeriod period); + std::list get (std::list const & subs, std::list const & sp, ContentTimePeriod period, bool starting); + + /** @param starting true if we want only subtitles that start during the period, otherwise + * we want subtitles that overlap the period. + */ + virtual std::list image_subtitles_during (ContentTimePeriod period, bool starting) const = 0; + virtual std::list text_subtitles_during (ContentTimePeriod period, bool starting) const = 0; - virtual bool has_subtitle_during (ContentTimePeriod) const = 0; - boost::shared_ptr _subtitle_content; };