X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.h;h=568c7a7a116d26da36c27b602bd0a40d51f36ce9;hb=d7d329289a10ed19f27dbfc4bf107a658a72190e;hp=3f8d59d29b4ab60fa0b4e2181d396bb1ba7d6982;hpb=df52b97f307605aad15ab5f01c8fdcf93afc9d15;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index 3f8d59d29..568c7a7a1 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -27,6 +27,7 @@ #include "audio_buffers.h" #include "content.h" #include "film.h" +#include "rect.h" class Job; class Film; @@ -40,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); @@ -49,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; @@ -71,22 +71,27 @@ public: /** 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; + 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; @@ -108,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