X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle.h;h=de8f025964fc468683573813f8948ad6715d81c7;hb=e70fff45bcf1de7765252f0a881d7035d022bba9;hp=6fd0d8772643fe3ca8d92d27238a452b53bd867e;hpb=009a58293bf2e9727d544d1a2648422cc395d81e;p=dcpomatic.git diff --git a/src/lib/subtitle.h b/src/lib/subtitle.h index 6fd0d8772..de8f02596 100644 --- a/src/lib/subtitle.h +++ b/src/lib/subtitle.h @@ -22,38 +22,12 @@ #include "util.h" struct AVSubtitle; -class SubtitleImage; class Image; -class FilmState; class Subtitle { public: - Subtitle (AVSubtitle const &); - - bool displayed_at (double t); - - std::list > 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 > _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 i); void set_position (Position p) { _position = p; @@ -68,8 +42,34 @@ public: } Rectangle area () const; - + private: Position _position; boost::shared_ptr _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 () const { + return _subtitle; + } + +private: + boost::shared_ptr _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; +};