X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.h;h=568c7a7a116d26da36c27b602bd0a40d51f36ce9;hb=d7d329289a10ed19f27dbfc4bf107a658a72190e;hp=bbdb14ec240ace9494dc1f973869c65a81c91a85;hpb=09a9ac376db005a40a351736bcff4077f098825d;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index bbdb14ec2..568c7a7a1 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -26,6 +26,8 @@ #include "playlist.h" #include "audio_buffers.h" #include "content.h" +#include "film.h" +#include "rect.h" class Job; class Film; @@ -39,7 +41,7 @@ class Resampler; * @brief A class which can `play' a Playlist; emitting its audio and video. */ -class Player : public boost::enable_shared_from_this +class Player : public boost::enable_shared_from_this, public boost::noncopyable { public: Player (boost::shared_ptr, boost::shared_ptr); @@ -48,8 +50,7 @@ public: void disable_audio (); bool pass (); - void seek (Time); - void seek_back (); + void seek (Time, bool); Time video_position () const { return _video_position; @@ -67,18 +68,30 @@ public: /** Emitted when some audio data is ready */ boost::signals2::signal, Time)> Audio; + /** Emitted when something has changed such that if we went back and emitted + * the last frame again it would look different. This is not emitted after + * a seek. + * + * The parameter is true if these signals are currently likely to be frequent. + */ + boost::signals2::signal Changed; + private: + friend class PlayerWrapper; void process_video (boost::weak_ptr, boost::shared_ptr, bool, VideoContent::Frame); void process_audio (boost::weak_ptr, boost::shared_ptr, AudioContent::Frame); + void process_subtitle (boost::weak_ptr, boost::shared_ptr, dcpomatic::Rect, Time, Time); void setup_pieces (); void playlist_changed (); - void content_changed (boost::weak_ptr, int); + void content_changed (boost::weak_ptr, int, bool); void do_seek (Time, bool); void flush (); void emit_black (); void emit_silence (OutputAudioFrame); boost::shared_ptr resampler (boost::shared_ptr); + void film_changed (Film::Property); + void update_subtitle (); boost::shared_ptr _film; boost::shared_ptr _playlist; @@ -100,6 +113,26 @@ private: libdcp::Size _video_container_size; boost::shared_ptr _black_frame; std::map, boost::shared_ptr > _resamplers; + boost::shared_ptr _last_resampler; + + struct { + boost::weak_ptr piece; + boost::shared_ptr image; + dcpomatic::Rect rect; + Time from; + Time to; + } _in_subtitle; + + struct { + boost::shared_ptr image; + Position position; + Time from; + Time to; + } _out_subtitle; + +#ifdef DCPOMATIC_DEBUG + boost::shared_ptr _last_video; +#endif }; #endif