summaryrefslogtreecommitdiff
path: root/src/lib/content_text.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-19 21:23:26 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-19 23:45:23 +0100
commit0ab83642f0c96ae2681beae04873b3226338a570 (patch)
tree0893f0bed5e4ee9f37947edde970e9095ddcb9ba /src/lib/content_text.h
parentff40ecd114547a2fc07bc49403c993c3fa5d40cc (diff)
Text to player with types.
Diffstat (limited to 'src/lib/content_text.h')
-rw-r--r--src/lib/content_text.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/content_text.h b/src/lib/content_text.h
index 17ec579df..eaba64ecf 100644
--- a/src/lib/content_text.h
+++ b/src/lib/content_text.h
@@ -23,6 +23,7 @@
#include "dcpomatic_time.h"
#include "rect.h"
+#include "types.h"
#include "bitmap_text.h"
#include <dcp/subtitle_string.h>
#include <list>
@@ -32,23 +33,29 @@ class Image;
class ContentText
{
public:
- explicit ContentText (ContentTime f)
+ explicit ContentText (ContentTime f, TextType t)
: _from (f)
+ , _type (t)
{}
ContentTime from () const {
return _from;
}
+ TextType type () const {
+ return _type;
+ }
+
private:
ContentTime _from;
+ TextType _type;
};
class ContentBitmapText : public ContentText
{
public:
- ContentBitmapText (ContentTime f, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r)
- : ContentText (f)
+ ContentBitmapText (ContentTime f, TextType type, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r)
+ : ContentText (f, type)
, sub (im, r)
{}
@@ -56,15 +63,15 @@ public:
BitmapText sub;
};
-/** A text subtitle. We store the time period separately (as well as in the dcp::SubtitleStrings)
+/** 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.
*/
class ContentPlainText : public ContentText
{
public:
- ContentPlainText (ContentTime f, std::list<dcp::SubtitleString> s)
- : ContentText (f)
+ ContentPlainText (ContentTime f, TextType type, std::list<dcp::SubtitleString> s)
+ : ContentText (f, type)
, subs (s)
{}