X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Factive_text.h;h=d5ce4cb0759895d2b235a9e205c9a8a264e14767;hb=fe933ebb2c55b4235fcba5d02af2ba91c272fc88;hp=10ce30f08476711a511f9d7ee53b09fb5c30d7e1;hpb=df17bbd25da69fc38eb2dcd8b4a2531cf0bab0bc;p=dcpomatic.git diff --git a/src/lib/active_text.h b/src/lib/active_text.h index 10ce30f08..d5ce4cb07 100644 --- a/src/lib/active_text.h +++ b/src/lib/active_text.h @@ -18,31 +18,39 @@ */ + /** @file src/lib/active_captions.h * @brief ActiveText class. */ + #include "dcpomatic_time.h" #include "player_text.h" -#include +#include #include #include + class TextContent; + /** @class ActiveText * @brief A class to maintain information on active subtitles for Player. */ -class ActiveText : public boost::noncopyable +class ActiveText { public: - std::list get (DCPTimePeriod period) const; - std::list get_burnt (DCPTimePeriod period, bool always_burn_captions) const; - void clear_before (DCPTime time); + ActiveText () {} + + ActiveText (ActiveText const&) = delete; + ActiveText& operator= (ActiveText const&) = delete; + + std::list get_burnt (dcpomatic::DCPTimePeriod period, bool always_burn_captions) const; + void clear_before (dcpomatic::DCPTime time); void clear (); - void add_from (boost::weak_ptr content, PlayerText ps, DCPTime from); - std::pair add_to (boost::weak_ptr content, DCPTime to); - bool have (boost::weak_ptr content) const; + void add_from (std::weak_ptr content, PlayerText ps, dcpomatic::DCPTime from); + std::pair add_to (std::weak_ptr content, dcpomatic::DCPTime to); + bool have (std::weak_ptr content) const; private: class Period @@ -50,19 +58,18 @@ private: public: Period () {} - Period (PlayerText s, DCPTime f) + Period (PlayerText s, dcpomatic::DCPTime f) : subs (s) , from (f) {} PlayerText subs; - DCPTime from; - boost::optional to; + dcpomatic::DCPTime from; + boost::optional to; }; - typedef std::map, std::list > Map; - - void add (DCPTimePeriod period, std::list& pc, std::list p) const; + typedef std::map, std::list, std::owner_less>> Map; + mutable boost::mutex _mutex; Map _data; };