X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_decoder.h;h=d01c4e45b0ba5480567818d3f53809d1683fa325;hb=c658aec3ffd5009cbe7fa2540da5a0579e2f2e8c;hp=6a962ca4772d879723e79aa69aceedac653fdc26;hpb=c28b3d6f168607aca9995282b96647eb64a26dc9;p=dcpomatic.git diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h index 6a962ca47..d01c4e45b 100644 --- a/src/lib/subtitle_decoder.h +++ b/src/lib/subtitle_decoder.h @@ -20,25 +20,42 @@ #ifndef DCPOMATIC_SUBTITLE_DECODER_H #define DCPOMATIC_SUBTITLE_DECODER_H -#include -#include #include "decoder.h" #include "rect.h" #include "types.h" -#include "decoded.h" +#include "content_subtitle.h" +#include -class Film; -class DCPTimedSubtitle; class Image; class SubtitleDecoder : public virtual Decoder { public: - SubtitleDecoder (boost::shared_ptr); + SubtitleDecoder (boost::shared_ptr); + + std::list get_image_subtitles (ContentTimePeriod period, bool starting); + std::list get_text_subtitles (ContentTimePeriod period, bool starting); protected: - void image_subtitle (boost::shared_ptr, dcpomatic::Rect, ContentTime, ContentTime); - void text_subtitle (std::list); + void seek (ContentTime, bool); + + void image_subtitle (ContentTimePeriod period, boost::shared_ptr, dcpomatic::Rect); + void text_subtitle (ContentTimePeriod period, std::list); + + std::list _decoded_image_subtitles; + std::list _decoded_text_subtitles; + +private: + template + 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; + + boost::shared_ptr _subtitle_content; }; #endif