X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.h;h=76721837931fecc910ec45d3bc2afd33c1342a61;hb=9bfa07293928c371d59db2091ba2b7e715ce5994;hp=0b0c9facdf4eeaa2184034f18196d54f9d074565;hpb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index 0b0c9facd..767218379 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -18,26 +18,30 @@ */ + #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 "piece.h" +#include "player_text.h" +#include "position_image.h" +#include "shuffler.h" #include #include + namespace dcp { class ReelAsset; } @@ -53,6 +57,7 @@ class AudioBuffers; class ReferencedReelAsset; class Shuffler; + class PlayerProperty { public: @@ -64,15 +69,18 @@ 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 boost::noncopyable +class Player : public std::enable_shared_from_this { public: - Player (std::shared_ptr); + Player (std::shared_ptr, bool aligned_subtitles); Player (std::shared_ptr, std::shared_ptr playlist); - ~Player (); + + Player (Player const& Player) = delete; + Player& operator= (Player const& Player) = delete; bool pass (); void seek (dcpomatic::DCPTime time, bool accurate); @@ -99,6 +107,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. @@ -116,6 +127,7 @@ private: friend struct empty_test1; friend struct empty_test2; friend struct check_reuse_old_data_test; + friend struct overlap_video_test1; void construct (); void setup_pieces (); @@ -195,7 +207,7 @@ private: LastVideoMap _last_video; AudioMerger _audio_merger; - Shuffler* _shuffler = nullptr; + std::unique_ptr _shuffler; std::list, dcpomatic::DCPTime> > _delay; class StreamState @@ -221,9 +233,13 @@ private: dcpomatic::DCPTime _playback_length; + /** aligned flag for subtitle images that we create */ + bool _aligned_subtitles = true; + boost::signals2::scoped_connection _film_changed_connection; boost::signals2::scoped_connection _playlist_change_connection; boost::signals2::scoped_connection _playlist_content_change_connection; }; + #endif