Various alignment adjustments.
[dcpomatic.git] / src / lib / player.h
index 8fc02d9c676312829ce8fb2ee497bf9c0ebeefd2..76721837931fecc910ec45d3bc2afd33c1342a61 100644 (file)
 
 */
 
+
 #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 <boost/atomic.hpp>
 #include <list>
 
+
 namespace dcp {
        class ReelAsset;
 }
@@ -53,6 +57,7 @@ class AudioBuffers;
 class ReferencedReelAsset;
 class Shuffler;
 
+
 class PlayerProperty
 {
 public:
@@ -64,15 +69,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<Player>
 {
 public:
-       Player (std::shared_ptr<const Film>);
+       Player (std::shared_ptr<const Film>, bool aligned_subtitles);
        Player (std::shared_ptr<const Film>, std::shared_ptr<const Playlist> playlist);
-       ~Player ();
 
        Player (Player const& Player) = delete;
        Player& operator= (Player const& Player) = delete;
@@ -202,7 +207,7 @@ private:
        LastVideoMap _last_video;
 
        AudioMerger _audio_merger;
-       Shuffler* _shuffler = nullptr;
+       std::unique_ptr<Shuffler> _shuffler;
        std::list<std::pair<std::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> > _delay;
 
        class StreamState
@@ -228,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