X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.h;h=14fb8d0ee06b50d495268411b827b283ca8fabfa;hb=5d1496fa502655d334439b4b2658625a2b3c1b70;hp=be8d556afae77be2b5c691e0cbdeefefebd089db;hpb=42a6003535d3153224da33b973bb79662d296e02;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index be8d556af..14fb8d0ee 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -18,26 +18,31 @@ */ + #ifndef DCPOMATIC_PLAYER_H #define DCPOMATIC_PLAYER_H -#include "atmos_metadata.h" -#include "player_text.h" + #include "active_text.h" -#include "content_text.h" -#include "film.h" +#include "atmos_metadata.h" +#include "audio_merger.h" +#include "audio_stream.h" #include "content.h" #include "content_atmos.h" -#include "position_image.h" -#include "piece.h" -#include "content_video.h" #include "content_audio.h" -#include "audio_stream.h" -#include "audio_merger.h" +#include "content_text.h" +#include "content_video.h" #include "empty.h" +#include "film.h" +#include "image.h" +#include "piece.h" +#include "player_text.h" +#include "position_image.h" +#include "shuffler.h" #include #include + namespace dcp { class ReelAsset; } @@ -53,6 +58,7 @@ class AudioBuffers; class ReferencedReelAsset; class Shuffler; + class PlayerProperty { public: @@ -64,15 +70,15 @@ public: static int const PLAYBACK_LENGTH; }; + /** @class Player * @brief A class which can play a Playlist. */ class Player : public std::enable_shared_from_this { public: - Player (std::shared_ptr); + Player (std::shared_ptr, Image::Alignment subtitle_alignment); Player (std::shared_ptr, std::shared_ptr playlist); - ~Player (); Player (Player const& Player) = delete; Player& operator= (Player const& Player) = delete; @@ -102,6 +108,9 @@ public: /** Emitted when a video frame is ready. These emissions happen in the correct order. */ boost::signals2::signal, dcpomatic::DCPTime)> Video; + /** Emitted when audio data is ready. First parameter is the audio data, second its time, + * third the frame rate. + */ boost::signals2::signal, dcpomatic::DCPTime, int)> Audio; /** Emitted when a text is ready. This signal may be emitted considerably * after the corresponding Video. @@ -124,7 +133,6 @@ private: void construct (); void setup_pieces (); void setup_pieces_unlocked (); - void flush (); void film_change (ChangeType, Film::Property); void playlist_change (ChangeType); void playlist_content_change (ChangeType, int, bool); @@ -166,7 +174,7 @@ private: /** > 0 if we are suspended (i.e. pass() and seek() do nothing) */ boost::atomic _suspended; - std::list > _pieces; + std::list> _pieces; /** Size of the image we are rendering to; this may be the DCP frame size, or * the size of preview in a window. @@ -199,8 +207,8 @@ private: LastVideoMap _last_video; AudioMerger _audio_merger; - Shuffler* _shuffler = nullptr; - std::list, dcpomatic::DCPTime> > _delay; + std::unique_ptr _shuffler; + std::list, dcpomatic::DCPTime>> _delay; class StreamState { @@ -225,9 +233,13 @@ private: dcpomatic::DCPTime _playback_length; + /** Alignment for subtitle images that we create */ + Image::Alignment _subtitle_alignment = Image::Alignment::PADDED; + boost::signals2::scoped_connection _film_changed_connection; boost::signals2::scoped_connection _playlist_change_connection; boost::signals2::scoped_connection _playlist_content_change_connection; }; + #endif