Pull methods out of CinemaKDMs.
[dcpomatic.git] / src / lib / player.h
index 5a1b08ecf74fef3d9abb4a0747d5191f986641f5..51de78982da44ba352caf796f16277a38c095aa8 100644 (file)
@@ -60,6 +60,7 @@ public:
        static int const FILM_CONTAINER;
        static int const FILM_VIDEO_FRAME_RATE;
        static int const DCP_DECODE_REDUCTION;
+       static int const PLAYBACK_LENGTH;
 };
 
 /** @class Player
@@ -68,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 ();
@@ -113,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 ();
@@ -140,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
@@ -148,6 +152,7 @@ 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) */