More player debugging for butler video-full states.
[dcpomatic.git] / src / lib / active_text.h
index 09ef1cdaf80460df48a1280a7d7eb3ad4467c22d..ff4a1bd2f75cf07cc39bb621193171f7ceb992c7 100644 (file)
 
 */
 
-/** @file  src/lib/active_text.h
+/** @file  src/lib/active_captions.h
  *  @brief ActiveText class.
  */
 
 #include "dcpomatic_time.h"
 #include "player_text.h"
 #include <boost/noncopyable.hpp>
+#include <boost/thread/mutex.hpp>
 #include <list>
 #include <map>
 
-class Piece;
+class TextContent;
 
 /** @class ActiveText
  *  @brief A class to maintain information on active subtitles for Player.
@@ -36,12 +37,12 @@ class Piece;
 class ActiveText : public boost::noncopyable
 {
 public:
-       std::list<PlayerText> get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const;
+       std::list<PlayerText> get_burnt (DCPTimePeriod period, bool always_burn_captions) const;
        void clear_before (DCPTime time);
        void clear ();
-       void add_from (boost::weak_ptr<Piece> piece, PlayerText ps, DCPTime from);
-       std::pair<PlayerText, DCPTime> add_to (boost::weak_ptr<Piece> piece, DCPTime to);
-       bool have (boost::weak_ptr<Piece> piece) const;
+       void add_from (boost::weak_ptr<const TextContent> content, PlayerText ps, DCPTime from);
+       std::pair<PlayerText, DCPTime> add_to (boost::weak_ptr<const TextContent> content, DCPTime to);
+       bool have (boost::weak_ptr<const TextContent> content) const;
 
 private:
        class Period
@@ -59,7 +60,8 @@ private:
                boost::optional<DCPTime> to;
        };
 
-       typedef std::map<boost::weak_ptr<Piece>, std::list<Period> > Map;
+       typedef std::map<boost::weak_ptr<const TextContent>, std::list<Period> > Map;
 
+       mutable boost::mutex _mutex;
        Map _data;
 };