#ifndef DCPOMATIC_CONTENT_SUBTITLE_H
#define DCPOMATIC_CONTENT_SUBTITLE_H
-#include <list>
-#include <dcp/subtitle_string.h>
#include "dcpomatic_time.h"
#include "rect.h"
+#include "image_subtitle.h"
+#include <dcp/subtitle_string.h>
+#include <list>
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<Image> im, dcpomatic::Rect<double> r)
- : image (im)
- , rectangle (r)
- , _from (f)
- , _to (t)
+ ContentImageSubtitle (ContentTimePeriod p, boost::shared_ptr<Image> im, dcpomatic::Rect<double> 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> image;
- dcpomatic::Rect<double> 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
: subs (s)
{}
- ContentTime from () const;
- ContentTime to () const;
+ ContentTimePeriod period () const;
std::list<dcp::SubtitleString> subs;
};