X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_decoder.h;h=8ba74404f2d26dbc3a80c9494c20dd233e9396ef;hb=3b80b8f8a938dd34ee0e0fbca8fbce6a6850f136;hp=fd1d71f33fdef23b3ef8ed7b5d69140baa4ed2cb;hpb=4e5d5c7dcc6470b8dc918d03a00e30c07df60efe;p=dcpomatic.git diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h index fd1d71f33..8ba74404f 100644 --- a/src/lib/subtitle_decoder.h +++ b/src/lib/subtitle_decoder.h @@ -17,11 +17,14 @@ */ -#include +#ifndef DCPOMATIC_SUBTITLE_DECODER_H +#define DCPOMATIC_SUBTITLE_DECODER_H + #include "decoder.h" #include "rect.h" #include "types.h" -#include "decoded.h" +#include "content_subtitle.h" +#include class Film; class DCPTimedSubtitle; @@ -30,8 +33,31 @@ 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 subtitle (boost::shared_ptr, dcpomatic::Rect, ContentTime, ContentTime); + void seek (ContentTime, bool); + + void image_subtitle (ContentTimePeriod period, boost::shared_ptr, dcpomatic::Rect); + void text_subtitle (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