X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fcontent_text.h;h=06fb39cfce6c423166c465a07d4d59af5367ef7e;hb=HEAD;hp=3ef011f61173eefed1902a3a6fd7ae521016772a;hpb=df17bbd25da69fc38eb2dcd8b4a2531cf0bab0bc;p=dcpomatic.git diff --git a/src/lib/content_text.h b/src/lib/content_text.h index 3ef011f61..51d4e8009 100644 --- a/src/lib/content_text.h +++ b/src/lib/content_text.h @@ -18,51 +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, TextType t) + explicit ContentText (dcpomatic::ContentTime f) : _from (f) - , _type (t) {} - ContentTime from () const { + dcpomatic::ContentTime from () const { return _from; } - TextType type () const { - return _type; - } - private: - ContentTime _from; - TextType _type; + dcpomatic::ContentTime _from; }; + class ContentBitmapText : public ContentText { public: - ContentBitmapText (ContentTime f, TextType type, boost::shared_ptr im, dcpomatic::Rect r) - : ContentText (f, type) - , sub (im, r) + ContentBitmapText (dcpomatic::ContentTime from) + : ContentText(from) + {} + + ContentBitmapText (dcpomatic::ContentTime f, std::shared_ptr im, dcpomatic::Rect r) + : ContentText (f) + , 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. @@ -70,12 +74,13 @@ public: class ContentStringText : public ContentText { public: - ContentStringText (ContentTime f, TextType type, std::list s) - : ContentText (f, type) + ContentStringText (dcpomatic::ContentTime f, std::vector s) + : ContentText (f) , subs (s) {} - std::list subs; + std::vector subs; }; + #endif