From d3c009991a782fa51e85828c7600994a9dd91559 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 19 Jul 2018 00:42:56 +0100 Subject: [PATCH] More renaming. sed -i "s/emit_text/emit_plain/g" src/lib/*.cc src/lib/*.h sed -i "s/emit_image_start/emit_bitmap_start/g" src/lib/*.cc src/lib/*.h sed -i "s/emit_text_start/emit_plain_start/g" src/lib/*.cc src/lib/*.h sed -i "s/render_subtitles/render_text/g" src/lib/*.cc src/lib/*.h src/lib/wscript test/*.cc sed -i "s/ImageStart/BitmapStart/g" src/lib/*.cc src/lib/*.h sed -i "s/TextStart/PlainStart/g" src/lib/*.cc src/lib/*.h test/*.cc src/wx/*.cc sed -i "s/ImageSubtitle/BitmapText/g" src/lib/*.cc src/lib/*.h sed -i "s/text_subtitle/plain_text/g" src/lib/*.cc src/lib/*.h src/lib/wscript src/wx/*.cc src/wx/*.h test/*.cc sed -i "s/image_subtitle/bitmap_text/g" src/lib/*.cc src/lib/*.h mv src/lib/render_subtitles.cc src/lib/render_text.cc mv src/lib/render_subtitles.h src/lib/render_text.h mv src/lib/text_subtitle.cc src/lib/plain_text.cc mv src/lib/text_subtitle.h src/lib/plain_text.h --- src/lib/bitmap_text.h | 48 +++++++++++++++++++ src/lib/content_subtitle.h | 8 ++-- src/lib/dcp_decoder.cc | 2 +- src/lib/dcp_text_decoder.cc | 4 +- src/lib/ffmpeg_decoder.cc | 4 +- src/lib/image_subtitle.h | 4 +- src/lib/{text_subtitle.cc => plain_text.cc} | 2 +- src/lib/{text_subtitle.h => plain_text.h} | 6 +-- src/lib/plain_text_content.cc | 2 +- src/lib/plain_text_decoder.cc | 2 +- src/lib/plain_text_decoder.h | 2 +- src/lib/player.cc | 18 +++---- src/lib/player.h | 6 +-- src/lib/player_subtitles.h | 6 +-- src/lib/reel_writer.cc | 2 +- .../{render_subtitles.cc => render_text.cc} | 4 +- src/lib/{render_subtitles.h => render_text.h} | 2 +- src/lib/text_decoder.cc | 22 ++++----- src/lib/text_decoder.h | 14 +++--- src/lib/text_file_decoder.cc | 2 +- src/lib/wscript | 4 +- src/wx/content_panel.cc | 2 +- src/wx/subtitle_view.cc | 2 +- test/dcp_subtitle_test.cc | 6 +-- test/render_subtitles_test.cc | 16 +++---- test/srt_subtitle_test.cc | 4 +- test/subtitle_charset_test.cc | 2 +- 27 files changed, 122 insertions(+), 74 deletions(-) create mode 100644 src/lib/bitmap_text.h rename src/lib/{text_subtitle.cc => plain_text.cc} (99%) rename src/lib/{text_subtitle.h => plain_text.h} (92%) rename src/lib/{render_subtitles.cc => render_text.cc} (98%) rename src/lib/{render_subtitles.h => render_text.h} (96%) diff --git a/src/lib/bitmap_text.h b/src/lib/bitmap_text.h new file mode 100644 index 000000000..64de7686d --- /dev/null +++ b/src/lib/bitmap_text.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2014-2018 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#ifndef DCPOMATIC_BITMAP_TEXT_H +#define DCPOMATIC_BITMAP_TEXT_H + +#include "rect.h" +#include + +class Image; + +class BitmapText +{ +public: + BitmapText (boost::shared_ptr i, dcpomatic::Rect r) + : image (i) + , rectangle (r) + {} + + boost::shared_ptr image; + /** Area that the subtitle covers on its corresponding video, expressed in + * proportions of the image size; e.g. rectangle.x = 0.5 would mean that + * the rectangle starts half-way across the video. + * + * This rectangle may or may not have had a TextContent's offsets and + * scale applied to it, depending on context. + */ + dcpomatic::Rect rectangle; +}; + +#endif diff --git a/src/lib/content_subtitle.h b/src/lib/content_subtitle.h index f834fe197..5a3e8157c 100644 --- a/src/lib/content_subtitle.h +++ b/src/lib/content_subtitle.h @@ -23,7 +23,7 @@ #include "dcpomatic_time.h" #include "rect.h" -#include "image_subtitle.h" +#include "bitmap_text.h" #include #include @@ -44,16 +44,16 @@ private: ContentTime _from; }; -class ContentImageSubtitle : public ContentSubtitle +class ContentBitmapText : public ContentSubtitle { public: - ContentImageSubtitle (ContentTime f, boost::shared_ptr im, dcpomatic::Rect r) + ContentBitmapText (ContentTime f, boost::shared_ptr im, dcpomatic::Rect r) : ContentSubtitle (f) , sub (im, r) {} /* Our subtitle, with its rectangle unmodified by any offsets or scales that the content specifies */ - ImageSubtitle sub; + BitmapText sub; }; /** A text subtitle. We store the time period separately (as well as in the dcp::SubtitleStrings) diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 03bd95d90..6a9de841d 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -209,7 +209,7 @@ DCPDecoder::pass_subtitles (ContentTime next) if (is) { list s; s.push_back (*is); - subtitle->emit_text ( + subtitle->emit_plain ( ContentTimePeriod ( ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i->in().as_seconds ()), ContentTime::from_frames (_offset - entry_point, vfr) + ContentTime::from_seconds (i->out().as_seconds ()) diff --git a/src/lib/dcp_text_decoder.cc b/src/lib/dcp_text_decoder.cc index 576cfd357..168bfa5cc 100644 --- a/src/lib/dcp_text_decoder.cc +++ b/src/lib/dcp_text_decoder.cc @@ -63,7 +63,7 @@ DCPTextDecoder::pass () /* Gather all subtitles with the same time period that are next on the list. We must emit all subtitles for the same time - period with the same text_subtitle() call otherwise the + period with the same plain_text() call otherwise the TextDecoder will assume there is nothing else at the time of emit the first. */ @@ -81,7 +81,7 @@ DCPTextDecoder::pass () /* XXX: image subtitles */ } - subtitle->emit_text (p, s); + subtitle->emit_plain (p, s); return false; } diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 4d10f8ef7..909a9d443 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -669,7 +669,7 @@ FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime static_cast (rect->h) / target_height ); - subtitle->emit_image_start (from, image, scaled_rect); + subtitle->emit_bitmap_start (from, image, scaled_rect); } void @@ -702,6 +702,6 @@ FFmpegDecoder::decode_ass_subtitle (string ass, ContentTime from) ); BOOST_FOREACH (sub::Subtitle const & i, sub::collect > (raw)) { - subtitle->emit_text_start (from, i); + subtitle->emit_plain_start (from, i); } } diff --git a/src/lib/image_subtitle.h b/src/lib/image_subtitle.h index e0687e581..1d2dcd793 100644 --- a/src/lib/image_subtitle.h +++ b/src/lib/image_subtitle.h @@ -26,10 +26,10 @@ class Image; -class ImageSubtitle +class BitmapText { public: - ImageSubtitle (boost::shared_ptr i, dcpomatic::Rect r) + BitmapText (boost::shared_ptr i, dcpomatic::Rect r) : image (i) , rectangle (r) {} diff --git a/src/lib/text_subtitle.cc b/src/lib/plain_text.cc similarity index 99% rename from src/lib/text_subtitle.cc rename to src/lib/plain_text.cc index 35801e160..ee9bc4b8b 100644 --- a/src/lib/text_subtitle.cc +++ b/src/lib/plain_text.cc @@ -18,7 +18,7 @@ */ -#include "text_subtitle.h" +#include "plain_text.h" #include "cross.h" #include "exceptions.h" #include "plain_text_content.h" diff --git a/src/lib/text_subtitle.h b/src/lib/plain_text.h similarity index 92% rename from src/lib/text_subtitle.h rename to src/lib/plain_text.h index 60571a439..61d714702 100644 --- a/src/lib/text_subtitle.h +++ b/src/lib/plain_text.h @@ -27,10 +27,10 @@ #include class PlainText; -class text_subtitle_time_test; -class text_subtitle_coordinate_test; +class plain_text_time_test; +class plain_text_coordinate_test; class plain_text_content_test; -class text_subtitle_parse_test; +class plain_text_parse_test; class TextSubtitle { diff --git a/src/lib/plain_text_content.cc b/src/lib/plain_text_content.cc index 6ca783c16..f51e365d5 100644 --- a/src/lib/plain_text_content.cc +++ b/src/lib/plain_text_content.cc @@ -20,7 +20,7 @@ #include "plain_text_content.h" #include "util.h" -#include "text_subtitle.h" +#include "plain_text.h" #include "film.h" #include "font.h" #include "text_content.h" diff --git a/src/lib/plain_text_decoder.cc b/src/lib/plain_text_decoder.cc index 71f7bed42..46a4bd552 100644 --- a/src/lib/plain_text_decoder.cc +++ b/src/lib/plain_text_decoder.cc @@ -72,7 +72,7 @@ TextTextDecoder::pass () } ContentTimePeriod const p = content_time_period (_subtitles[_next]); - subtitle->emit_text (p, _subtitles[_next]); + subtitle->emit_plain (p, _subtitles[_next]); ++_next; return false; diff --git a/src/lib/plain_text_decoder.h b/src/lib/plain_text_decoder.h index 4bdedf58d..046c5f8e0 100644 --- a/src/lib/plain_text_decoder.h +++ b/src/lib/plain_text_decoder.h @@ -22,7 +22,7 @@ #define DCPOMATIC_TEXT_SUBTITLE_DECODER_H #include "text_decoder.h" -#include "text_subtitle.h" +#include "plain_text.h" class PlainText; diff --git a/src/lib/player.cc b/src/lib/player.cc index b701deb5e..92e8141e1 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -28,7 +28,7 @@ #include "raw_image_proxy.h" #include "ratio.h" #include "log.h" -#include "render_subtitles.h" +#include "render_text.h" #include "config.h" #include "content_video.h" #include "player_video.h" @@ -167,8 +167,8 @@ Player::setup_pieces () } if (decoder->subtitle) { - decoder->subtitle->ImageStart.connect (bind (&Player::image_subtitle_start, this, weak_ptr (piece), _1)); - decoder->subtitle->TextStart.connect (bind (&Player::text_subtitle_start, this, weak_ptr (piece), _1)); + decoder->subtitle->BitmapStart.connect (bind (&Player::bitmap_text_start, this, weak_ptr (piece), _1)); + decoder->subtitle->PlainStart.connect (bind (&Player::plain_text_start, this, weak_ptr (piece), _1)); decoder->subtitle->Stop.connect (bind (&Player::subtitle_stop, this, weak_ptr (piece), _1)); } } @@ -290,11 +290,11 @@ Player::film_changed (Film::Property p) } list -Player::transform_image_subtitles (list subs) const +Player::transform_bitmap_texts (list subs) const { list all; - for (list::const_iterator i = subs.begin(); i != subs.end(); ++i) { + for (list::const_iterator i = subs.begin(); i != subs.end(); ++i) { if (!i->image) { continue; } @@ -667,12 +667,12 @@ Player::subtitles_for_frame (DCPTime time) const BOOST_FOREACH (PlayerSubtitles i, _active_subtitles.get_burnt (DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_subtitles)) { /* Image subtitles */ - list c = transform_image_subtitles (i.image); + list c = transform_bitmap_texts (i.image); copy (c.begin(), c.end(), back_inserter (subtitles)); /* Text subtitles (rendered to an image) */ if (!i.text.empty ()) { - list s = render_subtitles (i.text, i.fonts, _video_container_size, time, vfr); + list s = render_text (i.text, i.fonts, _video_container_size, time, vfr); copy (s.begin(), s.end(), back_inserter (subtitles)); } } @@ -840,7 +840,7 @@ Player::audio (weak_ptr wp, AudioStreamPtr stream, ContentAudio content_a } void -Player::image_subtitle_start (weak_ptr wp, ContentImageSubtitle subtitle) +Player::bitmap_text_start (weak_ptr wp, ContentBitmapText subtitle) { shared_ptr piece = wp.lock (); if (!piece) { @@ -867,7 +867,7 @@ Player::image_subtitle_start (weak_ptr wp, ContentImageSubtitle subtitle) } void -Player::text_subtitle_start (weak_ptr wp, ContentTextSubtitle subtitle) +Player::plain_text_start (weak_ptr wp, ContentTextSubtitle subtitle) { shared_ptr piece = wp.lock (); if (!piece) { diff --git a/src/lib/player.h b/src/lib/player.h index 54fa074c0..b0ffe0e04 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -116,7 +116,7 @@ private: void film_changed (Film::Property); void playlist_changed (); void playlist_content_changed (boost::weak_ptr, int, bool); - std::list transform_image_subtitles (std::list) const; + std::list transform_bitmap_texts (std::list) const; Frame dcp_to_content_video (boost::shared_ptr piece, DCPTime t) const; DCPTime content_video_to_dcp (boost::shared_ptr piece, Frame f) const; Frame dcp_to_resampled_audio (boost::shared_ptr piece, DCPTime t) const; @@ -126,8 +126,8 @@ private: boost::shared_ptr black_player_video_frame (Eyes eyes) const; void video (boost::weak_ptr, ContentVideo); void audio (boost::weak_ptr, AudioStreamPtr, ContentAudio); - void image_subtitle_start (boost::weak_ptr, ContentImageSubtitle); - void text_subtitle_start (boost::weak_ptr, ContentTextSubtitle); + void bitmap_text_start (boost::weak_ptr, ContentBitmapText); + void plain_text_start (boost::weak_ptr, ContentTextSubtitle); void subtitle_stop (boost::weak_ptr, ContentTime); DCPTime one_video_frame () const; void fill_audio (DCPTimePeriod period); diff --git a/src/lib/player_subtitles.h b/src/lib/player_subtitles.h index e1a104f21..4e3a739d8 100644 --- a/src/lib/player_subtitles.h +++ b/src/lib/player_subtitles.h @@ -21,7 +21,7 @@ #ifndef DCPOMATIC_PLAYER_SUBTITLES_H #define DCPOMATIC_PLAYER_SUBTITLES_H -#include "image_subtitle.h" +#include "bitmap_text.h" #include "dcpomatic_time.h" #include "subtitle_string.h" @@ -34,8 +34,8 @@ public: void add_fonts (std::list > fonts_); std::list > fonts; - /** ImageSubtitles, with their rectangles transformed as specified by their content */ - std::list image; + /** BitmapTexts, with their rectangles transformed as specified by their content */ + std::list image; std::list text; }; diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 24ab1c534..197773a20 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -563,7 +563,7 @@ ReelWriter::write (PlayerSubtitles subs, DCPTimePeriod period) _subtitle_asset->add (shared_ptr(new dcp::SubtitleString(i))); } - BOOST_FOREACH (ImageSubtitle i, subs.image) { + BOOST_FOREACH (BitmapText i, subs.image) { _subtitle_asset->add ( shared_ptr( new dcp::SubtitleImage( diff --git a/src/lib/render_subtitles.cc b/src/lib/render_text.cc similarity index 98% rename from src/lib/render_subtitles.cc rename to src/lib/render_text.cc index 35fcd8b93..673078347 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_text.cc @@ -18,7 +18,7 @@ */ -#include "render_subtitles.h" +#include "render_text.h" #include "types.h" #include "image.h" #include "cross.h" @@ -365,7 +365,7 @@ render_line (list subtitles, list > fonts, dcp: * @param frame_rate DCP frame rate. */ list -render_subtitles (list subtitles, list > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_text (list subtitles, list > fonts, dcp::Size target, DCPTime time, int frame_rate) { list pending; list images; diff --git a/src/lib/render_subtitles.h b/src/lib/render_text.h similarity index 96% rename from src/lib/render_subtitles.h rename to src/lib/render_text.h index b1239bb3d..0f3a31e21 100644 --- a/src/lib/render_subtitles.h +++ b/src/lib/render_text.h @@ -26,6 +26,6 @@ class Font; std::string marked_up (std::list subtitles, int target_height, float fade_factor); -std::list render_subtitles ( +std::list render_text ( std::list, std::list > fonts, dcp::Size, DCPTime, int ); diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index 56a7e1e15..8b825936a 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -58,14 +58,14 @@ TextDecoder::TextDecoder ( * of the video frame) */ void -TextDecoder::emit_image_start (ContentTime from, shared_ptr image, dcpomatic::Rect rect) +TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr image, dcpomatic::Rect rect) { - ImageStart (ContentImageSubtitle (from, image, rect)); + BitmapStart (ContentBitmapText (from, image, rect)); _position = from; } void -TextDecoder::emit_text_start (ContentTime from, list s) +TextDecoder::emit_plain_start (ContentTime from, list s) { BOOST_FOREACH (dcp::SubtitleString& i, s) { /* We must escape < and > in strings, otherwise they might confuse our subtitle @@ -94,12 +94,12 @@ TextDecoder::emit_text_start (ContentTime from, list s) } } - TextStart (ContentTextSubtitle (from, s)); + PlainStart (ContentTextSubtitle (from, s)); _position = from; } void -TextDecoder::emit_text_start (ContentTime from, sub::Subtitle const & subtitle) +TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) { /* See if our next subtitle needs to be vertically placed on screen by us */ bool needs_placement = false; @@ -191,7 +191,7 @@ TextDecoder::emit_text_start (ContentTime from, sub::Subtitle const & subtitle) /* The idea here (rightly or wrongly) is that we set the appearance based on the values in the libsub objects, and these are overridden with values from the - content by the other emit_text_start() above. + content by the other emit_plain_start() above. */ out.push_back ( @@ -227,7 +227,7 @@ TextDecoder::emit_text_start (ContentTime from, sub::Subtitle const & subtitle) } } - emit_text_start (from, out); + emit_plain_start (from, out); } void @@ -237,16 +237,16 @@ TextDecoder::emit_stop (ContentTime to) } void -TextDecoder::emit_text (ContentTimePeriod period, list s) +TextDecoder::emit_plain (ContentTimePeriod period, list s) { - emit_text_start (period.from, s); + emit_plain_start (period.from, s); emit_stop (period.to); } void -TextDecoder::emit_text (ContentTimePeriod period, sub::Subtitle const & s) +TextDecoder::emit_plain (ContentTimePeriod period, sub::Subtitle const & s) { - emit_text_start (period.from, s); + emit_plain_start (period.from, s); emit_stop (period.to); } diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h index d9d351d92..221ed6d37 100644 --- a/src/lib/text_decoder.h +++ b/src/lib/text_decoder.h @@ -49,11 +49,11 @@ public: return _position; } - void emit_image_start (ContentTime from, boost::shared_ptr image, dcpomatic::Rect rect); - void emit_text_start (ContentTime from, std::list s); - void emit_text_start (ContentTime from, sub::Subtitle const & subtitle); - void emit_text (ContentTimePeriod period, std::list s); - void emit_text (ContentTimePeriod period, sub::Subtitle const & subtitle); + void emit_bitmap_start (ContentTime from, boost::shared_ptr image, dcpomatic::Rect rect); + void emit_plain_start (ContentTime from, std::list s); + void emit_plain_start (ContentTime from, sub::Subtitle const & subtitle); + void emit_plain (ContentTimePeriod period, std::list s); + void emit_plain (ContentTimePeriod period, sub::Subtitle const & subtitle); void emit_stop (ContentTime to); void seek (); @@ -62,8 +62,8 @@ public: return _content; } - boost::signals2::signal ImageStart; - boost::signals2::signal TextStart; + boost::signals2::signal BitmapStart; + boost::signals2::signal PlainStart; boost::signals2::signal Stop; private: diff --git a/src/lib/text_file_decoder.cc b/src/lib/text_file_decoder.cc index 1dba3acd0..a6d7b327b 100644 --- a/src/lib/text_file_decoder.cc +++ b/src/lib/text_file_decoder.cc @@ -68,7 +68,7 @@ TextTextDecoder::pass () } ContentTimePeriod const p = content_time_period (_subtitles[_next]); - subtitle->emit_text (p, _subtitles[_next]); + subtitle->emit_plain (p, _subtitles[_next]); ++_next; return false; diff --git a/src/lib/wscript b/src/lib/wscript index b3e04e28b..dd7c87f39 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -119,7 +119,7 @@ sources = """ ratio.cc raw_image_proxy.cc reel_writer.cc - render_subtitles.cc + render_text.cc resampler.cc rgba.cc scoped_temporary.cc @@ -134,7 +134,7 @@ sources = """ string_log_entry.cc text_content.cc text_decoder.cc - text_subtitle.cc + plain_text.cc plain_text_content.cc plain_text_decoder.cc timer.cc diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 225ac5d6b..578c9fa24 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -40,7 +40,7 @@ #include "lib/log.h" #include "lib/compose.hpp" #include "lib/plain_text_content.h" -#include "lib/text_subtitle.h" +#include "lib/plain_text.h" #include #include #include diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc index eb63ca443..41bf4b049 100644 --- a/src/wx/subtitle_view.cc +++ b/src/wx/subtitle_view.cc @@ -84,7 +84,7 @@ SubtitleView::SubtitleView (wxWindow* parent, shared_ptr film, shared_ptr< _subs = 0; _frc = film->active_frame_rate_change (content->position()); - decoder->subtitle->TextStart.connect (bind (&SubtitleView::data_start, this, _1)); + decoder->subtitle->PlainStart.connect (bind (&SubtitleView::data_start, this, _1)); decoder->subtitle->Stop.connect (bind (&SubtitleView::data_stop, this, _1)); while (!decoder->pass ()) {} SetSizerAndFit (sizer); diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 3d05e143d..026fbd12a 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test) BOOST_REQUIRE (!wait_for_jobs ()); shared_ptr decoder (new DCPDecoder (content, film->log(), false)); - decoder->subtitle->TextStart.connect (bind (store, _1)); + decoder->subtitle->PlainStart.connect (bind (store, _1)); stored = optional (); while (!decoder->pass() && !stored) {} @@ -114,7 +114,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2) BOOST_REQUIRE (!wait_for_jobs ()); shared_ptr decoder (new DCPTextDecoder (content, film->log())); - decoder->subtitle->TextStart.connect (bind (store, _1)); + decoder->subtitle->PlainStart.connect (bind (store, _1)); stored = optional (); while (!decoder->pass ()) { @@ -142,7 +142,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3) shared_ptr decoder (new DCPTextDecoder (content, film->log())); stored = optional (); while (!decoder->pass ()) { - decoder->subtitle->TextStart.connect (bind (store, _1)); + decoder->subtitle->PlainStart.connect (bind (store, _1)); if (stored && stored->from() == ContentTime::from_seconds(0.08)) { list s = stored->subs; list::const_iterator i = s.begin (); diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 4276a2b01..bd676eab0 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -18,12 +18,12 @@ */ -/** @file test/render_subtitles_test.cc +/** @file test/render_text_test.cc * @brief Check markup of subtitles for rendering. * @ingroup specific */ -#include "lib/render_subtitles.h" +#include "lib/render_text.h" #include #include @@ -57,7 +57,7 @@ add (std::list& s, std::string text, bool italic, bool bold, boo ); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test1) { std::list s; @@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test1) BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test2) { std::list s; @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test2) } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test3) { std::list s; @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test3) BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test4) { std::list s; @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test4) BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test5) { std::list s; @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test5) BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello world."); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test6) { std::list s; diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 199af34ad..1570cdce9 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -190,14 +190,14 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test4) BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471)); shared_ptr decoder (new SubRipDecoder (content)); - list cts = decoder->get_text_subtitles ( + list cts = decoder->get_plain_texts ( ContentTimePeriod ( ContentTime::from_seconds (109), ContentTime::from_seconds (110) ), false ); BOOST_CHECK_EQUAL (cts.size(), 1); - PositionImage image = render_subtitles (cts.front().subs, dcp::Size (1998, 1080)); + PositionImage image = render_text (cts.front().subs, dcp::Size (1998, 1080)); write_image (image.image, "build/test/subrip_render_test.png"); check_file ("build/test/subrip_render_test.png", "test/data/subrip_render_test.png"); } diff --git a/test/subtitle_charset_test.cc b/test/subtitle_charset_test.cc index 9b2de2132..2b1b97b25 100644 --- a/test/subtitle_charset_test.cc +++ b/test/subtitle_charset_test.cc @@ -22,7 +22,7 @@ #include "lib/content.h" #include "lib/film.h" #include "lib/content_factory.h" -#include "lib/text_subtitle.h" +#include "lib/plain_text.h" #include "lib/plain_text_content.h" #include -- 2.30.2