X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_encoder.cc;h=cc42f1204e78c860b21e0ba623b494def2ed3124;hb=a5d004b0773f633401528392fc28e66d70e13ac8;hp=1ef7fcd9469b0d6b70b4b6750dcbd96f0b1fe120;hpb=3ea24566e4591c0160379a6bee97c5e62b60a028;p=dcpomatic.git diff --git a/src/lib/subtitle_encoder.cc b/src/lib/subtitle_encoder.cc index 1ef7fcd94..cc42f1204 100644 --- a/src/lib/subtitle_encoder.cc +++ b/src/lib/subtitle_encoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2019 Carl Hetherington + Copyright (C) 2019-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -18,7 +18,7 @@ */ -#include "font.h" +#include "font_data.h" #include "subtitle_encoder.h" #include "player.h" #include "compose.hpp" @@ -26,9 +26,8 @@ #include #include #include -#include #include -#include +#include #include "i18n.h" @@ -36,8 +35,11 @@ using std::string; using std::make_pair; using std::pair; using std::vector; -using boost::shared_ptr; +using std::shared_ptr; using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif using dcp::raw_convert; /** @param output Directory, if there will be multiple output files, or a filename. @@ -75,9 +77,11 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr film, shared_ptr j _assets.push_back (make_pair(shared_ptr(), boost::filesystem::change_extension(filename, extension))); } - BOOST_FOREACH (dcpomatic::DCPTimePeriod i, film->reels()) { + for (auto i: film->reels()) { _reels.push_back (i); } + + _default_font = dcp::ArrayData (default_font_file()); } void @@ -111,8 +115,8 @@ SubtitleEncoder::go () } if (!_film->interop() || _include_font) { - BOOST_FOREACH (shared_ptr j, _player->get_subtitle_fonts()) { - i->first->add_font (j->id(), default_font_file()); + for (auto j: _player->get_subtitle_fonts()) { + i->first->add_font (j.id, _default_font); } } @@ -158,7 +162,7 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional tr } } - BOOST_FOREACH (StringText i, subs.string) { + for (auto i: subs.string) { /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */ i.set_in (i.in()); i.set_out (i.out());