Change video content scaling so that it either:
[dcpomatic.git] / src / lib / player.h
index 82344604c24e2ff05f25a60ede8fa76e6eea74c3..bb2a0c613e3760c5cce9fdb6642d7abb535e94c2 100644 (file)
@@ -69,7 +69,8 @@ public:
 class Player : public boost::enable_shared_from_this<Player>, public boost::noncopyable
 {
 public:
-       Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist> playlist, dcpomatic::DCPTime playback_length);
+       Player (boost::shared_ptr<const Film>);
+       Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist> playlist);
        ~Player ();
 
        bool pass ();
@@ -82,7 +83,6 @@ public:
                return _video_container_size;
        }
 
-       void set_playback_length (dcpomatic::DCPTime len);
        void set_video_container_size (dcp::Size);
        void set_ignore_video ();
        void set_ignore_audio ();
@@ -115,6 +115,7 @@ private:
        friend struct empty_test2;
        friend struct check_reuse_old_data_test;
 
+       void construct ();
        void setup_pieces ();
        void setup_pieces_unlocked ();
        void flush ();
@@ -142,6 +143,7 @@ private:
        void emit_video (boost::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time);
        void do_emit_video (boost::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time);
        void emit_audio (boost::shared_ptr<AudioBuffers> data, dcpomatic::DCPTime time);
+       boost::shared_ptr<const Playlist> playlist () const;
 
        /** Mutex to protect the whole Player state.  When it's used for the preview we have
            seek() and pass() called from the Butler thread and lots of other stuff called
@@ -150,13 +152,16 @@ private:
        mutable boost::mutex _mutex;
 
        boost::shared_ptr<const Film> _film;
+       /** Playlist, or 0 if we are using the one from the _film */
        boost::shared_ptr<const Playlist> _playlist;
 
        /** > 0 if we are suspended (i.e. pass() and seek() do nothing) */
        boost::atomic<int> _suspended;
        std::list<boost::shared_ptr<Piece> > _pieces;
 
-       /** Size of the image in the DCP (e.g. 1990x1080 for flat) */
+       /** Size of the image we are rendering to; this may be the DCP frame size, or
+        *  the size of preview in a window.
+        */
        dcp::Size _video_container_size;
        boost::shared_ptr<Image> _black_image;