X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftext_decoder.h;h=9b3050f718b56ad8f4fd65e1397d01a3fe2ee850;hb=9726a58f44d52d235b027225ddd68c6acf83c733;hp=02afeeb94251132984f24b7ae215e0734433b224;hpb=c4403784febdbdd42e9c32e67fadb147f11fe566;p=dcpomatic.git diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h index 02afeeb94..9b3050f71 100644 --- a/src/lib/text_decoder.h +++ b/src/lib/text_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2018 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,9 +18,11 @@ */ + #ifndef DCPOMATIC_CAPTION_DECODER_H #define DCPOMATIC_CAPTION_DECODER_H + #include "decoder.h" #include "rect.h" #include "types.h" @@ -29,36 +31,36 @@ #include #include + namespace sub { class Subtitle; } class Image; + class TextDecoder : public DecoderPart { public: - TextDecoder ( - Decoder* parent, - boost::shared_ptr, - dcpomatic::ContentTime first - ); + TextDecoder (Decoder* parent, std::shared_ptr); - dcpomatic::ContentTime position (boost::shared_ptr) const { + boost::optional position (std::shared_ptr) const override { return _position; } - void emit_bitmap_start (dcpomatic::ContentTime from, boost::shared_ptr image, dcpomatic::Rect rect); - void emit_bitmap (dcpomatic::ContentTimePeriod period, boost::shared_ptr image, dcpomatic::Rect rect); - void emit_plain_start (dcpomatic::ContentTime from, std::list s); + void emit_bitmap_start (ContentBitmapText const& bitmap); + void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr image, dcpomatic::Rect rect); + void emit_plain_start (dcpomatic::ContentTime from, std::vector s, dcp::Standard valign_standard); void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle); - void emit_plain (dcpomatic::ContentTimePeriod period, std::list s); + void emit_plain (dcpomatic::ContentTimePeriod period, std::vector s, dcp::Standard valign_standard); void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle); void emit_stop (dcpomatic::ContentTime to); - void seek (); + void maybe_set_position (dcpomatic::ContentTime position); + + void seek () override; - boost::shared_ptr content () const { + std::shared_ptr content () const { return _content; } @@ -67,8 +69,9 @@ public: boost::signals2::signal Stop; private: - boost::shared_ptr _content; - dcpomatic::ContentTime _position; + std::shared_ptr _content; + boost::optional _position; }; + #endif