X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.h;h=51de78982da44ba352caf796f16277a38c095aa8;hb=aa382124eeabcad7a7346d46fb5f931c1364a849;hp=68531cfb377da8a5bbc7fb390f0108d06639aca9;hpb=df48c75c38dd788835a93540aea243a2dac4bb10;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index 68531cfb3..51de78982 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -35,6 +35,7 @@ #include "empty.h" #include #include +#include #include namespace dcp { @@ -59,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 @@ -67,6 +69,7 @@ public: class Player : public boost::enable_shared_from_this, public boost::noncopyable { public: + Player (boost::shared_ptr); Player (boost::shared_ptr, boost::shared_ptr playlist); ~Player (); @@ -112,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 (); @@ -139,6 +143,7 @@ private: void emit_video (boost::shared_ptr pv, dcpomatic::DCPTime time); void do_emit_video (boost::shared_ptr pv, dcpomatic::DCPTime time); void emit_audio (boost::shared_ptr data, dcpomatic::DCPTime time); + boost::shared_ptr 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 @@ -147,6 +152,7 @@ private: mutable boost::mutex _mutex; boost::shared_ptr _film; + /** Playlist, or 0 if we are using the one from the _film */ boost::shared_ptr _playlist; /** > 0 if we are suspended (i.e. pass() and seek() do nothing) */ @@ -206,8 +212,7 @@ private: ActiveText _active_texts[TEXT_COUNT]; boost::shared_ptr _audio_processor; - /* Cached stuff */ - boost::optional _film_length; + dcpomatic::DCPTime _playback_length; boost::signals2::scoped_connection _film_changed_connection; boost::signals2::scoped_connection _playlist_change_connection;