X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.h;h=f2fecddf063df96a2546fffb66cd82722922aa13;hb=742d96e86a262d0238105bc869ec8f350e36ccae;hp=7fad2ff792f7ea0823d7f68f542298eba87db6a0;hpb=d311043bf3c1e3e7f41b314f7ab7c91ed7e5aa7f;p=dcpomatic.git diff --git a/src/lib/content.h b/src/lib/content.h index 7fad2ff79..f2fecddf0 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -31,8 +31,8 @@ #include "change_signaller.h" #include "dcpomatic_time.h" #include "signaller.h" -#include "types.h" #include "user_property.h" +#include "text_type.h" #include #include #include @@ -50,6 +50,9 @@ namespace cxml { class Job; class Film; class AtmosContent; +class AudioContent; +class TextContent; +class VideoContent; class ContentProperty { @@ -153,7 +156,7 @@ public: return _position; } - void set_trim_start (dcpomatic::ContentTime); + void set_trim_start(std::shared_ptr film, dcpomatic::ContentTime); dcpomatic::ContentTime trim_start () const { boost::mutex::scoped_lock lm (_mutex); @@ -172,6 +175,10 @@ public: return position() + length_after_trim(film); } + dcpomatic::DCPTimePeriod period(std::shared_ptr film) const { + return { position(), end(film) }; + } + dcpomatic::DCPTime length_after_trim (std::shared_ptr film) const; boost::optional video_frame_rate () const { @@ -179,7 +186,7 @@ public: return _video_frame_rate; } - void set_video_frame_rate (double r); + void set_video_frame_rate(std::shared_ptr film, double r); void unset_video_frame_rate (); double active_video_frame_rate (std::shared_ptr film) const; @@ -192,12 +199,16 @@ public: std::string calculate_digest () const; + virtual bool can_be_played () const { + return true; + } + /* ChangeType::PENDING and ChangeType::CANCELLED may be emitted from any thread; ChangeType::DONE always from GUI thread */ boost::signals2::signal, int, bool)> Change; std::shared_ptr video; std::shared_ptr audio; - std::list> text; + std::vector> text; std::shared_ptr atmos; std::shared_ptr only_text () const; @@ -222,7 +233,8 @@ private: friend struct best_dcp_frame_rate_test_single; friend struct best_dcp_frame_rate_test_double; friend struct audio_sampling_rate_test; - template friend class ChangeSignaller; + friend struct subtitle_font_id_change_test2; + template friend class ChangeSignalDespatcher; void signal_change (ChangeType, int); @@ -239,11 +251,12 @@ private: * else (either some video happening at the same time, or the rate of the DCP). */ boost::optional _video_frame_rate; - bool _change_signals_frequent; + bool _change_signals_frequent = false; }; typedef ChangeSignaller ContentChangeSignaller; +typedef ChangeSignalDespatcher ContentChangeSignalDespatcher; #endif