Remove in-place translations support.
[dcpomatic.git] / src / lib / reel_writer.h
index e578a481317b995984996f890536286e052ef2d4..c9052c832fd8570223bc8e4b6b6166bb14a2b25a 100644 (file)
 #include "atmos_metadata.h"
 #include "dcp_text_track.h"
 #include "dcpomatic_time.h"
+#include "enum_indexed_vector.h"
 #include "font_id_map.h"
 #include "player_text.h"
 #include "referenced_reel_asset.h"
-#include "types.h"
+#include "render_text.h"
 #include "weak_film.h"
 #include <dcp/atmos_asset_writer.h>
 #include <dcp/file.h>
@@ -71,19 +72,17 @@ public:
        void fake_write (int size);
        void repeat_write (Frame frame, Eyes eyes);
        void write (std::shared_ptr<const AudioBuffers> audio);
-       void write (PlayerText text, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period, FontIdMap const& fonts);
+       void write(PlayerText text, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period, FontIdMap const& fonts, std::shared_ptr<dcpomatic::Font> chosen_interop_font);
        void write (std::shared_ptr<const dcp::AtmosFrame> atmos, AtmosMetadata metadata);
 
        void finish (boost::filesystem::path output_dcp);
        std::shared_ptr<dcp::Reel> create_reel (
                std::list<ReferencedReelAsset> const & refs,
-               FontIdMap const & fonts,
-               std::shared_ptr<dcpomatic::Font> chosen_interop_font,
                boost::filesystem::path output_dcp,
                bool ensure_subtitles,
                std::set<DCPTextTrack> ensure_closed_captions
                );
-       void calculate_digests (std::function<void (float)> set_progress);
+       void calculate_digests(std::function<void (int64_t, int64_t)> set_progress);
 
        Frame start () const;
 
@@ -91,8 +90,8 @@ public:
                return _period;
        }
 
-       int first_nonexistant_frame () const {
-               return _first_nonexistant_frame;
+       int first_nonexistent_frame () const {
+               return _first_nonexistent_frame;
        }
 
        dcp::FrameInfo read_frame_info (std::shared_ptr<InfoFileHandle> info, Frame frame, Eyes eyes) const;
@@ -112,20 +111,19 @@ private:
        void create_reel_text (
                std::shared_ptr<dcp::Reel> reel,
                std::list<ReferencedReelAsset> const & refs,
-               FontIdMap const& fonts,
-               std::shared_ptr<dcpomatic::Font> chosen_interop_font,
                int64_t duration,
                boost::filesystem::path output_dcp,
                bool ensure_subtitles,
                std::set<DCPTextTrack> ensure_closed_captions
                ) const;
        void create_reel_markers (std::shared_ptr<dcp::Reel> reel) const;
+       float convert_vertical_position(StringText const& subtitle, dcp::SubtitleStandard to) const;
 
        dcpomatic::DCPTimePeriod _period;
        /** the first picture frame index that does not already exist in our MXF */
-       int _first_nonexistant_frame;
+       int _first_nonexistent_frame;
        /** the data of the last written frame, if there is one */
-       std::shared_ptr<const dcp::Data> _last_written[static_cast<int>(Eyes::COUNT)];
+       EnumIndexedVector<std::shared_ptr<const dcp::Data>, Eyes> _last_written;
        /** index of this reel within the DCP (starting from 0) */
        int _reel_index;
        /** number of reels in the DCP */
@@ -146,5 +144,7 @@ private:
        std::shared_ptr<dcp::AtmosAsset> _atmos_asset;
        std::shared_ptr<dcp::AtmosAssetWriter> _atmos_asset_writer;
 
+       mutable FontMetrics _font_metrics;
+
        static int const _info_size;
 };