Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / lib / reel_writer.h
index edf6c081e955bfff863bda6286652404ce445bba..ae64c3ac77ed9c73bd6f4f6939c9f5c6710548cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -21,7 +21,8 @@
 #include "types.h"
 #include "dcpomatic_time.h"
 #include "referenced_reel_asset.h"
-#include "player_subtitles.h"
+#include "player_text.h"
+#include "dcp_text_track.h"
 #include <dcp/picture_asset_writer.h>
 #include <boost/shared_ptr.hpp>
 
@@ -60,7 +61,7 @@ public:
        void fake_write (Frame frame, Eyes eyes, int size);
        void repeat_write (Frame frame, Eyes eyes);
        void write (boost::shared_ptr<const AudioBuffers> audio);
-       void write (PlayerSubtitles subs);
+       void write (PlayerText text, TextType type, boost::optional<DCPTextTrack> track, DCPTimePeriod period);
 
        void finish ();
        boost::shared_ptr<dcp::Reel> create_reel (std::list<ReferencedReelAsset> const & refs, std::list<boost::shared_ptr<Font> > const & fonts);
@@ -72,10 +73,6 @@ public:
                return _period;
        }
 
-       int total_written_audio_frames () const {
-               return _total_written_audio_frames;
-       }
-
        int last_written_video_frame () const {
                return _last_written_video_frame;
        }
@@ -107,8 +104,6 @@ private:
        /** the index of the last written video frame within the reel */
        int _last_written_video_frame;
        Eyes _last_written_eyes;
-       /** the number of audio frames that have been written to the reel */
-       int _total_written_audio_frames;
        /** index of this reel within the DCP (starting from 0) */
        int _reel_index;
        /** number of reels in the DCP */
@@ -120,6 +115,7 @@ private:
        boost::shared_ptr<dcp::SoundAsset> _sound_asset;
        boost::shared_ptr<dcp::SoundAssetWriter> _sound_asset_writer;
        boost::shared_ptr<dcp::SubtitleAsset> _subtitle_asset;
+       std::map<DCPTextTrack, boost::shared_ptr<dcp::SubtitleAsset> > _closed_caption_assets;
 
        static int const _info_size;
 };