#include "util.h"
struct AVSubtitle;
-class SubtitleImage;
class Image;
-class FilmState;
class Subtitle
{
public:
- Subtitle (AVSubtitle const &);
-
- bool displayed_at (double t);
-
- std::list<boost::shared_ptr<SubtitleImage> > images () const {
- return _images;
- }
-
-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;
- std::list<boost::shared_ptr<SubtitleImage> > _images;
-};
-
-extern Rectangle transformed_subtitle_area (
- float target_x_scale, float target_y_scale,
- Rectangle sub_area, int subtitle_offset, float subtitle_scale
- );
-
-class SubtitleImage
-{
-public:
- SubtitleImage (AVSubtitleRect const *);
+ Subtitle (Position p, boost::shared_ptr<Image> i);
void set_position (Position p) {
_position = p;
}
Rectangle area () const;
-
+
private:
Position _position;
boost::shared_ptr<Image> _image;
};
+
+Rectangle
+subtitle_transformed_area (
+ float target_x_scale, float target_y_scale,
+ 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;
+};