Untested; allow viewing of subtitles or closed captions in the preview.
[dcpomatic.git] / src / lib / player.h
index 16e9d57a5b38d92af5a0431b988a3c5413275d9a..cbadb11f658f5a82f509c04304241fe4a703f604 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "player_caption.h"
 #include "active_captions.h"
-#include "content_text.h"
+#include "content_caption.h"
 #include "film.h"
 #include "content.h"
 #include "position_image.h"
@@ -79,7 +79,7 @@ public:
        void set_video_container_size (dcp::Size);
        void set_ignore_video ();
        void set_ignore_subtitle ();
-       void set_always_burn_subtitles (bool burn);
+       void set_always_burn_captions (CaptionType type);
        void set_fast ();
        void set_play_referenced ();
        void set_dcp_decode_reduction (boost::optional<int> reduction);
@@ -101,7 +101,7 @@ public:
        /** Emitted when a caption is ready.  This signal may be emitted considerably
         *  after the corresponding Video.
         */
-       boost::signals2::signal<void (PlayerCaption, TextType, DCPTimePeriod)> Text;
+       boost::signals2::signal<void (PlayerCaption, CaptionType, DCPTimePeriod)> Caption;
 
 private:
        friend class PlayerWrapper;
@@ -116,7 +116,7 @@ private:
        void film_changed (Film::Property);
        void playlist_changed ();
        void playlist_content_changed (boost::weak_ptr<Content>, int, bool);
-       std::list<PositionImage> transform_bitmap_texts (std::list<BitmapText>) const;
+       std::list<PositionImage> transform_bitmap_captions (std::list<BitmapCaption>) const;
        Frame dcp_to_content_video (boost::shared_ptr<const Piece> piece, DCPTime t) const;
        DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const;
        Frame dcp_to_resampled_audio (boost::shared_ptr<const Piece> piece, DCPTime t) const;
@@ -128,13 +128,13 @@ private:
        void audio (boost::weak_ptr<Piece>, AudioStreamPtr, ContentAudio);
        void bitmap_text_start (boost::weak_ptr<Piece>, ContentBitmapCaption);
        void plain_text_start (boost::weak_ptr<Piece>, ContentTextCaption);
-       void subtitle_stop (boost::weak_ptr<Piece>, ContentTime, TextType);
+       void subtitle_stop (boost::weak_ptr<Piece>, ContentTime, CaptionType);
        DCPTime one_video_frame () const;
        void fill_audio (DCPTimePeriod period);
        std::pair<boost::shared_ptr<AudioBuffers>, DCPTime> discard_audio (
                boost::shared_ptr<const AudioBuffers> audio, DCPTime time, DCPTime discard_to
                ) const;
-       boost::optional<PositionImage> subtitles_for_frame (DCPTime time) const;
+       boost::optional<PositionImage> captions_for_frame (DCPTime time) const;
        void emit_video (boost::shared_ptr<PlayerVideo> pv, DCPTime time);
        void do_emit_video (boost::shared_ptr<PlayerVideo> pv, DCPTime time);
        void emit_audio (boost::shared_ptr<AudioBuffers> data, DCPTime time);
@@ -154,10 +154,10 @@ private:
        bool _ignore_video;
        /** true if the player should ignore all audio; i.e. never produce any */
        bool _ignore_subtitle;
-       /** true if the player should always burn subtitles into the video regardless
-           of content settings
+       /** Type of captions that the player should always burn into the video regardless
+           of content settings.
        */
-       bool _always_burn_subtitles;
+       boost::optional<CaptionType> _always_burn_captions;
        /** true if we should try to be fast rather than high quality */
        bool _fast;
        /** true if we should `play' (i.e output) referenced DCP data (e.g. for preview) */
@@ -196,7 +196,7 @@ private:
        Empty _black;
        Empty _silent;
 
-       ActiveCaptions _active_text[TEXT_COUNT];
+       ActiveCaptions _active_captions[CAPTION_COUNT];
        boost::shared_ptr<AudioProcessor> _audio_processor;
 
        boost::signals2::scoped_connection _film_changed_connection;