Missing #include for previous.
[dcpomatic.git] / src / lib / player.h
index 381aa80b71c113ab3b615bf5151a10487b9d8596..c2911bf1087e19dae86257c37c14ce9c1a864b21 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 #include "empty.h"
 #include <boost/shared_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>
+#include <boost/atomic.hpp>
 #include <list>
 
 namespace dcp {
        class ReelAsset;
 }
 
+namespace dcpomatic {
+       class Font;
+}
+
 class PlayerVideo;
 class Playlist;
-class Font;
 class AudioBuffers;
 class ReferencedReelAsset;
 class Shuffler;
@@ -70,7 +74,7 @@ public:
        bool pass ();
        void seek (dcpomatic::DCPTime time, bool accurate);
 
-       std::list<boost::shared_ptr<Font> > get_subtitle_fonts ();
+       std::list<boost::shared_ptr<dcpomatic::Font> > get_subtitle_fonts ();
        std::list<ReferencedReelAsset> get_reel_assets ();
        dcp::Size video_container_size () const {
                boost::mutex::scoped_lock lm (_mutex);
@@ -107,6 +111,7 @@ private:
        friend struct player_subframe_test;
        friend struct empty_test1;
        friend struct empty_test2;
+       friend struct check_reuse_old_data_test;
 
        void setup_pieces ();
        void setup_pieces_unlocked ();
@@ -145,8 +150,8 @@ private:
        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) */
@@ -161,6 +166,8 @@ private:
        bool _always_burn_open_subtitles;
        /** true if we should try to be fast rather than high quality */
        bool _fast;
+       /** true if we should keep going in the face of `survivable' errors */
+       bool _tolerant;
        /** true if we should `play' (i.e output) referenced DCP data (e.g. for preview) */
        bool _play_referenced;
 
@@ -200,6 +207,9 @@ private:
        ActiveText _active_texts[TEXT_COUNT];
        boost::shared_ptr<AudioProcessor> _audio_processor;
 
+       /* Cached stuff */
+       boost::optional<dcpomatic::DCPTime> _film_length;
+
        boost::signals2::scoped_connection _film_changed_connection;
        boost::signals2::scoped_connection _playlist_change_connection;
        boost::signals2::scoped_connection _playlist_content_change_connection;