X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.h;h=568c7a7a116d26da36c27b602bd0a40d51f36ce9;hb=d7d329289a10ed19f27dbfc4bf107a658a72190e;hp=32ef25d47142a1e1489f7e49250164b08f2babdb;hpb=f0d79f2ee79becbcb7bc9065155eaa0963a6aa99;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index 32ef25d47..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; @@ -35,13 +36,12 @@ class AudioContent; class Piece; class Image; class Resampler; -class TimedSubtitle; /** @class Player * @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); @@ -71,23 +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); + 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; @@ -109,11 +113,26 @@ private: libdcp::Size _video_container_size; boost::shared_ptr _black_frame; std::map, boost::shared_ptr > _resamplers; - - boost::shared_ptr _subtitle; - Time _subtitle_content_time; - int _subtitle_offset; - float _subtitle_scale; + 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