From 507a389e9c5f84ec1d51e7566e38fbf42f658537 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 19 Jul 2018 14:36:04 +0100 Subject: [PATCH] PlainText -> PlainTextFile. --- src/lib/content_factory.cc | 6 +++--- src/lib/decoder_factory.cc | 8 ++++---- src/lib/{plain_text.cc => plain_text_file.cc} | 10 +++++----- src/lib/{plain_text.h => plain_text_file.h} | 18 +++++++++++------ ..._content.cc => plain_text_file_content.cc} | 20 +++++++++---------- ...xt_content.h => plain_text_file_content.h} | 16 +++++++-------- ..._decoder.cc => plain_text_file_decoder.cc} | 17 ++++++++-------- ...xt_decoder.h => plain_text_file_decoder.h} | 17 ++++++++-------- src/lib/wscript | 6 +++--- src/wx/content_panel.cc | 8 ++++---- src/wx/subtitle_appearance_dialog.cc | 2 +- src/wx/subtitle_panel.cc | 6 +++--- src/wx/subtitle_view.cc | 5 +++-- src/wx/timing_panel.cc | 2 +- test/ffmpeg_encoder_test.cc | 10 +++++----- test/player_test.cc | 4 ++-- test/reels_test.cc | 6 +++--- test/srt_subtitle_test.cc | 16 +++++++-------- test/ssa_subtitle_test.cc | 4 ++-- test/subtitle_charset_test.cc | 6 +++--- test/subtitle_reel_number_test.cc | 4 ++-- 21 files changed, 100 insertions(+), 91 deletions(-) rename src/lib/{plain_text.cc => plain_text_file.cc} (93%) rename src/lib/{plain_text.h => plain_text_file.h} (69%) rename src/lib/{plain_text_content.cc => plain_text_file_content.cc} (77%) rename src/lib/{plain_text_content.h => plain_text_file_content.h} (66%) rename src/lib/{plain_text_decoder.cc => plain_text_file_decoder.cc} (81%) rename src/lib/{plain_text_decoder.h => plain_text_file_decoder.h} (68%) diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 4e8880ffe..167b3f4e9 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -26,7 +26,7 @@ #include "audio_content.h" #include "image_content.h" #include "atmos_mxf_content.h" -#include "plain_text_content.h" +#include "plain_text_file_content.h" #include "dcp_content.h" #include "dcp_text_content.h" #include "util.h" @@ -88,7 +88,7 @@ content_factory (shared_ptr film, cxml::NodePtr node, int version, l ); } else if (type == "SubRip" || type == "TextSubtitle") { - content.reset (new PlainTextContent (film, node, version)); + content.reset (new PlainTextFileContent (film, node, version)); } else if (type == "DCP") { content.reset (new DCPContent (film, node, version)); } else if (type == "DCPSubtitle") { @@ -210,7 +210,7 @@ content_factory (shared_ptr film, boost::filesystem::path path) if (valid_image_file (path)) { single.reset (new ImageContent (film, path)); } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass") { - single.reset (new PlainTextContent (film, path)); + single.reset (new PlainTextFileContent (film, path)); } else if (ext == ".xml") { cxml::Document doc; doc.read_file (path); diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index 73a5b66fe..a7367dd24 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -24,8 +24,8 @@ #include "dcp_decoder.h" #include "image_content.h" #include "image_decoder.h" -#include "plain_text_content.h" -#include "plain_text_decoder.h" +#include "plain_text_file_content.h" +#include "plain_text_file_decoder.h" #include "dcp_text_content.h" #include "dcp_text_decoder.h" #include "video_mxf_content.h" @@ -54,9 +54,9 @@ decoder_factory (shared_ptr content, shared_ptr log, bool fa return shared_ptr (new ImageDecoder (ic, log)); } - shared_ptr rc = dynamic_pointer_cast (content); + shared_ptr rc = dynamic_pointer_cast (content); if (rc) { - return shared_ptr (new PlainTextDecoder (rc, log)); + return shared_ptr (new PlainTextFileDecoder (rc, log)); } shared_ptr dsc = dynamic_pointer_cast (content); diff --git a/src/lib/plain_text.cc b/src/lib/plain_text_file.cc similarity index 93% rename from src/lib/plain_text.cc rename to src/lib/plain_text_file.cc index 58035a07f..4ed13491c 100644 --- a/src/lib/plain_text.cc +++ b/src/lib/plain_text_file.cc @@ -18,10 +18,10 @@ */ -#include "plain_text.h" +#include "plain_text_file.h" #include "cross.h" #include "exceptions.h" -#include "plain_text_content.h" +#include "plain_text_file_content.h" #include #include #include @@ -39,7 +39,7 @@ using boost::scoped_array; using boost::optional; using dcp::Data; -PlainText::PlainText (shared_ptr content) +PlainTextFile::PlainTextFile (shared_ptr content) { Data in (content->path (0)); @@ -96,7 +96,7 @@ PlainText::PlainText (shared_ptr content) /** @return time of first subtitle, if there is one */ optional -PlainText::first () const +PlainTextFile::first () const { if (_subtitles.empty()) { return optional(); @@ -106,7 +106,7 @@ PlainText::first () const } ContentTime -PlainText::length () const +PlainTextFile::length () const { if (_subtitles.empty ()) { return ContentTime (); diff --git a/src/lib/plain_text.h b/src/lib/plain_text_file.h similarity index 69% rename from src/lib/plain_text.h rename to src/lib/plain_text_file.h index 01d3d77ef..34dc08465 100644 --- a/src/lib/plain_text.h +++ b/src/lib/plain_text_file.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2016 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -18,24 +18,30 @@ */ -#ifndef DCPOMATIC_TEXT_SUBTITLE_H -#define DCPOMATIC_TEXT_SUBTITLE_H +#ifndef DCPOMATIC_PLAIN_TEXT_FILE_H +#define DCPOMATIC_PLAIN_TEXT_FILE_H #include "dcpomatic_time.h" #include #include #include -class PlainTextContent; +class PlainTextFileContent; class plain_text_time_test; class plain_text_coordinate_test; class plain_text_content_test; class plain_text_parse_test; -class PlainText +/** @class PlainTextFile + * @brief Base for PlainTextFile decoder and examiner. + * + * In fact this is sufficient for the examiner, so it's used as-is rather than deriving + * a pointless PlainTextFileExaminer. + */ +class PlainTextFile { public: - explicit PlainText (boost::shared_ptr); + explicit PlainTextFile (boost::shared_ptr); boost::optional first () const; ContentTime length () const; diff --git a/src/lib/plain_text_content.cc b/src/lib/plain_text_file_content.cc similarity index 77% rename from src/lib/plain_text_content.cc rename to src/lib/plain_text_file_content.cc index a07dcb67c..2b52cee96 100644 --- a/src/lib/plain_text_content.cc +++ b/src/lib/plain_text_file_content.cc @@ -18,9 +18,9 @@ */ -#include "plain_text_content.h" +#include "plain_text_file_content.h" #include "util.h" -#include "plain_text.h" +#include "plain_text_file.h" #include "film.h" #include "font.h" #include "text_content.h" @@ -35,13 +35,13 @@ using std::cout; using boost::shared_ptr; using dcp::raw_convert; -PlainTextContent::PlainTextContent (shared_ptr film, boost::filesystem::path path) +PlainTextFileContent::PlainTextFileContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) { subtitle.reset (new TextContent (this)); } -PlainTextContent::PlainTextContent (shared_ptr film, cxml::ConstNodePtr node, int version) +PlainTextFileContent::PlainTextFileContent (shared_ptr film, cxml::ConstNodePtr node, int version) : Content (film, node) , _length (node->number_child ("Length")) { @@ -49,10 +49,10 @@ PlainTextContent::PlainTextContent (shared_ptr film, cxml::ConstNode } void -PlainTextContent::examine (boost::shared_ptr job) +PlainTextFileContent::examine (boost::shared_ptr job) { Content::examine (job); - PlainText s (shared_from_this ()); + PlainTextFile s (shared_from_this ()); /* Default to turning these subtitles on */ subtitle->set_use (true); @@ -63,19 +63,19 @@ PlainTextContent::examine (boost::shared_ptr job) } string -PlainTextContent::summary () const +PlainTextFileContent::summary () const { return path_summary() + " " + _("[subtitles]"); } string -PlainTextContent::technical_summary () const +PlainTextFileContent::technical_summary () const { return Content::technical_summary() + " - " + _("Text subtitles"); } void -PlainTextContent::as_xml (xmlpp::Node* node, bool with_paths) const +PlainTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const { node->add_child("Type")->add_child_text ("TextSubtitle"); Content::as_xml (node, with_paths); @@ -88,7 +88,7 @@ PlainTextContent::as_xml (xmlpp::Node* node, bool with_paths) const } DCPTime -PlainTextContent::full_length () const +PlainTextFileContent::full_length () const { FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate ()); return DCPTime (_length, frc); diff --git a/src/lib/plain_text_content.h b/src/lib/plain_text_file_content.h similarity index 66% rename from src/lib/plain_text_content.h rename to src/lib/plain_text_file_content.h index 02b4596ed..603931e4c 100644 --- a/src/lib/plain_text_content.h +++ b/src/lib/plain_text_file_content.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2016 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -22,17 +22,17 @@ class Job; -/** @class PlainText - * @brief SubRip or SSA subtitles. +/** @class PlainTextFileContent + * @brief A SubRip, SSA or ASS file. */ -class PlainTextContent : public Content +class PlainTextFileContent : public Content { public: - PlainTextContent (boost::shared_ptr, boost::filesystem::path); - PlainTextContent (boost::shared_ptr, cxml::ConstNodePtr, int); + PlainTextFileContent (boost::shared_ptr, boost::filesystem::path); + PlainTextFileContent (boost::shared_ptr, cxml::ConstNodePtr, int); - boost::shared_ptr shared_from_this () { - return boost::dynamic_pointer_cast (Content::shared_from_this ()); + boost::shared_ptr shared_from_this () { + return boost::dynamic_pointer_cast (Content::shared_from_this ()); } void examine (boost::shared_ptr); diff --git a/src/lib/plain_text_decoder.cc b/src/lib/plain_text_file_decoder.cc similarity index 81% rename from src/lib/plain_text_decoder.cc rename to src/lib/plain_text_file_decoder.cc index 005d30669..40a605963 100644 --- a/src/lib/plain_text_decoder.cc +++ b/src/lib/plain_text_file_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2016 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -18,9 +18,10 @@ */ -#include "plain_text_decoder.h" -#include "plain_text_content.h" +#include "plain_text_file_decoder.h" +#include "plain_text_file_content.h" #include "text_content.h" +#include "text_decoder.h" #include #include #include @@ -34,8 +35,8 @@ using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; -PlainTextDecoder::PlainTextDecoder (shared_ptr content, shared_ptr log) - : PlainText (content) +PlainTextFileDecoder::PlainTextFileDecoder (shared_ptr content, shared_ptr log) + : PlainTextFile (content) , _next (0) { ContentTime first; @@ -46,7 +47,7 @@ PlainTextDecoder::PlainTextDecoder (shared_ptr content, } void -PlainTextDecoder::seek (ContentTime time, bool accurate) +PlainTextFileDecoder::seek (ContentTime time, bool accurate) { /* It's worth back-tracking a little here as decoding is cheap and it's nice if we don't miss too many subtitles when seeking. @@ -65,7 +66,7 @@ PlainTextDecoder::seek (ContentTime time, bool accurate) } bool -PlainTextDecoder::pass () +PlainTextFileDecoder::pass () { if (_next >= _subtitles.size ()) { return true; @@ -79,7 +80,7 @@ PlainTextDecoder::pass () } ContentTimePeriod -PlainTextDecoder::content_time_period (sub::Subtitle s) const +PlainTextFileDecoder::content_time_period (sub::Subtitle s) const { return ContentTimePeriod ( ContentTime::from_seconds (s.from.all_as_seconds()), diff --git a/src/lib/plain_text_decoder.h b/src/lib/plain_text_file_decoder.h similarity index 68% rename from src/lib/plain_text_decoder.h rename to src/lib/plain_text_file_decoder.h index f11fe3eab..ea64a294b 100644 --- a/src/lib/plain_text_decoder.h +++ b/src/lib/plain_text_file_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2016 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,19 @@ */ -#ifndef DCPOMATIC_TEXT_SUBTITLE_DECODER_H -#define DCPOMATIC_TEXT_SUBTITLE_DECODER_H +#ifndef DCPOMATIC_PLAIN_TEXT_FILE_DECODER_H +#define DCPOMATIC_PLAIN_TEXT_FILE_DECODER_H -#include "text_decoder.h" -#include "plain_text.h" +#include "plain_text_file.h" +#include "decoder.h" -class PlainText; +class PlainTextFileContent; +class Log; -class PlainTextDecoder : public Decoder, public PlainText +class PlainTextFileDecoder : public Decoder, public PlainTextFile { public: - PlainTextDecoder (boost::shared_ptr, boost::shared_ptr log); + PlainTextFileDecoder (boost::shared_ptr, boost::shared_ptr log); void seek (ContentTime time, bool accurate); bool pass (); diff --git a/src/lib/wscript b/src/lib/wscript index dd7c87f39..9e2d07d7c 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -134,9 +134,9 @@ sources = """ string_log_entry.cc text_content.cc text_decoder.cc - plain_text.cc - plain_text_content.cc - plain_text_decoder.cc + plain_text_file.cc + plain_text_file_content.cc + plain_text_file_decoder.cc timer.cc transcode_job.cc types.cc diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 8a24b2170..70364106c 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -39,8 +39,8 @@ #include "lib/config.h" #include "lib/log.h" #include "lib/compose.hpp" -#include "lib/plain_text_content.h" -#include "lib/plain_text.h" +#include "lib/plain_text_file_content.h" +#include "lib/plain_text_file.h" #include #include #include @@ -258,11 +258,11 @@ ContentPanel::selection_changed () BOOST_FOREACH (shared_ptr i, selected ()) { DCPTime p; p = i->position(); - if (dynamic_pointer_cast(i) && i->paths_valid()) { + if (dynamic_pointer_cast(i) && i->paths_valid()) { /* Rather special case; if we select a text subtitle file jump to its first subtitle. */ - PlainText ts (dynamic_pointer_cast(i)); + PlainTextFile ts (dynamic_pointer_cast(i)); if (ts.first()) { p += DCPTime(ts.first().get(), _film->active_frame_rate_change(i->position())); } diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc index eb13a8f27..77109909f 100644 --- a/src/wx/subtitle_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -20,7 +20,7 @@ #include "subtitle_appearance_dialog.h" #include "rgba_colour_picker.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/text_content.h" #include "lib/ffmpeg_subtitle_stream.h" #include "lib/ffmpeg_content.h" diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 3308f40e9..84c02c428 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -26,10 +26,10 @@ #include "fonts_dialog.h" #include "subtitle_appearance_dialog.h" #include "lib/ffmpeg_content.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/ffmpeg_subtitle_stream.h" #include "lib/dcp_text_content.h" -#include "lib/plain_text_decoder.h" +#include "lib/plain_text_file_decoder.h" #include "lib/dcp_text_decoder.h" #include "lib/dcp_content.h" #include "lib/text_content.h" @@ -265,7 +265,7 @@ SubtitlePanel::setup_sensitivity () BOOST_FOREACH (shared_ptr i, sel) { /* These are the content types that could include subtitles */ shared_ptr fc = boost::dynamic_pointer_cast (i); - shared_ptr sc = boost::dynamic_pointer_cast (i); + shared_ptr sc = boost::dynamic_pointer_cast (i); shared_ptr dc = boost::dynamic_pointer_cast (i); shared_ptr dsc = boost::dynamic_pointer_cast (i); if (fc) { diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc index a3d06106c..b2e74eb88 100644 --- a/src/wx/subtitle_view.cc +++ b/src/wx/subtitle_view.cc @@ -18,13 +18,14 @@ */ -#include "lib/plain_text_decoder.h" +#include "lib/plain_text_file_decoder.h" #include "lib/content_text.h" #include "lib/video_decoder.h" #include "lib/audio_decoder.h" #include "lib/film.h" #include "lib/config.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" +#include "lib/text_decoder.h" #include "subtitle_view.h" #include "film_viewer.h" #include "wx_util.h" diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 67a659685..93ac02784 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -29,7 +29,7 @@ #include "lib/text_content.h" #include "lib/dcp_text_content.h" #include "lib/audio_content.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/video_content.h" #include #include diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index e579621c6..00ca976e0 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -24,7 +24,7 @@ #include "lib/image_content.h" #include "lib/video_content.h" #include "lib/audio_content.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/ratio.h" #include "lib/transcode_job.h" #include "lib/dcp_content.h" @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6) film->set_container (Ratio::from_id ("185")); film->set_audio_channels (6); - shared_ptr s (new PlainTextContent (film, "test/data/subrip2.srt")); + shared_ptr s (new PlainTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->subtitle->set_colour (dcp::Colour (255, 255, 0)); @@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7) film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr s (new PlainTextContent (film, "test/data/subrip.srt")); + shared_ptr s (new PlainTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->subtitle->set_colour (dcp::Colour (255, 255, 0)); @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2) film->set_container (Ratio::from_id ("185")); film->set_audio_channels (6); - shared_ptr s (new PlainTextContent (film, "test/data/subrip2.srt")); + shared_ptr s (new PlainTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->subtitle->set_colour (dcp::Colour (255, 255, 0)); @@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3) film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr s (new PlainTextContent (film, "test/data/subrip.srt")); + shared_ptr s (new PlainTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->subtitle->set_colour (dcp::Colour (255, 255, 0)); diff --git a/test/player_test.cc b/test/player_test.cc index 7cc3bc27b..a66860911 100644 --- a/test/player_test.cc +++ b/test/player_test.cc @@ -31,7 +31,7 @@ #include "lib/player.h" #include "lib/video_content.h" #include "lib/image_content.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/content_factory.h" #include "lib/dcp_content.h" #include "lib/text_content.h" @@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE (player_interleave_test) film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr s (new PlainTextContent (film, "test/data/subrip.srt")); + shared_ptr s (new PlainTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); diff --git a/test/reels_test.cc b/test/reels_test.cc index 70552a703..9a915ab2b 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -30,7 +30,7 @@ #include "lib/dcp_content_type.h" #include "lib/dcp_content.h" #include "lib/video_content.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/content_factory.h" #include "test.h" #include @@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE (reels_test3) shared_ptr dcp (new DCPContent (film, "test/data/reels_test2")); film->examine_and_add_content (dcp); - shared_ptr sub (new PlainTextContent (film, "test/data/subrip.srt")); + shared_ptr sub (new PlainTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (sub); wait_for_jobs (); @@ -206,7 +206,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) content[i]->video->set_length (24); } - shared_ptr subs (new PlainTextContent (film, "test/data/subrip3.srt")); + shared_ptr subs (new PlainTextFileContent (film, "test/data/subrip3.srt")); film->examine_and_add_content (subs); wait_for_jobs (); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index e44e33c14..268da3472 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -24,7 +24,7 @@ */ #include "lib/film.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/dcp_content_type.h" #include "lib/font.h" #include "lib/ratio.h" @@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test) film->set_name ("frobozz"); film->set_audio_channels (6); film->set_interop (false); - shared_ptr content (new PlainTextContent (film, "test/data/subrip2.srt")); + shared_ptr content (new PlainTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2) film->set_name ("frobozz"); film->set_audio_channels (6); film->set_interop (false); - shared_ptr content (new PlainTextContent (film, "test/data/subrip2.srt")); + shared_ptr content (new PlainTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3) film->set_name ("frobozz"); film->set_interop (true); film->set_audio_channels (6); - shared_ptr content (new PlainTextContent (film, private_data / "Ankoemmling_short.srt")); + shared_ptr content (new PlainTextFileContent (film, private_data / "Ankoemmling_short.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test4) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (false); - shared_ptr content (new PlainTextContent (film, "test/data/subrip2.srt")); + shared_ptr content (new PlainTextFileContent (film, "test/data/subrip2.srt")); content->subtitle->set_use (true); content->subtitle->set_burn (false); film->examine_and_add_content (content); @@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test5) film->set_name ("frobozz"); film->set_interop (true); film->set_sequence (false); - shared_ptr content (new PlainTextContent (film, "test/data/subrip2.srt")); + shared_ptr content (new PlainTextFileContent (film, "test/data/subrip2.srt")); content->subtitle->set_use (true); content->subtitle->set_burn (false); film->examine_and_add_content (content); @@ -164,7 +164,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6) { shared_ptr film = new_test_film2 ("srt_subtitle_test6"); film->set_interop (false); - shared_ptr content (new PlainTextContent (film, "test/data/frames.srt")); + shared_ptr content (new PlainTextFileContent (film, "test/data/frames.srt")); content->subtitle->set_use (true); content->subtitle->set_burn (false); film->examine_and_add_content (content); @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6) BOOST_AUTO_TEST_CASE (srt_subtitle_test4) { shared_ptr film = new_test_film ("subrip_render_test"); - shared_ptr content (new PlainText (film, "test/data/subrip.srt")); + shared_ptr<PlainTextFile> content (new PlainTextFile (film, "test/data/subrip.srt")); content->examine (shared_ptr<Job> (), true); BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471)); diff --git a/test/ssa_subtitle_test.cc b/test/ssa_subtitle_test.cc index ab15af139..536a3ce6a 100644 --- a/test/ssa_subtitle_test.cc +++ b/test/ssa_subtitle_test.cc @@ -24,7 +24,7 @@ */ #include "lib/film.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/dcp_content_type.h" #include "lib/font.h" #include "lib/ratio.h" @@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (true); - shared_ptr<PlainTextContent> content (new PlainTextContent (film, private_data / "DKH_UT_EN20160601def.ssa")); + shared_ptr<PlainTextFileContent> content (new PlainTextFileContent (film, private_data / "DKH_UT_EN20160601def.ssa")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/subtitle_charset_test.cc b/test/subtitle_charset_test.cc index 2b1b97b25..892ea76f5 100644 --- a/test/subtitle_charset_test.cc +++ b/test/subtitle_charset_test.cc @@ -22,8 +22,8 @@ #include "lib/content.h" #include "lib/film.h" #include "lib/content_factory.h" -#include "lib/plain_text.h" -#include "lib/plain_text_content.h" +#include "lib/plain_text_file.h" +#include "lib/plain_text_file_content.h" #include <boost/test/unit_test.hpp> using boost::shared_ptr; @@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (subtitle_charset_test2) shared_ptr<Content> content = content_factory (film, "test/data/osx.srt").front (); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr<PlainText> ts = dynamic_pointer_cast<PlainText> (content); + shared_ptr<PlainTextFile> ts = dynamic_pointer_cast<PlainTextFile> (content); BOOST_REQUIRE (ts); /* Make sure we got the subtitle data from the file */ BOOST_REQUIRE_EQUAL (content->full_length().get(), 6052032); diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc index 317f93ff5..ee9c8ecc7 100644 --- a/test/subtitle_reel_number_test.cc +++ b/test/subtitle_reel_number_test.cc @@ -18,7 +18,7 @@ */ -#include "lib/plain_text_content.h" +#include "lib/plain_text_file_content.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/text_content.h" @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr<PlainTextContent> content (new PlainTextContent (film, "test/data/subrip5.srt")); + shared_ptr<PlainTextFileContent> content (new PlainTextFileContent (film, "test/data/subrip5.srt")); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); content->subtitle->set_use (true); -- 2.30.2