Untested audio delay.
[dcpomatic.git] / src / lib / player.h
index 3f8d59d29b4ab60fa0b4e2181d396bb1ba7d6982..b3eadd7c07e25521506bf6fcc29bc251262e811f 100644 (file)
@@ -27,6 +27,7 @@
 #include "audio_buffers.h"
 #include "content.h"
 #include "film.h"
+#include "rect.h"
 
 class Job;
 class Film;
@@ -49,8 +50,7 @@ public:
        void disable_audio ();
 
        bool pass ();
-       void seek (Time);
-       void seek_back ();
+       void seek (Time, bool);
 
        Time video_position () const {
                return _video_position;
@@ -78,6 +78,7 @@ private:
 
        void process_video (boost::weak_ptr<Piece>, boost::shared_ptr<const Image>, bool, VideoContent::Frame);
        void process_audio (boost::weak_ptr<Piece>, boost::shared_ptr<const AudioBuffers>, AudioContent::Frame);
+       void process_subtitle (boost::weak_ptr<Piece>, boost::shared_ptr<Image>, dcpomatic::Rect<double>, Time, Time);
        void setup_pieces ();
        void playlist_changed ();
        void content_changed (boost::weak_ptr<Content>, int);
@@ -87,6 +88,7 @@ private:
        void emit_silence (OutputAudioFrame);
        boost::shared_ptr<Resampler> resampler (boost::shared_ptr<AudioContent>);
        void film_changed (Film::Property);
+       void update_subtitle ();
 
        boost::shared_ptr<const Film> _film;
        boost::shared_ptr<const Playlist> _playlist;
@@ -108,6 +110,22 @@ private:
        libdcp::Size _video_container_size;
        boost::shared_ptr<Image> _black_frame;
        std::map<boost::shared_ptr<AudioContent>, boost::shared_ptr<Resampler> > _resamplers;
+       boost::shared_ptr<Resampler> _last_resampler;
+
+       struct {
+               boost::weak_ptr<Piece> piece;
+               boost::shared_ptr<Image> image;
+               dcpomatic::Rect<double> rect;
+               Time from;
+               Time to;
+       } _in_subtitle;
+
+       struct {
+               boost::shared_ptr<Image> image;
+               Position<int> position;
+               Time from;
+               Time to;
+       } _out_subtitle;
 };
 
 #endif