summaryrefslogtreecommitdiff
path: root/src/lib/subtitle.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-15 23:42:19 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-15 23:42:19 +0100
commit63b7da59cee71ab2ade744a8b547b5d8f2ff6bfc (patch)
tree6e107ab63deff4e5e8b5a462f767e6ed4685cbdb /src/lib/subtitle.h
parentbd9906422fe59126a27a3002b2bb4ce497eef508 (diff)
Clean up subtitle classes a bit.
Diffstat (limited to 'src/lib/subtitle.h')
-rw-r--r--src/lib/subtitle.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/lib/subtitle.h b/src/lib/subtitle.h
index ef9571ad4..de8f02596 100644
--- a/src/lib/subtitle.h
+++ b/src/lib/subtitle.h
@@ -27,11 +27,8 @@ class Image;
class Subtitle
{
public:
- Subtitle (AVSubtitle const &);
Subtitle (Position p, boost::shared_ptr<Image> i);
- bool displayed_at (double t);
-
void set_position (Position p) {
_position = p;
}
@@ -47,10 +44,6 @@ public:
Rectangle area () const;
private:
- /** display from time in seconds from the start of the film */
- double _from;
- /** display to time in seconds from the start of the film */
- double _to;
Position _position;
boost::shared_ptr<Image> _image;
};
@@ -61,3 +54,22 @@ subtitle_transformed_area (
Rectangle sub_area, int subtitle_offset, float subtitle_scale
);
+class TimedSubtitle
+{
+public:
+ TimedSubtitle (AVSubtitle const &);
+
+ bool displayed_at (double t) const;
+
+ boost::shared_ptr<Subtitle> subtitle () const {
+ return _subtitle;
+ }
+
+private:
+ boost::shared_ptr<Subtitle> _subtitle;
+
+ /** display from time in seconds from the start of the film */
+ double _from;
+ /** display to time in seconds from the start of the film */
+ double _to;
+};