#include "empty.h"
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
+#include <boost/atomic.hpp>
#include <list>
namespace dcp {
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);
+ Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist> playlist, dcpomatic::DCPTime playback_length);
~Player ();
bool pass ();
boost::shared_ptr<const Film> _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;
- /* Cached stuff */
- boost::optional<dcpomatic::DCPTime> _film_length;
+ dcpomatic::DCPTime _playback_length;
boost::signals2::scoped_connection _film_changed_connection;
boost::signals2::scoped_connection _playlist_change_connection;