diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-19 20:10:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-19 23:45:23 +0100 |
| commit | 0e4a58abdc78f84478031acdc0acb95f5cb9a2a6 (patch) | |
| tree | 2b20b3f38ad09ee2c161a0612f0b7a4c65983d06 /src/lib | |
| parent | 6b4059b815eec61ff953918694f5b6fbe010a1a0 (diff) | |
Finish PlayerSubtitles -> PlayerText and SubtitleString -> PlainText.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 2 | ||||
| -rw-r--r-- | src/lib/player_text.cc | 2 | ||||
| -rw-r--r-- | src/lib/reel_writer.cc | 4 | ||||
| -rw-r--r-- | src/lib/reel_writer.h | 4 | ||||
| -rw-r--r-- | src/lib/render_text.cc | 12 | ||||
| -rw-r--r-- | src/lib/render_text.h | 4 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 32c2dfdfd..35047c3ae 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -901,7 +901,7 @@ Player::plain_text_start (weak_ptr<Piece> wp, ContentPlainText subtitle) } s.set_in (dcp::Time(from.seconds(), 1000)); - ps.text.push_back (SubtitleString (s, piece->content->subtitle->outline_width())); + ps.text.push_back (PlainText (s, piece->content->subtitle->outline_width())); ps.add_fonts (piece->content->subtitle->fonts ()); } diff --git a/src/lib/player_text.cc b/src/lib/player_text.cc index 588e4ef7f..16e89b0f1 100644 --- a/src/lib/player_text.cc +++ b/src/lib/player_text.cc @@ -26,7 +26,7 @@ using std::list; using boost::shared_ptr; void -PlayerSubtitles::add_fonts (list<shared_ptr<Font> > fonts_) +PlayerText::add_fonts (list<shared_ptr<Font> > fonts_) { BOOST_FOREACH (shared_ptr<Font> i, fonts_) { bool got = false; diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 197773a20..d23ac76d1 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -528,7 +528,7 @@ ReelWriter::write (shared_ptr<const AudioBuffers> audio) } void -ReelWriter::write (PlayerSubtitles subs, DCPTimePeriod period) +ReelWriter::write (PlayerText subs, DCPTimePeriod period) { if (!_subtitle_asset) { string lang = _film->subtitle_language (); @@ -556,7 +556,7 @@ ReelWriter::write (PlayerSubtitles subs, DCPTimePeriod period) } } - BOOST_FOREACH (SubtitleString i, subs.text) { + BOOST_FOREACH (PlainText i, subs.text) { /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */ i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr)); i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr)); diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h index 4357a28f2..37e950ae6 100644 --- a/src/lib/reel_writer.h +++ b/src/lib/reel_writer.h @@ -21,7 +21,7 @@ #include "types.h" #include "dcpomatic_time.h" #include "referenced_reel_asset.h" -#include "player_subtitles.h" +#include "player_text.h" #include <dcp/picture_asset_writer.h> #include <boost/shared_ptr.hpp> @@ -60,7 +60,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, DCPTimePeriod period); + void write (PlayerText subs, DCPTimePeriod period); void finish (); boost::shared_ptr<dcp::Reel> create_reel (std::list<ReferencedReelAsset> const & refs, std::list<boost::shared_ptr<Font> > const & fonts); diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 673078347..77a8036e8 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -51,11 +51,11 @@ static FcConfig* fc_config = 0; static list<pair<FontFiles, string> > fc_config_fonts; string -marked_up (list<SubtitleString> subtitles, int target_height, float fade_factor) +marked_up (list<PlainText> subtitles, int target_height, float fade_factor) { string out; - BOOST_FOREACH (SubtitleString const & i, subtitles) { + BOOST_FOREACH (PlainText const & i, subtitles) { out += "<span "; if (i.italic()) { out += "style=\"italic\" "; @@ -91,7 +91,7 @@ set_source_rgba (Cairo::RefPtr<Cairo::Context> context, dcp::Colour colour, floa * at the same time and with the same fade in/out. */ static PositionImage -render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_line (list<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) { /* XXX: this method can only handle italic / bold changes mid-line, nothing else yet. @@ -365,12 +365,12 @@ render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp: * @param frame_rate DCP frame rate. */ list<PositionImage> -render_text (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_text (list<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) { - list<SubtitleString> pending; + list<PlainText> pending; list<PositionImage> images; - BOOST_FOREACH (SubtitleString const & i, subtitles) { + BOOST_FOREACH (PlainText const & i, subtitles) { if (!pending.empty() && fabs (i.v_position() - pending.back().v_position()) > 1e-4) { images.push_back (render_line (pending, fonts, target, time, frame_rate)); pending.clear (); diff --git a/src/lib/render_text.h b/src/lib/render_text.h index 496967f31..f9c35005e 100644 --- a/src/lib/render_text.h +++ b/src/lib/render_text.h @@ -25,7 +25,7 @@ class Font; -std::string marked_up (std::list<SubtitleString> subtitles, int target_height, float fade_factor); +std::string marked_up (std::list<PlainText> subtitles, int target_height, float fade_factor); std::list<PositionImage> render_text ( - std::list<SubtitleString>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int + std::list<PlainText>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int ); |
