X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent_text.h;h=51d4e8009942899c7008dcb838d27733de37af03;hb=3a77446f2ab5f8ec33888ce787cfacffdfd691de;hp=2d8910577926c38bd259b1e10a7a7c82c90f356d;hpb=ec97893127a2d59871d92c9e658b6b1ab3100b40;p=dcpomatic.git diff --git a/src/lib/content_text.h b/src/lib/content_text.h index 2d8910577..51d4e8009 100644 --- a/src/lib/content_text.h +++ b/src/lib/content_text.h @@ -18,45 +18,55 @@ */ + #ifndef DCPOMATIC_CONTENT_TEXT_H #define DCPOMATIC_CONTENT_TEXT_H + +#include "bitmap_text.h" #include "dcpomatic_time.h" #include "rect.h" -#include "types.h" -#include "bitmap_text.h" +#include "string_text.h" #include -#include +#include + class Image; + class ContentText { public: - explicit ContentText (ContentTime f) + explicit ContentText (dcpomatic::ContentTime f) : _from (f) {} - ContentTime from () const { + dcpomatic::ContentTime from () const { return _from; } private: - ContentTime _from; + dcpomatic::ContentTime _from; }; + class ContentBitmapText : public ContentText { public: - ContentBitmapText (ContentTime f, boost::shared_ptr im, dcpomatic::Rect r) + ContentBitmapText (dcpomatic::ContentTime from) + : ContentText(from) + {} + + ContentBitmapText (dcpomatic::ContentTime f, std::shared_ptr im, dcpomatic::Rect r) : ContentText (f) - , sub (im, r) + , subs{ {im, r} } {} - /* Our text, with its rectangle unmodified by any offsets or scales that the content specifies */ - BitmapText sub; + /* Our texts, with their rectangles unmodified by any offsets or scales that the content specifies */ + std::vector subs; }; + /** A text caption. We store the time period separately (as well as in the dcp::SubtitleStrings) * as the dcp::SubtitleString timings are sometimes quite heavily quantised and this causes problems * when we want to compare the quantised periods to the unquantised ones. @@ -64,12 +74,13 @@ public: class ContentStringText : public ContentText { public: - ContentStringText (ContentTime f, std::list s) + ContentStringText (dcpomatic::ContentTime f, std::vector s) : ContentText (f) , subs (s) {} - std::list subs; + std::vector subs; }; + #endif