#include "empty.h"
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
+#include <boost/atomic.hpp>
#include <list>
namespace dcp {
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
class Player : public boost::enable_shared_from_this<Player>, public boost::noncopyable
{
public:
+ Player (boost::shared_ptr<const Film>);
Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist> playlist);
~Player ();
friend struct player_subframe_test;
friend struct empty_test1;
friend struct empty_test2;
+ friend struct check_reuse_old_data_test;
+ void construct ();
void setup_pieces ();
void setup_pieces_unlocked ();
void flush ();
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
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;
- /** true if we are suspended (i.e. pass() and seek() do nothing) */
- bool _suspended;
+ /** > 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) */
ActiveText _active_texts[TEXT_COUNT];
boost::shared_ptr<AudioProcessor> _audio_processor;
+ dcpomatic::DCPTime _playback_length;
+
boost::signals2::scoped_connection _film_changed_connection;
boost::signals2::scoped_connection _playlist_change_connection;
boost::signals2::scoped_connection _playlist_content_change_connection;