More noncopyable.
[dcpomatic.git] / src / lib / player.h
index 32ef25d47142a1e1489f7e49250164b08f2babdb..568c7a7a116d26da36c27b602bd0a40d51f36ce9 100644 (file)
@@ -27,6 +27,7 @@
 #include "audio_buffers.h"
 #include "content.h"
 #include "film.h"
+#include "rect.h"
 
 class Job;
 class Film;
@@ -35,13 +36,12 @@ class AudioContent;
 class Piece;
 class Image;
 class Resampler;
-class TimedSubtitle;
 
 /** @class Player
  *  @brief A class which can `play' a Playlist; emitting its audio and video.
  */
  
-class Player : public boost::enable_shared_from_this<Player>
+class Player : public boost::enable_shared_from_this<Player>, public boost::noncopyable
 {
 public:
        Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist>);
@@ -71,23 +71,27 @@ public:
        /** Emitted when something has changed such that if we went back and emitted
         *  the last frame again it would look different.  This is not emitted after
         *  a seek.
+        *
+        *  The parameter is true if these signals are currently likely to be frequent.
         */
-       boost::signals2::signal<void ()> Changed;
+       boost::signals2::signal<void (bool)> Changed;
 
 private:
+       friend class PlayerWrapper;
 
        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<TimedSubtitle>);
+       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);
+       void content_changed (boost::weak_ptr<Content>, int, bool);
        void do_seek (Time, bool);
        void flush ();
        void emit_black ();
        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;
@@ -109,11 +113,26 @@ 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<TimedSubtitle> _subtitle;
-       Time _subtitle_content_time;
-       int _subtitle_offset;
-       float _subtitle_scale;
+       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;
+
+#ifdef DCPOMATIC_DEBUG
+       boost::shared_ptr<Content> _last_video;
+#endif 
 };
 
 #endif