X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent_subtitle.h;h=ef904a9805e50476b064b7cdc589290694ff7777;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=8c266f4835da680495a3f07414d98b65935e54bc;hpb=b666a794a130386bc01ede2143ef40bd6973eb32;p=dcpomatic.git diff --git a/src/lib/content_subtitle.h b/src/lib/content_subtitle.h index 8c266f483..ef904a980 100644 --- a/src/lib/content_subtitle.h +++ b/src/lib/content_subtitle.h @@ -20,44 +20,37 @@ #ifndef DCPOMATIC_CONTENT_SUBTITLE_H #define DCPOMATIC_CONTENT_SUBTITLE_H -#include -#include #include "dcpomatic_time.h" #include "rect.h" +#include "image_subtitle.h" +#include +#include class Image; class ContentSubtitle { public: - virtual ContentTime from () const = 0; - virtual ContentTime to () const = 0; + virtual ContentTimePeriod period () const = 0; }; class ContentImageSubtitle : public ContentSubtitle { public: - ContentImageSubtitle (ContentTime f, ContentTime t, boost::shared_ptr im, dcpomatic::Rect r) - : image (im) - , rectangle (r) - , _from (f) - , _to (t) + ContentImageSubtitle (ContentTimePeriod p, boost::shared_ptr im, dcpomatic::Rect r) + : sub (im, r) + , _period (p) {} - ContentTime from () const { - return _from; + ContentTimePeriod period () const { + return _period; } - ContentTime to () const { - return _to; - } - - boost::shared_ptr image; - dcpomatic::Rect rectangle; + /* Our subtitle, with its rectangle unmodified by any offsets or scales that the content specifies */ + ImageSubtitle sub; private: - ContentTime _from; - ContentTime _to; + ContentTimePeriod _period; }; class ContentTextSubtitle : public ContentSubtitle @@ -67,9 +60,8 @@ public: : subs (s) {} - ContentTime from () const; - ContentTime to () const; - + ContentTimePeriod period () const; + std::list subs; };