summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/equality_options.h8
-rw-r--r--src/exceptions.cc4
-rw-r--r--src/exceptions.h4
-rw-r--r--src/interop_text_asset.cc25
-rw-r--r--src/smpte_text_asset.cc61
-rw-r--r--src/smpte_text_asset.h10
-rw-r--r--src/text.cc (renamed from src/subtitle.cc)30
-rw-r--r--src/text.h (renamed from src/subtitle.h)20
-rw-r--r--src/text_asset.cc91
-rw-r--r--src/text_asset.h30
-rw-r--r--src/text_asset_internal.cc4
-rw-r--r--src/text_asset_internal.h4
-rw-r--r--src/text_image.cc (renamed from src/subtitle_image.cc)52
-rw-r--r--src/text_image.h (renamed from src/subtitle_image.h)28
-rw-r--r--src/text_string.cc (renamed from src/subtitle_string.cc)50
-rw-r--r--src/text_string.h (renamed from src/subtitle_string.h)25
-rw-r--r--src/types.h6
-rw-r--r--src/verify.cc8
-rw-r--r--src/wscript12
-rw-r--r--test/combine_test.cc4
-rw-r--r--test/decryption_test.cc2
-rw-r--r--test/interop_subtitle_test.cc142
-rw-r--r--test/kdm_test.cc2
-rw-r--r--test/shared_subtitle_test.cc4
-rw-r--r--test/smpte_subtitle_test.cc72
-rw-r--r--test/test.cc14
-rw-r--r--test/test.h4
-rw-r--r--test/verify_test.cc20
-rw-r--r--tools/dcpdiff.cc2
-rw-r--r--tools/dcpinfo.cc10
30 files changed, 373 insertions, 375 deletions
diff --git a/src/equality_options.h b/src/equality_options.h
index 1c29be7e..1e890a09 100644
--- a/src/equality_options.h
+++ b/src/equality_options.h
@@ -77,10 +77,10 @@ public:
bool load_font_nodes_can_differ = false;
bool sound_assets_can_differ = false;
bool keep_going = false;
- /** true to save the last pair of different image subtitles to the current working directory */
- bool export_differing_subtitles = false;
- /** The maximum allowable absolute difference between the vertical position of subtitles */
- float max_subtitle_vertical_position_error = 0;
+ /** true to save the last pair of different image subtitles/captions to the current working directory */
+ bool export_differing_texts = false;
+ /** The maximum allowable absolute difference between the vertical position of texts */
+ float max_text_vertical_position_error = 0;
};
diff --git a/src/exceptions.cc b/src/exceptions.cc
index 9c57011d..4420125c 100644
--- a/src/exceptions.cc
+++ b/src/exceptions.cc
@@ -121,8 +121,8 @@ ReadError::ReadError (string message, string detail)
}
-MissingSubtitleImageError::MissingSubtitleImageError (string id)
- : runtime_error (String::compose("Could not load image for subtitle %1", id))
+MissingTextImageError::MissingTextImageError (string id)
+ : runtime_error (String::compose("Could not load image for subtitle/caption %1", id))
{
}
diff --git a/src/exceptions.h b/src/exceptions.h
index 3858b763..145df25f 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -259,10 +259,10 @@ public:
};
-class MissingSubtitleImageError : public std::runtime_error
+class MissingTextImageError : public std::runtime_error
{
public:
- MissingSubtitleImageError (std::string id);
+ MissingTextImageError (std::string id);
};
diff --git a/src/interop_text_asset.cc b/src/interop_text_asset.cc
index 31d00712..e9d94bc8 100644
--- a/src/interop_text_asset.cc
+++ b/src/interop_text_asset.cc
@@ -47,7 +47,7 @@
#include "interop_text_asset.h"
#include "raw_convert.h"
#include "text_asset_internal.h"
-#include "subtitle_image.h"
+#include "text_image.h"
#include "util.h"
#include "warnings.h"
#include "xml.h"
@@ -89,12 +89,12 @@ InteropTextAsset::InteropTextAsset(boost::filesystem::path file)
for (auto i: xml->node()->get_children()) {
auto e = dynamic_cast<xmlpp::Element const *>(i);
if (e && (e->get_name() == "Font" || e->get_name() == "Subtitle")) {
- parse_subtitles (e, ps, optional<int>(), Standard::INTEROP);
+ parse_texts (e, ps, optional<int>(), Standard::INTEROP);
}
}
- for (auto i: _subtitles) {
- auto si = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _texts) {
+ auto si = dynamic_pointer_cast<TextImage>(i);
if (si) {
si->read_png_file (file.parent_path() / String::compose("%1.png", si->id()));
}
@@ -126,7 +126,7 @@ InteropTextAsset::xml_as_string() const
load_font->set_attribute ("URI", i->uri);
}
- subtitles_as_xml (root, 250, Standard::INTEROP);
+ texts_as_xml(root, 250, Standard::INTEROP);
return format_xml(doc, {});
}
@@ -174,7 +174,7 @@ InteropTextAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions co
}
if (_movie_title != other->_movie_title) {
- note (NoteType::ERROR, "Subtitle movie titles differ");
+ note (NoteType::ERROR, "Subtitle or caption movie titles differ");
return false;
}
@@ -206,9 +206,8 @@ InteropTextAsset::write(boost::filesystem::path p) const
_file = p;
/* Image subtitles */
- for (auto i: _subtitles) {
- auto im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
- if (im) {
+ for (auto i: _texts) {
+ if (auto im = dynamic_pointer_cast<dcp::TextImage>(i)) {
im->write_png_file(p.parent_path() / String::compose("%1.png", im->id()));
}
}
@@ -284,8 +283,8 @@ InteropTextAsset::add_to_assetmap(AssetMap& asset_map, boost::filesystem::path r
{
Asset::add_to_assetmap(asset_map, root);
- for (auto i: _subtitles) {
- auto im = dynamic_pointer_cast<dcp::SubtitleImage>(i);
+ for (auto i: _texts) {
+ auto im = dynamic_pointer_cast<dcp::TextImage>(i);
if (im) {
DCP_ASSERT(im->file());
add_file_to_assetmap(asset_map, root, im->file().get(), im->id());
@@ -299,8 +298,8 @@ InteropTextAsset::add_to_pkl(shared_ptr<PKL> pkl, boost::filesystem::path root)
{
Asset::add_to_pkl (pkl, root);
- for (auto i: _subtitles) {
- auto im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
+ for (auto i: _texts) {
+ auto im = dynamic_pointer_cast<dcp::TextImage>(i);
if (im) {
auto png_image = im->png_image ();
pkl->add_asset(im->id(), optional<string>(), make_digest(png_image), png_image.size(), "image/png", root.filename().string());
diff --git a/src/smpte_text_asset.cc b/src/smpte_text_asset.cc
index 987715cb..f92a091a 100644
--- a/src/smpte_text_asset.cc
+++ b/src/smpte_text_asset.cc
@@ -46,7 +46,7 @@
#include "raw_convert.h"
#include "smpte_load_font_node.h"
#include "smpte_text_asset.h"
-#include "subtitle_image.h"
+#include "text_image.h"
#include "util.h"
#include "warnings.h"
#include "xml.h"
@@ -140,8 +140,8 @@ SMPTETextAsset::SMPTETextAsset(boost::filesystem::path file)
/* Try to read PNG files from the same folder that the XML is in; the wisdom of this is
debatable, at best...
*/
- for (auto i: _subtitles) {
- auto im = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _texts) {
+ auto im = dynamic_pointer_cast<TextImage>(i);
if (im && im->png_image().size() == 0) {
/* Even more dubious; allow <id>.png or urn:uuid:<id>.png */
auto p = file.parent_path() / String::compose("%1.png", im->id());
@@ -159,10 +159,10 @@ SMPTETextAsset::SMPTETextAsset(boost::filesystem::path file)
}
/* Check that all required image data have been found */
- for (auto i: _subtitles) {
- auto im = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _texts) {
+ auto im = dynamic_pointer_cast<TextImage>(i);
if (im && im->png_image().size() == 0) {
- throw MissingSubtitleImageError (im->id());
+ throw MissingTextImageError (im->id());
}
}
}
@@ -212,12 +212,12 @@ SMPTETextAsset::parse_xml(shared_ptr<cxml::Document> xml)
for (auto i: xml->node()->get_children()) {
auto const e = dynamic_cast<xmlpp::Element const *>(i);
if (e && e->get_name() == "SubtitleList") {
- parse_subtitles (e, ps, _time_code_rate, Standard::SMPTE);
+ parse_texts(e, ps, _time_code_rate, Standard::SMPTE);
}
}
/* Guess intrinsic duration */
- _intrinsic_duration = latest_subtitle_out().as_editable_units_ceil(_edit_rate.numerator / _edit_rate.denominator);
+ _intrinsic_duration = latest_text_out().as_editable_units_ceil(_edit_rate.numerator / _edit_rate.denominator);
}
@@ -266,13 +266,13 @@ SMPTETextAsset::read_mxf_resources(shared_ptr<ASDCP::TimedText::MXFReader> reade
}
case ASDCP::TimedText::MT_PNG:
{
- auto j = _subtitles.begin();
- while (j != _subtitles.end() && ((!dynamic_pointer_cast<SubtitleImage>(*j)) || dynamic_pointer_cast<SubtitleImage>(*j)->id() != id)) {
+ auto j = _texts.begin();
+ while (j != _texts.end() && ((!dynamic_pointer_cast<TextImage>(*j)) || dynamic_pointer_cast<TextImage>(*j)->id() != id)) {
++j;
}
- if (j != _subtitles.end()) {
- dynamic_pointer_cast<SubtitleImage>(*j)->set_png_image(ArrayData(buffer.RoData(), buffer.Size()));
+ if (j != _texts.end()) {
+ dynamic_pointer_cast<TextImage>(*j)->set_png_image(ArrayData(buffer.RoData(), buffer.Size()));
}
break;
}
@@ -396,7 +396,7 @@ SMPTETextAsset::xml_as_string() const
load_font->set_attribute ("ID", i->id);
}
- subtitles_as_xml(cxml::add_child(root, "SubtitleList"), _time_code_rate, Standard::SMPTE);
+ texts_as_xml(cxml::add_child(root, "SubtitleList"), _time_code_rate, Standard::SMPTE);
return format_xml(doc, std::make_pair(string{}, schema_namespace()));
}
@@ -433,8 +433,8 @@ SMPTETextAsset::write(boost::filesystem::path p) const
/* Image subtitle references */
- for (auto i: _subtitles) {
- auto si = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _texts) {
+ auto si = dynamic_pointer_cast<TextImage>(i);
if (si) {
ASDCP::TimedText::TimedTextResourceDescriptor res;
unsigned int c;
@@ -456,7 +456,7 @@ SMPTETextAsset::write(boost::filesystem::path p) const
/* This header size is a guess. Empirically it seems that each subtitle reference is 90 bytes, and we need some extra.
The default size is not enough for some feature-length PNG sub projects (see DCP-o-matic #1561).
*/
- ASDCP::Result_t r = writer.OpenWrite(dcp::filesystem::fix_long_path(p).string().c_str(), writer_info, descriptor, _subtitles.size() * 90 + 16384);
+ ASDCP::Result_t r = writer.OpenWrite(dcp::filesystem::fix_long_path(p).string().c_str(), writer_info, descriptor, _texts.size() * 90 + 16384);
if (ASDCP_FAILURE (r)) {
boost::throw_exception (FileError ("could not open subtitle MXF for writing", p.string(), r));
}
@@ -489,9 +489,8 @@ SMPTETextAsset::write(boost::filesystem::path p) const
/* Image subtitle payload */
- for (auto i: _subtitles) {
- auto si = dynamic_pointer_cast<SubtitleImage>(i);
- if (si) {
+ for (auto i: _texts) {
+ if (auto si = dynamic_pointer_cast<TextImage>(i)) {
ASDCP::TimedText::FrameBuffer buffer;
buffer.SetData (si->png_image().data(), si->png_image().size());
buffer.Size (si->png_image().size());
@@ -516,7 +515,7 @@ SMPTETextAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions cons
auto other = dynamic_pointer_cast<const SMPTETextAsset>(other_asset);
if (!other) {
- note (NoteType::ERROR, "Subtitles are in different standards");
+ note (NoteType::ERROR, "Subtitles/captions are in different standards");
return false;
}
@@ -539,46 +538,46 @@ SMPTETextAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions cons
}
if (_content_title_text != other->_content_title_text) {
- note (NoteType::ERROR, "Subtitle content title texts differ");
+ note (NoteType::ERROR, "Subtitle/caption content title texts differ");
return false;
}
if (_language != other->_language) {
- note (NoteType::ERROR, String::compose("Subtitle languages differ (`%1' vs `%2')", _language.get_value_or("[none]"), other->_language.get_value_or("[none]")));
+ note (NoteType::ERROR, String::compose("Subtitle/caption languages differ (`%1' vs `%2')", _language.get_value_or("[none]"), other->_language.get_value_or("[none]")));
return false;
}
if (_annotation_text != other->_annotation_text) {
- note (NoteType::ERROR, "Subtitle annotation texts differ");
+ note (NoteType::ERROR, "Subtitle/caption annotation texts differ");
return false;
}
if (_issue_date != other->_issue_date) {
if (options.issue_dates_can_differ) {
- note (NoteType::NOTE, "Subtitle issue dates differ");
+ note (NoteType::NOTE, "Subtitle/caption issue dates differ");
} else {
- note (NoteType::ERROR, "Subtitle issue dates differ");
+ note (NoteType::ERROR, "Subtitle/caption issue dates differ");
return false;
}
}
if (_reel_number != other->_reel_number) {
- note (NoteType::ERROR, "Subtitle reel numbers differ");
+ note (NoteType::ERROR, "Subtitle/caption reel numbers differ");
return false;
}
if (_edit_rate != other->_edit_rate) {
- note (NoteType::ERROR, "Subtitle edit rates differ");
+ note (NoteType::ERROR, "Subtitle/caption edit rates differ");
return false;
}
if (_time_code_rate != other->_time_code_rate) {
- note (NoteType::ERROR, "Subtitle time code rates differ");
+ note (NoteType::ERROR, "Subtitle/caption time code rates differ");
return false;
}
if (_start_time != other->_start_time) {
- note (NoteType::ERROR, "Subtitle start times differ");
+ note (NoteType::ERROR, "Subtitle/caption start times differ");
return false;
}
@@ -596,10 +595,10 @@ SMPTETextAsset::add_font(string load_id, dcp::ArrayData data)
void
-SMPTETextAsset::add(shared_ptr<Subtitle> s)
+SMPTETextAsset::add(shared_ptr<Text> s)
{
TextAsset::add(s);
- _intrinsic_duration = latest_subtitle_out().as_editable_units_ceil(_edit_rate.numerator / _edit_rate.denominator);
+ _intrinsic_duration = latest_text_out().as_editable_units_ceil(_edit_rate.numerator / _edit_rate.denominator);
}
diff --git a/src/smpte_text_asset.h b/src/smpte_text_asset.h
index b5b95c5d..24665d3a 100644
--- a/src/smpte_text_asset.h
+++ b/src/smpte_text_asset.h
@@ -70,7 +70,7 @@ class SMPTELoadFontNode;
/** @class SMPTETextAsset
- * @brief A set of subtitles to be read and/or written in the SMPTE format
+ * @brief A set of subtitles/captions to be read and/or written in the SMPTE format
*/
class SMPTETextAsset : public TextAsset, public MXF
{
@@ -95,7 +95,7 @@ public:
/** Write this content to a MXF file */
void write (boost::filesystem::path path) const override;
- void add (std::shared_ptr<Subtitle>) override;
+ void add(std::shared_ptr<Text>) override;
void add_font (std::string id, dcp::ArrayData data) override;
void set_key (Key key) override;
@@ -135,7 +135,7 @@ public:
return _intrinsic_duration;
}
- /** @return title of the film that these subtitles are for,
+ /** @return title of the film that these subtitles/captions are for,
* to be presented to the user
*/
std::string content_title_text () const {
@@ -167,8 +167,8 @@ public:
return _edit_rate;
}
- /** @return subdivision of 1 second that is used for subtitle times;
- * e.g. a time_code_rate of 250 means that a subtitle time of 0:0:0:001
+ /** @return subdivision of 1 second that is used for text times;
+ * e.g. a time_code_rate of 250 means that a text time of 0:0:0:001
* represents 4ms.
*/
int time_code_rate () const override {
diff --git a/src/subtitle.cc b/src/text.cc
index 248d0cff..158af38c 100644
--- a/src/subtitle.cc
+++ b/src/text.cc
@@ -32,15 +32,15 @@
*/
-/** @file src/subtitle.cc
- * @brief Subtitle class
+/** @file src/text.cc
+ * @brief Text class
*/
#include "compose.hpp"
#include "dcp_time.h"
#include "equality_options.h"
-#include "subtitle.h"
+#include "text.h"
using std::shared_ptr;
@@ -48,7 +48,7 @@ using namespace dcp;
/** @param v_position Vertical position as a fraction of the screen height (between 0 and 1) from v_align */
-Subtitle::Subtitle (
+Text::Text(
Time in,
Time out,
float h_position,
@@ -74,56 +74,56 @@ Subtitle::Subtitle (
bool
-Subtitle::equals(shared_ptr<const Subtitle> other, EqualityOptions const& options, NoteHandler note) const
+Text::equals(shared_ptr<const Text> other, EqualityOptions const& options, NoteHandler note) const
{
bool same = true;
if (in() != other->in()) {
- note(NoteType::ERROR, "subtitle in times differ");
+ note(NoteType::ERROR, "text in times differ");
same = false;
}
if (out() != other->out()) {
- note(NoteType::ERROR, "subtitle out times differ");
+ note(NoteType::ERROR, "text out times differ");
same = false;
}
if (h_position() != other->h_position()) {
- note(NoteType::ERROR, "subtitle horizontal positions differ");
+ note(NoteType::ERROR, "text horizontal positions differ");
same = false;
}
if (h_align() != other->h_align()) {
- note(NoteType::ERROR, "subtitle horizontal alignments differ");
+ note(NoteType::ERROR, "text horizontal alignments differ");
same = false;
}
auto const vpos = std::abs(v_position() - other->v_position());
- if (vpos > options.max_subtitle_vertical_position_error) {
+ if (vpos > options.max_text_vertical_position_error) {
note(
NoteType::ERROR,
- String::compose("subtitle vertical positions differ by %1 (more than the allowed difference of %2)", vpos, options.max_subtitle_vertical_position_error)
+ String::compose("text vertical positions differ by %1 (more than the allowed difference of %2)", vpos, options.max_text_vertical_position_error)
);
same = false;
}
if (v_align() != other->v_align()) {
- note(NoteType::ERROR, "subtitle vertical alignments differ");
+ note(NoteType::ERROR, "text vertical alignments differ");
same = false;
}
if (z_position() != other->z_position()) {
- note(NoteType::ERROR, "subtitle Z positions differ");
+ note(NoteType::ERROR, "text Z positions differ");
same = false;
}
if (fade_up_time() != other->fade_up_time()) {
- note(NoteType::ERROR, "subtitle fade-up times differ");
+ note(NoteType::ERROR, "text fade-up times differ");
same = false;
}
if (fade_down_time() != other->fade_down_time()) {
- note(NoteType::ERROR, "subtitle fade-down times differ");
+ note(NoteType::ERROR, "text fade-down times differ");
same = false;
}
diff --git a/src/subtitle.h b/src/text.h
index 1ca3f9d4..b8f15757 100644
--- a/src/subtitle.h
+++ b/src/text.h
@@ -32,13 +32,13 @@
*/
-/** @file src/subtitle.h
- * @brief Subtitle class
+/** @file src/text.h
+ * @brief Text class
*/
-#ifndef LIBDCP_SUBTITLE_H
-#define LIBDCP_SUBTITLE_H
+#ifndef LIBDCP_TEXT_H
+#define LIBDCP_TEXT_H
#include "dcp_time.h"
@@ -52,17 +52,17 @@ namespace dcp {
class EqualityOptions;
-class Subtitle
+class Text
{
public:
- virtual ~Subtitle () {}
+ virtual ~Text() {}
- /** @return subtitle start time (relative to the start of the reel) */
+ /** @return text start time (relative to the start of the reel) */
Time in () const {
return _in;
}
- /** @return subtitle finish time (relative to the start of the reel) */
+ /** @return text finish time (relative to the start of the reel) */
Time out () const {
return _out;
}
@@ -130,11 +130,11 @@ public:
_fade_down_time = t;
}
- virtual bool equals(std::shared_ptr<const dcp::Subtitle> other, EqualityOptions const& options, NoteHandler note) const;
+ virtual bool equals(std::shared_ptr<const dcp::Text> other, EqualityOptions const& options, NoteHandler note) const;
protected:
- Subtitle (
+ Text(
Time in,
Time out,
float h_position,
diff --git a/src/text_asset.cc b/src/text_asset.cc
index 4ba3b623..ff662b69 100644
--- a/src/text_asset.cc
+++ b/src/text_asset.cc
@@ -42,8 +42,8 @@
#include "load_font_node.h"
#include "raw_convert.h"
#include "reel_asset.h"
-#include "subtitle_image.h"
-#include "subtitle_string.h"
+#include "text_image.h"
+#include "text_string.h"
#include "text_asset.h"
#include "text_asset_internal.h"
#include "util.h"
@@ -276,7 +276,7 @@ TextAsset::fade_time(xmlpp::Element const * node, string name, optional<int> tcr
void
-TextAsset::parse_subtitles(xmlpp::Element const * node, vector<ParseState>& state, optional<int> tcr, Standard standard)
+TextAsset::parse_texts(xmlpp::Element const * node, vector<ParseState>& state, optional<int> tcr, Standard standard)
{
if (node->get_name() == "Font") {
state.push_back (font_node_state (node, standard));
@@ -366,7 +366,7 @@ TextAsset::parse_subtitles(xmlpp::Element const * node, vector<ParseState>& stat
/* Handle actual content e.g. text */
auto const v = dynamic_cast<xmlpp::ContentNode const *>(i);
if (v) {
- maybe_add_subtitle (v->get_content(), state, space_before, standard, rubies);
+ maybe_add_text(v->get_content(), state, space_before, standard, rubies);
space_before = 0;
}
@@ -383,7 +383,7 @@ TextAsset::parse_subtitles(xmlpp::Element const * node, vector<ParseState>& stat
}
space_before += raw_convert<float>(size);
} else if (e->get_name() != "Ruby") {
- parse_subtitles (e, state, tcr, standard);
+ parse_texts (e, state, tcr, standard);
}
}
}
@@ -393,7 +393,7 @@ TextAsset::parse_subtitles(xmlpp::Element const * node, vector<ParseState>& stat
void
-TextAsset::maybe_add_subtitle(
+TextAsset::maybe_add_text(
string text,
vector<ParseState> const & parse_state,
float space_before,
@@ -482,8 +482,8 @@ TextAsset::maybe_add_subtitle(
switch (ps.type.get()) {
case ParseState::Type::TEXT:
- _subtitles.push_back (
- make_shared<SubtitleString>(
+ _texts.push_back (
+ make_shared<TextString>(
ps.font_id,
ps.italic.get_value_or (false),
ps.bold.get_value_or (false),
@@ -530,9 +530,9 @@ TextAsset::maybe_add_subtitle(
break;
}
- /* Add a subtitle with no image data and we'll fill that in later */
- _subtitles.push_back (
- make_shared<SubtitleImage>(
+ /* Add a text with no image data and we'll fill that in later */
+ _texts.push_back(
+ make_shared<TextImage>(
ArrayData(),
text,
ps.in.get(),
@@ -552,22 +552,22 @@ TextAsset::maybe_add_subtitle(
}
-vector<shared_ptr<const Subtitle>>
-TextAsset::subtitles() const
+vector<shared_ptr<const Text>>
+TextAsset::texts() const
{
- vector<shared_ptr<const Subtitle>> s;
- for (auto i: _subtitles) {
+ vector<shared_ptr<const Text>> s;
+ for (auto i: _texts) {
s.push_back (i);
}
return s;
}
-vector<shared_ptr<const Subtitle>>
-TextAsset::subtitles_during(Time from, Time to, bool starting) const
+vector<shared_ptr<const Text>>
+TextAsset::texts_during(Time from, Time to, bool starting) const
{
- vector<shared_ptr<const Subtitle>> s;
- for (auto i: _subtitles) {
+ vector<shared_ptr<const Text>> s;
+ for (auto i: _texts) {
if ((starting && from <= i->in() && i->in() < to) || (!starting && i->out() >= from && i->in() <= to)) {
s.push_back (i);
}
@@ -578,17 +578,17 @@ TextAsset::subtitles_during(Time from, Time to, bool starting) const
void
-TextAsset::add(shared_ptr<Subtitle> s)
+TextAsset::add(shared_ptr<Text> s)
{
- _subtitles.push_back (s);
+ _texts.push_back(s);
}
Time
-TextAsset::latest_subtitle_out() const
+TextAsset::latest_text_out() const
{
Time t;
- for (auto i: _subtitles) {
+ for (auto i: _texts) {
if (i->out() > t) {
t = i->out ();
}
@@ -610,22 +610,22 @@ TextAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions const& op
return false;
}
- if (_subtitles.size() != other->_subtitles.size()) {
- note (NoteType::ERROR, String::compose("different number of subtitles: %1 vs %2", _subtitles.size(), other->_subtitles.size()));
+ if (_texts.size() != other->_texts.size()) {
+ note (NoteType::ERROR, String::compose("different number of texts: %1 vs %2", _texts.size(), other->_texts.size()));
return false;
}
- auto i = _subtitles.begin();
- auto j = other->_subtitles.begin();
+ auto i = _texts.begin();
+ auto j = other->_texts.begin();
- while (i != _subtitles.end()) {
- auto string_i = dynamic_pointer_cast<SubtitleString> (*i);
- auto string_j = dynamic_pointer_cast<SubtitleString> (*j);
- auto image_i = dynamic_pointer_cast<SubtitleImage> (*i);
- auto image_j = dynamic_pointer_cast<SubtitleImage> (*j);
+ while (i != _texts.end()) {
+ auto string_i = dynamic_pointer_cast<TextString>(*i);
+ auto string_j = dynamic_pointer_cast<TextString>(*j);
+ auto image_i = dynamic_pointer_cast<TextImage>(*i);
+ auto image_j = dynamic_pointer_cast<TextImage>(*j);
if ((string_i && !string_j) || (image_i && !image_j)) {
- note (NoteType::ERROR, "subtitles differ: string vs. image");
+ note (NoteType::ERROR, "texts differ: string vs. image");
return false;
}
@@ -645,9 +645,9 @@ TextAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions const& op
}
-struct SubtitleSorter
+struct TextSorter
{
- bool operator() (shared_ptr<Subtitle> a, shared_ptr<Subtitle> b) {
+ bool operator()(shared_ptr<Text> a, shared_ptr<Text> b) {
if (a->in() != b->in()) {
return a->in() < b->in();
}
@@ -724,12 +724,12 @@ TextAsset::pull_fonts(shared_ptr<order::Part> part)
* class because the differences between the two are fairly subtle.
*/
void
-TextAsset::subtitles_as_xml(xmlpp::Element* xml_root, int time_code_rate, Standard standard) const
+TextAsset::texts_as_xml(xmlpp::Element* xml_root, int time_code_rate, Standard standard) const
{
- auto sorted = _subtitles;
- std::stable_sort(sorted.begin(), sorted.end(), SubtitleSorter());
+ auto sorted = _texts;
+ std::stable_sort(sorted.begin(), sorted.end(), TextSorter());
- /* Gather our subtitles into a hierarchy of Subtitle/Text/String objects, writing
+ /* Gather our texts into a hierarchy of Subtitle/Text/String objects, writing
font information into the bottom level (String) objects.
*/
@@ -766,7 +766,7 @@ TextAsset::subtitles_as_xml(xmlpp::Element* xml_root, int time_code_rate, Standa
text.reset ();
}
- auto is = dynamic_pointer_cast<SubtitleString>(i);
+ auto is = dynamic_pointer_cast<TextString>(i);
if (is) {
if (!text ||
last_h_align != is->h_align() ||
@@ -799,8 +799,7 @@ TextAsset::subtitles_as_xml(xmlpp::Element* xml_root, int time_code_rate, Standa
text->children.push_back (make_shared<order::String>(text, order::Font (is, standard), is->text(), is->space_before()));
}
- auto ii = dynamic_pointer_cast<SubtitleImage>(i);
- if (ii) {
+ if (auto ii = dynamic_pointer_cast<TextImage>(i)) {
text.reset ();
subtitle->children.push_back (
make_shared<order::Image>(subtitle, ii->id(), ii->png_image(), ii->h_align(), ii->h_position(), ii->v_align(), ii->v_position(), ii->z_position())
@@ -876,8 +875,8 @@ TextAsset::fix_empty_font_ids()
}
}
- for (auto i: _subtitles) {
- auto j = dynamic_pointer_cast<SubtitleString> (i);
+ for (auto i: _texts) {
+ auto j = dynamic_pointer_cast<TextString>(i);
if (j && j->font() && j->font().get() == "") {
j->set_font (empty_id);
}
@@ -957,8 +956,8 @@ format_xml_node (xmlpp::Node const* node, State& state)
/** Format XML much as write_to_string_formatted() would do, except without adding any white space
- * to <Text> nodes. This is an attempt to avoid changing what is actually displayed as subtitles
- * while also formatting the XML in such a way as to avoid DoM bug 2205.
+ * to <Text> nodes. This is an attempt to avoid changing what is actually displayed while also
+ * formatting the XML in such a way as to avoid DoM bug 2205.
*
* xml_namespace is an optional namespace for the root node; it would be nicer to set this up with
* set_namespace_declaration in the caller and then to extract it here but I couldn't find a way
diff --git a/src/text_asset.h b/src/text_asset.h
index e1cb48c7..4d739027 100644
--- a/src/text_asset.h
+++ b/src/text_asset.h
@@ -45,7 +45,7 @@
#include "asset.h"
#include "dcp_time.h"
#include "subtitle_standard.h"
-#include "subtitle_string.h"
+#include "text_string.h"
#include <libcxml/cxml.h>
#include <boost/shared_array.hpp>
#include <map>
@@ -70,13 +70,13 @@ struct pull_fonts_test3;
namespace dcp {
-class SubtitleString;
-class SubtitleImage;
class FontNode;
-class TextNode;
-class SubtitleNode;
class LoadFontNode;
class ReelAsset;
+class SubtitleNode;
+class TextImage;
+class TextNode;
+class TextString;
namespace order {
@@ -88,7 +88,7 @@ namespace order {
/** @class TextAsset
* @brief A parent for classes representing a file containing subtitles or captions
*
- * This class holds a list of Subtitle objects which it can extract
+ * This class holds a list of Text objects which it can extract
* from the appropriate part of either an Interop or SMPTE XML file.
* Its subclasses InteropTextAsset and SMPTETextAsset handle the
* differences between the two types.
@@ -105,10 +105,10 @@ public:
NoteHandler note
) const override;
- std::vector<std::shared_ptr<const Subtitle>> subtitles_during (Time from, Time to, bool starting) const;
- std::vector<std::shared_ptr<const Subtitle>> subtitles () const;
+ std::vector<std::shared_ptr<const Text>> texts_during(Time from, Time to, bool starting) const;
+ std::vector<std::shared_ptr<const Text>> texts() const;
- virtual void add (std::shared_ptr<Subtitle>);
+ virtual void add(std::shared_ptr<Text>);
virtual void add_font (std::string id, dcp::ArrayData data) = 0;
void ensure_font(std::string id, dcp::ArrayData data);
std::map<std::string, ArrayData> font_data () const;
@@ -117,7 +117,7 @@ public:
virtual void write (boost::filesystem::path) const = 0;
virtual std::string xml_as_string () const = 0;
- Time latest_subtitle_out () const;
+ Time latest_text_out() const;
void fix_empty_font_ids ();
@@ -169,7 +169,7 @@ protected:
float space_before = 0;
};
- void parse_subtitles (xmlpp::Element const * node, std::vector<ParseState>& state, boost::optional<int> tcr, Standard standard);
+ void parse_texts(xmlpp::Element const * node, std::vector<ParseState>& state, boost::optional<int> tcr, Standard standard);
ParseState font_node_state (xmlpp::Element const * node, Standard standard) const;
ParseState text_node_state (xmlpp::Element const * node) const;
ParseState image_node_state (xmlpp::Element const * node) const;
@@ -177,10 +177,10 @@ protected:
Time fade_time (xmlpp::Element const * node, std::string name, boost::optional<int> tcr) const;
void position_align (ParseState& ps, xmlpp::Element const * node) const;
- void subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Standard standard) const;
+ void texts_as_xml(xmlpp::Element* root, int time_code_rate, Standard standard) const;
- /** All our subtitles, in no particular order */
- std::vector<std::shared_ptr<Subtitle>> _subtitles;
+ /** All our texts, in no particular order */
+ std::vector<std::shared_ptr<Text>> _texts;
class Font
{
@@ -216,7 +216,7 @@ private:
friend struct ::pull_fonts_test2;
friend struct ::pull_fonts_test3;
- void maybe_add_subtitle(
+ void maybe_add_text(
std::string text,
std::vector<ParseState> const & parse_state,
float space_before,
diff --git a/src/text_asset_internal.cc b/src/text_asset_internal.cc
index 51821c78..aba26edd 100644
--- a/src/text_asset_internal.cc
+++ b/src/text_asset_internal.cc
@@ -38,7 +38,7 @@
#include "text_asset_internal.h"
-#include "subtitle_string.h"
+#include "text_string.h"
#include "compose.hpp"
#include <cmath>
@@ -49,7 +49,7 @@ using std::shared_ptr;
using namespace dcp;
-order::Font::Font (shared_ptr<SubtitleString> s, Standard standard)
+order::Font::Font(shared_ptr<TextString> s, Standard standard)
{
if (s->font()) {
if (standard == Standard::SMPTE) {
diff --git a/src/text_asset_internal.h b/src/text_asset_internal.h
index c8231219..ddbc8833 100644
--- a/src/text_asset_internal.h
+++ b/src/text_asset_internal.h
@@ -63,7 +63,7 @@ namespace dcp {
class Ruby;
-class SubtitleString;
+class TextString;
namespace order {
@@ -82,7 +82,7 @@ class Font
public:
Font () {}
- Font (std::shared_ptr<SubtitleString> s, Standard standard);
+ Font (std::shared_ptr<TextString> s, Standard standard);
xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const;
diff --git a/src/subtitle_image.cc b/src/text_image.cc
index 9340bc54..7a6c4222 100644
--- a/src/subtitle_image.cc
+++ b/src/text_image.cc
@@ -32,14 +32,14 @@
*/
-/** @file src/subtitle_image.cc
- * @brief SubtitleImage class
+/** @file src/text_image.cc
+ * @brief TextImage class
*/
#include "equality_options.h"
#include "filesystem.h"
-#include "subtitle_image.h"
+#include "text_image.h"
#include "util.h"
@@ -50,7 +50,7 @@ using std::string;
using namespace dcp;
-SubtitleImage::SubtitleImage (
+TextImage::TextImage(
ArrayData png_image,
Time in,
Time out,
@@ -62,7 +62,7 @@ SubtitleImage::SubtitleImage (
Time fade_up_time,
Time fade_down_time
)
- : Subtitle(in, out, h_position, h_align, v_position, v_align, z_position, fade_up_time, fade_down_time)
+ : Text(in, out, h_position, h_align, v_position, v_align, z_position, fade_up_time, fade_down_time)
, _png_image (png_image)
, _id (make_uuid ())
{
@@ -70,7 +70,7 @@ SubtitleImage::SubtitleImage (
}
-SubtitleImage::SubtitleImage (
+TextImage::TextImage(
ArrayData png_image,
string id,
Time in,
@@ -83,7 +83,7 @@ SubtitleImage::SubtitleImage (
Time fade_up_time,
Time fade_down_time
)
- : Subtitle(in, out, h_position, h_align, v_position, v_align, z_position, fade_up_time, fade_down_time)
+ : Text(in, out, h_position, h_align, v_position, v_align, z_position, fade_up_time, fade_down_time)
, _png_image (png_image)
, _id (id)
{
@@ -92,7 +92,7 @@ SubtitleImage::SubtitleImage (
void
-SubtitleImage::read_png_file (boost::filesystem::path file)
+TextImage::read_png_file(boost::filesystem::path file)
{
_file = file;
_png_image = ArrayData (file);
@@ -100,7 +100,7 @@ SubtitleImage::read_png_file (boost::filesystem::path file)
void
-SubtitleImage::write_png_file (boost::filesystem::path file) const
+TextImage::write_png_file(boost::filesystem::path file) const
{
_file = file;
png_image().write (file);
@@ -108,7 +108,7 @@ SubtitleImage::write_png_file (boost::filesystem::path file) const
bool
-dcp::operator== (SubtitleImage const & a, SubtitleImage const & b)
+dcp::operator==(TextImage const & a, TextImage const & b)
{
return (
a.png_image() == b.png_image() &&
@@ -127,36 +127,36 @@ dcp::operator== (SubtitleImage const & a, SubtitleImage const & b)
bool
-dcp::operator!= (SubtitleImage const & a, SubtitleImage const & b)
+dcp::operator!=(TextImage const & a, TextImage const & b)
{
return !(a == b);
}
bool
-SubtitleImage::equals(shared_ptr<const Subtitle> other_sub, EqualityOptions const& options, NoteHandler note) const
+TextImage::equals(shared_ptr<const Text> other_sub, EqualityOptions const& options, NoteHandler note) const
{
- if (!Subtitle::equals(other_sub, options, note)) {
+ if (!Text::equals(other_sub, options, note)) {
return false;
}
- auto other = dynamic_pointer_cast<const SubtitleImage>(other_sub);
+ auto other = dynamic_pointer_cast<const TextImage>(other_sub);
if (!other) {
- note(NoteType::ERROR, "Subtitle types differ: string vs image");
+ note(NoteType::ERROR, "Text types differ: string vs image");
return false;
}
if (png_image() != other->png_image()) {
- note (NoteType::ERROR, "subtitle image PNG data differs");
- if (options.export_differing_subtitles) {
- string const base = "dcpdiff_subtitle_";
+ note (NoteType::ERROR, "text image PNG data differs");
+ if (options.export_differing_texts) {
+ string const base = "dcpdiff_text_";
if (filesystem::exists(base + "A.png")) {
- note (NoteType::ERROR, "could not export subtitle as " + base + "A.png already exists");
+ note (NoteType::ERROR, "could not export text as " + base + "A.png already exists");
} else {
png_image().write(base + "A.png");
}
if (filesystem::exists(base + "B.png")) {
- note (NoteType::ERROR, "could not export subtitle as " + base + "B.png already exists");
+ note (NoteType::ERROR, "could not export text as " + base + "B.png already exists");
} else {
other->png_image().write(base + "B.png");
}
@@ -169,13 +169,13 @@ SubtitleImage::equals(shared_ptr<const Subtitle> other_sub, EqualityOptions cons
ostream&
-dcp::operator<< (ostream& s, SubtitleImage const & sub)
+dcp::operator<<(ostream& s, TextImage const& text)
{
- s << "\n[IMAGE] from " << sub.in() << " to " << sub.out() << ";\n"
- << "fade up " << sub.fade_up_time() << ", fade down " << sub.fade_down_time() << ";\n"
- << "v pos " << sub.v_position() << ", valign " << ((int) sub.v_align())
- << ", hpos " << sub.h_position() << ", halign " << ((int) sub.h_align())
- << ", zpos " << sub.z_position() << "\n";
+ s << "\n[IMAGE] from " << text.in() << " to " << text.out() << ";\n"
+ << "fade up " << text.fade_up_time() << ", fade down " << text.fade_down_time() << ";\n"
+ << "v pos " << text.v_position() << ", valign " << ((int) text.v_align())
+ << ", hpos " << text.h_position() << ", halign " << ((int) text.h_align())
+ << ", zpos " << text.z_position() << "\n";
return s;
}
diff --git a/src/subtitle_image.h b/src/text_image.h
index ae733fe4..1f1e464e 100644
--- a/src/subtitle_image.h
+++ b/src/text_image.h
@@ -32,17 +32,17 @@
*/
-/** @file src/subtitle_image.h
- * @brief SubtitleImage class
+/** @file src/text_image.h
+ * @brief TextImage class
*/
-#ifndef LIBDCP_SUBTITLE_IMAGE_H
-#define LIBDCP_SUBTITLE_IMAGE_H
+#ifndef LIBDCP_TEXT_IMAGE_H
+#define LIBDCP_TEXT_IMAGE_H
#include "array_data.h"
-#include "subtitle.h"
+#include "text.h"
#include "dcp_time.h"
#include <boost/optional.hpp>
#include <string>
@@ -51,13 +51,13 @@
namespace dcp {
-/** @class SubtitleImage
- * @brief A bitmap subtitle with all the associated attributes
+/** @class TextImage
+ * @brief A bitmap subtitle or caption with all the associated attributes
*/
-class SubtitleImage : public Subtitle
+class TextImage : public Text
{
public:
- SubtitleImage (
+ TextImage(
ArrayData png_image,
Time in,
Time out,
@@ -70,7 +70,7 @@ public:
Time fade_down_time
);
- SubtitleImage (
+ TextImage(
ArrayData png_image,
std::string id,
Time in,
@@ -104,7 +104,7 @@ public:
return _file;
}
- bool equals(std::shared_ptr<const dcp::Subtitle> other_sub, EqualityOptions const& options, NoteHandler note) const override;
+ bool equals(std::shared_ptr<const dcp::Text> other_text, EqualityOptions const& options, NoteHandler note) const override;
private:
ArrayData _png_image;
@@ -113,9 +113,9 @@ private:
};
-bool operator== (SubtitleImage const & a, SubtitleImage const & b);
-bool operator!= (SubtitleImage const & a, SubtitleImage const & b);
-std::ostream& operator<< (std::ostream& s, SubtitleImage const & sub);
+bool operator==(TextImage const & a, TextImage const& b);
+bool operator!=(TextImage const & a, TextImage const& b);
+std::ostream& operator<<(std::ostream& s, TextImage const& text);
}
diff --git a/src/subtitle_string.cc b/src/text_string.cc
index af61d928..32f9e4ed 100644
--- a/src/subtitle_string.cc
+++ b/src/text_string.cc
@@ -32,13 +32,13 @@
*/
-/** @file src/subtitle_string.cc
- * @brief SubtitleString class
+/** @file src/text_string.cc
+ * @brief TextString class
*/
#include "compose.hpp"
-#include "subtitle_string.h"
+#include "text_string.h"
#include "xml.h"
#include <cmath>
@@ -54,7 +54,7 @@ using boost::optional;
using namespace dcp;
-SubtitleString::SubtitleString (
+TextString::TextString(
optional<string> font,
bool italic,
bool bold,
@@ -78,7 +78,7 @@ SubtitleString::SubtitleString (
float space_before,
vector<Ruby> rubies
)
- : Subtitle(in, out, h_position, h_align, v_position, v_align, z_position, fade_up_time, fade_down_time)
+ : Text(in, out, h_position, h_align, v_position, v_align, z_position, fade_up_time, fade_down_time)
, _font (font)
, _italic (italic)
, _bold (bold)
@@ -98,7 +98,7 @@ SubtitleString::SubtitleString (
float
-SubtitleString::size_in_pixels (int screen_height) const
+TextString::size_in_pixels(int screen_height) const
{
/* Size in the subtitle file is given in points as if the screen
height is 11 inches, so a 72pt font would be 1/11th of the screen
@@ -110,7 +110,7 @@ SubtitleString::size_in_pixels (int screen_height) const
bool
-dcp::operator== (SubtitleString const & a, SubtitleString const & b)
+dcp::operator==(TextString const & a, TextString const & b)
{
return (
a.font() == b.font() &&
@@ -140,14 +140,14 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b)
bool
-dcp::operator!= (SubtitleString const & a, SubtitleString const & b)
+dcp::operator!=(TextString const & a, TextString const & b)
{
return !(a == b);
}
ostream&
-dcp::operator<< (ostream& s, SubtitleString const & sub)
+dcp::operator<<(ostream& s, TextString const & sub)
{
s << "\n`" << sub.text() << "' from " << sub.in() << " to " << sub.out() << ";\n"
<< "fade up " << sub.fade_up_time() << ", fade down " << sub.fade_down_time() << ";\n"
@@ -188,77 +188,77 @@ dcp::operator<< (ostream& s, SubtitleString const & sub)
bool
-SubtitleString::equals(shared_ptr<const Subtitle> other_sub, EqualityOptions const& options, NoteHandler note) const
+TextString::equals(shared_ptr<const Text> other_sub, EqualityOptions const& options, NoteHandler note) const
{
- if (!Subtitle::equals(other_sub, options, note)) {
+ if (!Text::equals(other_sub, options, note)) {
return false;
}
- auto other = dynamic_pointer_cast<const SubtitleString>(other_sub);
+ auto other = dynamic_pointer_cast<const TextString>(other_sub);
if (!other) {
- note(NoteType::ERROR, "Subtitle types differ: string vs image");
+ note(NoteType::ERROR, "Text types differ: string vs image");
return false;
}
bool same = true;
if (_font != other->_font) {
- note(NoteType::ERROR, String::compose("subtitle font differs: %1 vs %2", _font.get_value_or("[none]"), other->_font.get_value_or("[none]")));
+ note(NoteType::ERROR, String::compose("text font differs: %1 vs %2", _font.get_value_or("[none]"), other->_font.get_value_or("[none]")));
same = false;
}
if (_italic != other->_italic) {
- note(NoteType::ERROR, String::compose("subtitle italic flag differs: %1 vs %2", _italic ? "true" : "false", other->_italic ? "true" : "false"));
+ note(NoteType::ERROR, String::compose("text italic flag differs: %1 vs %2", _italic ? "true" : "false", other->_italic ? "true" : "false"));
same = false;
}
if (_bold != other->_bold) {
- note(NoteType::ERROR, String::compose("subtitle bold flag differs: %1 vs %2", _bold ? "true" : "false", other->_bold ? "true" : "false"));
+ note(NoteType::ERROR, String::compose("text bold flag differs: %1 vs %2", _bold ? "true" : "false", other->_bold ? "true" : "false"));
same = false;
}
if (_underline != other->_underline) {
- note(NoteType::ERROR, String::compose("subtitle underline flag differs: %1 vs %2", _underline ? "true" : "false", other->_underline ? "true" : "false"));
+ note(NoteType::ERROR, String::compose("text underline flag differs: %1 vs %2", _underline ? "true" : "false", other->_underline ? "true" : "false"));
same = false;
}
if (_colour != other->_colour) {
- note(NoteType::ERROR, String::compose("subtitle colour differs: %1 vs %2", _colour.to_rgb_string(), other->_colour.to_rgb_string()));
+ note(NoteType::ERROR, String::compose("text colour differs: %1 vs %2", _colour.to_rgb_string(), other->_colour.to_rgb_string()));
same = false;
}
if (_size != other->_size) {
- note(NoteType::ERROR, String::compose("subtitle size differs: %1 vs %2", _size, other->_size));
+ note(NoteType::ERROR, String::compose("text size differs: %1 vs %2", _size, other->_size));
same = false;
}
if (_aspect_adjust != other->_aspect_adjust) {
- note(NoteType::ERROR, String::compose("subtitle aspect_adjust differs: %1 vs %2", _aspect_adjust, other->_aspect_adjust));
+ note(NoteType::ERROR, String::compose("text aspect_adjust differs: %1 vs %2", _aspect_adjust, other->_aspect_adjust));
same = false;
}
if (_direction != other->_direction) {
- note(NoteType::ERROR, String::compose("subtitle direction differs: %1 vs %2", direction_to_string(_direction), direction_to_string(other->_direction)));
+ note(NoteType::ERROR, String::compose("text direction differs: %1 vs %2", direction_to_string(_direction), direction_to_string(other->_direction)));
same = false;
}
if (_text != other->_text) {
- note(NoteType::ERROR, String::compose("subtitle text differs: %1 vs %2", _text, other->_text));
+ note(NoteType::ERROR, String::compose("text text differs: %1 vs %2", _text, other->_text));
same = false;
}
if (_effect != other->_effect) {
- note(NoteType::ERROR, String::compose("subtitle effect differs: %1 vs %2", effect_to_string(_effect), effect_to_string(other->_effect)));
+ note(NoteType::ERROR, String::compose("text effect differs: %1 vs %2", effect_to_string(_effect), effect_to_string(other->_effect)));
same = false;
}
if (_effect_colour != other->_effect_colour) {
- note(NoteType::ERROR, String::compose("subtitle effect colour differs: %1 vs %2", _effect_colour.to_rgb_string(), other->_effect_colour.to_rgb_string()));
+ note(NoteType::ERROR, String::compose("text effect colour differs: %1 vs %2", _effect_colour.to_rgb_string(), other->_effect_colour.to_rgb_string()));
same = false;
}
if (_space_before != other->_space_before) {
- note(NoteType::ERROR, String::compose("subtitle space before differs: %1 vs %2", _space_before, other->_space_before));
+ note(NoteType::ERROR, String::compose("text space before differs: %1 vs %2", _space_before, other->_space_before));
same = false;
}
diff --git a/src/subtitle_string.h b/src/text_string.h
index 1ef57ff2..f532bafe 100644
--- a/src/subtitle_string.h
+++ b/src/text_string.h
@@ -32,18 +32,18 @@
*/
-/** @file src/subtitle_string.h
- * @brief SubtitleString class
+/** @file src/text_string.h
+ * @brief TextString class
*/
-#ifndef LIBDCP_SUBTITLE_STRING_H
-#define LIBDCP_SUBTITLE_STRING_H
+#ifndef LIBDCP_TEXT_STRING_H
+#define LIBDCP_TEXT_STRING_H
#include "dcp_time.h"
#include "ruby.h"
-#include "subtitle.h"
+#include "text.h"
#include <boost/optional.hpp>
#include <string>
@@ -51,10 +51,10 @@
namespace dcp {
-/** @class SubtitleString
+/** @class TextString
* @brief A single line of subtitle text with all the associated attributes.
*/
-class SubtitleString : public Subtitle
+class TextString : public Text
{
public:
/** @param font Font ID, or empty to use the default
@@ -80,7 +80,7 @@ public:
* @param fade_down_time Time to fade the text out
* @param space_before Space to add before this string, in ems (could be negative to remove space).
*/
- SubtitleString (
+ TextString(
boost::optional<std::string> font,
bool italic,
bool bold,
@@ -200,7 +200,7 @@ public:
_rubies = std::move(rubies);
}
- bool equals(std::shared_ptr<const dcp::Subtitle> other_sub, EqualityOptions const& options, NoteHandler node) const override;
+ bool equals(std::shared_ptr<const dcp::Text> other_sub, EqualityOptions const& options, NoteHandler node) const override;
private:
/** font ID */
@@ -226,9 +226,10 @@ private:
std::vector<Ruby> _rubies;
};
-bool operator== (SubtitleString const & a, SubtitleString const & b);
-bool operator!= (SubtitleString const & a, SubtitleString const & b);
-std::ostream& operator<< (std::ostream& s, SubtitleString const & sub);
+
+bool operator==(TextString const & a, TextString const & b);
+bool operator!=(TextString const & a, TextString const & b);
+std::ostream& operator<<(std::ostream& s, TextString const & sub);
}
diff --git a/src/types.h b/src/types.h
index 65840e6d..80ee8933 100644
--- a/src/types.h
+++ b/src/types.h
@@ -260,19 +260,19 @@ extern bool operator!= (Colour const & a, Colour const & b);
typedef boost::function<void (NoteType, std::string)> NoteHandler;
-/** Maximum absolute difference between dcp::SubtitleString::aspect_adjust values that
+/** Maximum absolute difference between dcp::TextString::aspect_adjust values that
* are considered equal
*/
constexpr float ASPECT_ADJUST_EPSILON = 1e-3;
-/** Maximum absolute difference between dcp::SubtitleString alignment values that
+/** Maximum absolute difference between dcp::TextString alignment values that
* are considered equal.
*/
constexpr float ALIGN_EPSILON = 1e-3;
-/** Maximum absolute difference between dcp::SubtitleString space_before values that
+/** Maximum absolute difference between dcp::TextString space_before values that
* are considered equal.
*/
constexpr float SPACE_BEFORE_EPSILON = 1e-3;
diff --git a/src/verify.cc b/src/verify.cc
index ee20e106..9abda0ff 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -803,7 +803,7 @@ verify_smpte_timed_text_asset (
void
verify_interop_text_asset(Context& context, shared_ptr<const InteropTextAsset> asset)
{
- if (asset->subtitles().empty()) {
+ if (asset->texts().empty()) {
context.error(VerificationNote::Code::MISSING_SUBTITLE, asset->id(), asset->file().get());
}
auto const unresolved = asset->unresolved_fonts();
@@ -1230,7 +1230,7 @@ dcp::verify_text_lines_and_characters(
vector<shared_ptr<Event>> events;
- auto position = [](shared_ptr<const SubtitleString> sub) {
+ auto position = [](shared_ptr<const TextString> sub) {
switch (sub->v_align()) {
case VAlign::TOP:
return lrintf(sub->v_position() * 100);
@@ -1244,8 +1244,8 @@ dcp::verify_text_lines_and_characters(
};
/* Make a list of "subtitle starts" and "subtitle ends" events */
- for (auto j: asset->subtitles()) {
- auto text = dynamic_pointer_cast<const SubtitleString>(j);
+ for (auto j: asset->texts()) {
+ auto text = dynamic_pointer_cast<const TextString>(j);
if (text) {
auto in = make_shared<Event>(text->in(), position(text), text->text().length());
events.push_back(in);
diff --git a/src/wscript b/src/wscript
index c61cd2e1..1f0190fc 100644
--- a/src/wscript
+++ b/src/wscript
@@ -117,12 +117,12 @@ def build(bld):
stereo_j2k_picture_asset.cc
stereo_j2k_picture_asset_writer.cc
stereo_j2k_picture_frame.cc
- subtitle.cc
text_asset.cc
text_asset_internal.cc
- subtitle_image.cc
+ text.cc
+ text_image.cc
subtitle_standard.cc
- subtitle_string.cc
+ text_string.cc
transfer_function.cc
types.cc
utc_offset.cc
@@ -234,11 +234,11 @@ def build(bld):
stereo_j2k_picture_asset_reader.h
stereo_j2k_picture_asset_writer.h
stereo_j2k_picture_frame.h
- subtitle.h
+ text.h
text_asset.h
- subtitle_image.h
+ text_image.h
subtitle_standard.h
- subtitle_string.h
+ text_string.h
text_type.h
transfer_function.h
types.h
diff --git a/test/combine_test.cc b/test/combine_test.cc
index 05563127..569f9d90 100644
--- a/test/combine_test.cc
+++ b/test/combine_test.cc
@@ -451,7 +451,7 @@ BOOST_AUTO_TEST_CASE(combine_multi_reel_subtitles)
memset(data1.data(), 0, data1.size());
auto subs1 = make_shared<dcp::InteropTextAsset>();
- subs1->add(simple_subtitle());
+ subs1->add(simple_text());
boost::filesystem::create_directory(in / "subs1");
subs1->add_font("afont1", data1);
subs1->write(in / "subs1" / "subs1.xml");
@@ -460,7 +460,7 @@ BOOST_AUTO_TEST_CASE(combine_multi_reel_subtitles)
memset(data2.data(), 1, data1.size());
auto subs2 = make_shared<dcp::InteropTextAsset>();
- subs2->add(simple_subtitle());
+ subs2->add(simple_text());
boost::filesystem::create_directory(in / "subs2");
subs2->add_font("afont2", data2);
subs2->write(in / "subs2" / "subs2.xml");
diff --git a/test/decryption_test.cc b/test/decryption_test.cc
index 273b4efa..d811fb3a 100644
--- a/test/decryption_test.cc
+++ b/test/decryption_test.cc
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE (decryption_test2)
auto subs_asset = std::make_shared<dcp::SMPTETextAsset>();
subs_asset->set_key (key);
subs_asset->set_context_id (context_id);
- subs_asset->add(std::make_shared<dcp::SubtitleString>(
+ subs_asset->add(std::make_shared<dcp::TextString>(
optional<string>(),
false, false, false,
dcp::Colour(255, 255, 255),
diff --git a/test/interop_subtitle_test.cc b/test/interop_subtitle_test.cc
index d731f10f..59f7daa7 100644
--- a/test/interop_subtitle_test.cc
+++ b/test/interop_subtitle_test.cc
@@ -35,8 +35,8 @@
#include "interop_text_asset.h"
#include "interop_load_font_node.h"
#include "reel_interop_text_asset.h"
-#include "subtitle_string.h"
-#include "subtitle_image.h"
+#include "text_string.h"
+#include "text_image.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <iostream>
@@ -65,10 +65,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test1)
BOOST_CHECK_EQUAL (interop_lfn->id, "theFontId");
BOOST_CHECK_EQUAL (interop_lfn->uri, "arial.ttf");
- auto s = subs.subtitles_during (dcp::Time (0, 0, 6, 1, 250), dcp::Time (0, 0, 6, 2, 250), false);
+ auto s = subs.texts_during(dcp::Time (0, 0, 6, 1, 250), dcp::Time (0, 0, 6, 2, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFontId"),
false,
false,
@@ -92,8 +92,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test1)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFontId"),
false,
false,
@@ -118,10 +118,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test1)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 0, 7, 190, 250), dcp::Time (0, 0, 7, 191, 250), false);
+ s = subs.texts_during(dcp::Time(0, 0, 7, 190, 250), dcp::Time(0, 0, 7, 191, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFontId"),
true,
false,
@@ -145,8 +145,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test1)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFontId"),
false,
false,
@@ -171,10 +171,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test1)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 0, 11, 95, 250), dcp::Time (0, 0, 11, 96, 250), false);
+ s = subs.texts_during (dcp::Time (0, 0, 11, 95, 250), dcp::Time (0, 0, 11, 96, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 1U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFontId"),
false,
false,
@@ -199,10 +199,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test1)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 0, 14, 42, 250), dcp::Time (0, 0, 14, 43, 250), false);
+ s = subs.texts_during (dcp::Time (0, 0, 14, 42, 250), dcp::Time (0, 0, 14, 43, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 1U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFontId"),
false,
true,
@@ -233,10 +233,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{
dcp::InteropTextAsset subs("test/data/subs2.xml");
- auto s = subs.subtitles_during (dcp::Time (0, 0, 42, 100, 250), dcp::Time (0, 0, 42, 101, 250), false);
+ auto s = subs.texts_during (dcp::Time (0, 0, 42, 100, 250), dcp::Time (0, 0, 42, 101, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -260,8 +260,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -286,10 +286,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 0, 50, 50, 250), dcp::Time (0, 0, 50, 51, 250), false);
+ s = subs.texts_during (dcp::Time (0, 0, 50, 50, 250), dcp::Time (0, 0, 50, 51, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -313,8 +313,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -339,10 +339,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 1, 2, 300, 250), dcp::Time (0, 1, 2, 301, 250), false);
+ s = subs.texts_during (dcp::Time (0, 1, 2, 300, 250), dcp::Time (0, 1, 2, 301, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string("theFont"),
true,
false,
@@ -366,8 +366,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -392,10 +392,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 1, 15, 50, 250), dcp::Time (0, 1, 15, 51, 250), false);
+ s = subs.texts_during (dcp::Time (0, 1, 15, 50, 250), dcp::Time (0, 1, 15, 51, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -419,8 +419,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -445,10 +445,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 1, 27, 200, 250), dcp::Time (0, 1, 27, 201, 250), false);
+ s = subs.texts_during (dcp::Time (0, 1, 27, 200, 250), dcp::Time (0, 1, 27, 201, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -472,8 +472,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -498,10 +498,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 1, 42, 300, 250), dcp::Time (0, 1, 42, 301, 250), false);
+ s = subs.texts_during (dcp::Time (0, 1, 42, 300, 250), dcp::Time (0, 1, 42, 301, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
false,
false,
@@ -525,8 +525,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
false,
false,
@@ -551,10 +551,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 1, 45, 200, 250), dcp::Time (0, 1, 45, 201, 250), false);
+ s = subs.texts_during (dcp::Time (0, 1, 45, 200, 250), dcp::Time (0, 1, 45, 201, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string("theFont"),
false,
false,
@@ -578,8 +578,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
false,
false,
@@ -604,10 +604,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 1, 47, 249, 250), dcp::Time (0, 1, 47, 250, 250), false);
+ s = subs.texts_during (dcp::Time (0, 1, 47, 249, 250), dcp::Time (0, 1, 47, 250, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
false,
false,
@@ -631,8 +631,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
false,
false,
@@ -657,10 +657,10 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
{}
));
- s = subs.subtitles_during (dcp::Time (0, 2, 6, 210, 250), dcp::Time (0, 2, 6, 211, 250), false);
+ s = subs.texts_during(dcp::Time (0, 2, 6, 210, 250), dcp::Time (0, 2, 6, 211, 250), false);
BOOST_REQUIRE_EQUAL (s.size(), 2U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.front()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.front()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.front()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.front()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -684,8 +684,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test2)
0,
{}
));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(s.back()));
- BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::SubtitleString>(s.back()), dcp::SubtitleString (
+ BOOST_REQUIRE (dynamic_pointer_cast<const dcp::TextString>(s.back()));
+ BOOST_CHECK_EQUAL (*dynamic_pointer_cast<const dcp::TextString>(s.back()), dcp::TextString (
string ("theFont"),
true,
false,
@@ -716,8 +716,8 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test3)
{
dcp::InteropTextAsset subs("test/data/subs3.xml");
- BOOST_REQUIRE_EQUAL (subs.subtitles().size(), 1U);
- auto si = dynamic_pointer_cast<const dcp::SubtitleImage>(subs.subtitles().front());
+ BOOST_REQUIRE_EQUAL(subs.texts().size(), 1U);
+ auto si = dynamic_pointer_cast<const dcp::TextImage>(subs.texts().front());
BOOST_REQUIRE (si);
BOOST_CHECK (si->png_image() == dcp::ArrayData("test/data/sub.png"));
}
@@ -732,7 +732,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test)
c.set_movie_title ("Test");
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Frutiger"),
false,
false,
@@ -759,7 +759,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
boost::optional<string> (),
true,
true,
@@ -786,7 +786,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
boost::optional<string> (),
true,
true,
@@ -847,7 +847,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test2)
c.set_movie_title ("Test");
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Frutiger"),
false,
false,
@@ -874,7 +874,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test2)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
boost::optional<string>(),
true,
true,
@@ -935,7 +935,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test3)
c->set_movie_title ("Test");
c->add (
- std::make_shared<dcp::SubtitleImage>(
+ std::make_shared<dcp::TextImage>(
dcp::ArrayData ("test/data/sub.png"),
dcp::Time (0, 4, 9, 22, 24),
dcp::Time (0, 4, 11, 22, 24),
diff --git a/test/kdm_test.cc b/test/kdm_test.cc
index cf1a7fdc..d2ae3042 100644
--- a/test/kdm_test.cc
+++ b/test/kdm_test.cc
@@ -326,7 +326,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test)
/* Make VF */
auto subs = make_shared<dcp::SMPTETextAsset>();
- subs->add(simple_subtitle());
+ subs->add(simple_text());
subs->set_key(key);
boost::filesystem::remove_all (vf_path);
diff --git a/test/shared_subtitle_test.cc b/test/shared_subtitle_test.cc
index 4ae4f4ae..82595cd0 100644
--- a/test/shared_subtitle_test.cc
+++ b/test/shared_subtitle_test.cc
@@ -39,8 +39,8 @@
#include "interop_text_asset.h"
#include "smpte_text_asset.h"
-#include "subtitle_string.h"
-#include "subtitle_image.h"
+#include "text_string.h"
+#include "text_image.h"
#include "text_asset_internal.h"
#include "reel_interop_text_asset.h"
#include "reel.h"
diff --git a/test/smpte_subtitle_test.cc b/test/smpte_subtitle_test.cc
index 005a9ec7..e1dabc44 100644
--- a/test/smpte_subtitle_test.cc
+++ b/test/smpte_subtitle_test.cc
@@ -35,8 +35,8 @@
#include "smpte_load_font_node.h"
#include "smpte_text_asset.h"
#include "stream_operators.h"
-#include "subtitle_image.h"
#include "test.h"
+#include "text_image.h"
#include "types.h"
#include <boost/optional/optional_io.hpp>
#include <boost/test/unit_test.hpp>
@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE (smpte_subtitle_id_test)
{
dcp::SMPTETextAsset subs;
subs.add(
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
optional<string>(),
false, false, false,
dcp::Colour(),
@@ -111,17 +111,17 @@ BOOST_AUTO_TEST_CASE (read_smpte_subtitle_test)
BOOST_REQUIRE (smpte_lfn);
BOOST_CHECK_EQUAL (smpte_lfn->id, "theFontId");
BOOST_CHECK_EQUAL (smpte_lfn->urn, "9118bbce-4105-4a05-b37c-a5a6f75e1fea");
- BOOST_REQUIRE_EQUAL (sc.subtitles().size(), 63U);
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(sc.subtitles().front()));
- BOOST_CHECK_EQUAL (dynamic_pointer_cast<const dcp::SubtitleString>(sc.subtitles().front())->text(), "Noch mal.");
- BOOST_CHECK_EQUAL (dynamic_pointer_cast<const dcp::SubtitleString>(sc.subtitles().front())->space_before(), 0.0f);
- BOOST_CHECK_EQUAL (sc.subtitles().front()->in(), dcp::Time (0, 0, 25, 12, 25));
- BOOST_CHECK_EQUAL (sc.subtitles().front()->out(), dcp::Time (0, 0, 26, 4, 25));
- BOOST_REQUIRE (dynamic_pointer_cast<const dcp::SubtitleString>(sc.subtitles().back()));
- BOOST_CHECK_EQUAL (dynamic_pointer_cast<const dcp::SubtitleString>(sc.subtitles().back())->text(), "Prochainement");
- BOOST_CHECK_EQUAL (dynamic_pointer_cast<const dcp::SubtitleString>(sc.subtitles().back())->space_before(), 0.0f);
- BOOST_CHECK_EQUAL (sc.subtitles().back()->in(), dcp::Time (0, 1, 57, 17, 25));
- BOOST_CHECK_EQUAL (sc.subtitles().back()->out(), dcp::Time (0, 1, 58, 12, 25));
+ BOOST_REQUIRE_EQUAL(sc.texts().size(), 63U);
+ BOOST_REQUIRE(dynamic_pointer_cast<const dcp::TextString>(sc.texts().front()));
+ BOOST_CHECK_EQUAL(dynamic_pointer_cast<const dcp::TextString>(sc.texts().front())->text(), "Noch mal.");
+ BOOST_CHECK_EQUAL(dynamic_pointer_cast<const dcp::TextString>(sc.texts().front())->space_before(), 0.0f);
+ BOOST_CHECK_EQUAL(sc.texts().front()->in(), dcp::Time (0, 0, 25, 12, 25));
+ BOOST_CHECK_EQUAL(sc.texts().front()->out(), dcp::Time (0, 0, 26, 4, 25));
+ BOOST_REQUIRE(dynamic_pointer_cast<const dcp::TextString>(sc.texts().back()));
+ BOOST_CHECK_EQUAL(dynamic_pointer_cast<const dcp::TextString>(sc.texts().back())->text(), "Prochainement");
+ BOOST_CHECK_EQUAL(dynamic_pointer_cast<const dcp::TextString>(sc.texts().back())->space_before(), 0.0f);
+ BOOST_CHECK_EQUAL(sc.texts().back()->in(), dcp::Time (0, 1, 57, 17, 25));
+ BOOST_CHECK_EQUAL(sc.texts().back()->out(), dcp::Time (0, 1, 58, 12, 25));
}
@@ -130,40 +130,40 @@ BOOST_AUTO_TEST_CASE (read_smpte_subtitle_test2)
{
dcp::SMPTETextAsset sc (private_test / "olsson.xml");
- auto subs = sc.subtitles();
+ auto subs = sc.texts();
BOOST_REQUIRE_EQUAL (subs.size(), 6U);
auto i = 0;
- auto is = dynamic_pointer_cast<const dcp::SubtitleString>(subs[i]);
+ auto is = dynamic_pointer_cast<const dcp::TextString>(subs[i]);
BOOST_REQUIRE (is);
BOOST_CHECK_EQUAL (is->text(), "Testing is ");
BOOST_CHECK (!is->italic());
BOOST_CHECK_CLOSE (is->space_before(), 0, 0.1);
++i;
- is = dynamic_pointer_cast<const dcp::SubtitleString>(subs[i]);
+ is = dynamic_pointer_cast<const dcp::TextString>(subs[i]);
BOOST_REQUIRE (is);
BOOST_CHECK_EQUAL (is->text(), "really");
BOOST_CHECK (is->italic());
BOOST_CHECK_CLOSE (is->space_before(), 0, 0.1);
++i;
- is = dynamic_pointer_cast<const dcp::SubtitleString>(subs[i]);
+ is = dynamic_pointer_cast<const dcp::TextString>(subs[i]);
BOOST_REQUIRE (is);
BOOST_CHECK_EQUAL (is->text(), " fun!");
BOOST_CHECK (!is->italic());
BOOST_CHECK_CLOSE (is->space_before(), 5, 0.1);
++i;
- is = dynamic_pointer_cast<const dcp::SubtitleString>(subs[i]);
+ is = dynamic_pointer_cast<const dcp::TextString>(subs[i]);
BOOST_REQUIRE (is);
BOOST_CHECK_EQUAL (is->text(), "This is the ");
BOOST_CHECK (!is->italic());
BOOST_CHECK_CLOSE (is->space_before(), 0, 0.1);
++i;
- is = dynamic_pointer_cast<const dcp::SubtitleString>(subs[i]);
+ is = dynamic_pointer_cast<const dcp::TextString>(subs[i]);
BOOST_REQUIRE (is);
BOOST_CHECK_EQUAL (is->text(), "second");
BOOST_CHECK (is->italic());
BOOST_CHECK_CLOSE (is->space_before(), 0, 0.1);
++i;
- is = dynamic_pointer_cast<const dcp::SubtitleString>(subs[i]);
+ is = dynamic_pointer_cast<const dcp::TextString>(subs[i]);
BOOST_REQUIRE (is);
BOOST_CHECK_EQUAL (is->text(), " line!");
BOOST_CHECK (!is->italic());
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test)
c.set_issue_date (dcp::LocalTime ("2016-04-01T03:52:00+00:00"));
c.add (
- std::make_shared<dcp::SubtitleString> (
+ std::make_shared<dcp::TextString> (
string ("Frutiger"),
false,
false,
@@ -208,7 +208,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
boost::optional<string> (),
true,
true,
@@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
boost::optional<string> (),
true,
true,
@@ -303,7 +303,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test2)
c.set_issue_date (dcp::LocalTime ("2016-04-01T03:52:00+00:00"));
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -330,7 +330,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test2)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
true,
false,
@@ -357,7 +357,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test2)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -384,7 +384,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test2)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -411,7 +411,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test2)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
true,
false,
@@ -438,7 +438,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test2)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -502,7 +502,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test3)
boost::filesystem::path const sub_image = "test/data/sub.png";
c.add (
- std::make_shared<dcp::SubtitleImage>(
+ std::make_shared<dcp::TextImage>(
dcp::ArrayData(sub_image),
dcp::Time (0, 4, 9, 22, 24),
dcp::Time (0, 4, 11, 22, 24),
@@ -523,9 +523,9 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test3)
c.write (path / "subs.mxf");
dcp::SMPTETextAsset read_back (path / "subs.mxf");
- auto subs = read_back.subtitles ();
+ auto subs = read_back.texts();
BOOST_REQUIRE_EQUAL (subs.size(), 1U);
- auto image = dynamic_pointer_cast<const dcp::SubtitleImage>(subs[0]);
+ auto image = dynamic_pointer_cast<const dcp::TextImage>(subs[0]);
BOOST_REQUIRE (image);
BOOST_CHECK (image->png_image() == dcp::ArrayData(sub_image));
@@ -553,7 +553,7 @@ BOOST_AUTO_TEST_CASE (write_subtitles_in_vertical_order_with_top_alignment)
c.set_issue_date (dcp::LocalTime ("2016-04-01T03:52:00+00:00"));
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -580,7 +580,7 @@ BOOST_AUTO_TEST_CASE (write_subtitles_in_vertical_order_with_top_alignment)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -643,7 +643,7 @@ BOOST_AUTO_TEST_CASE (write_subtitles_in_vertical_order_with_bottom_alignment)
c.set_issue_date (dcp::LocalTime ("2016-04-01T03:52:00+00:00"));
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
@@ -670,7 +670,7 @@ BOOST_AUTO_TEST_CASE (write_subtitles_in_vertical_order_with_bottom_alignment)
);
c.add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
string ("Arial"),
false,
false,
diff --git a/test/test.cc b/test/test.cc
index e1d5ce77..b4d51e9c 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -391,10 +391,10 @@ make_simple (boost::filesystem::path path, int reels, int frames, dcp::Standard
}
-shared_ptr<dcp::Subtitle>
-simple_subtitle ()
+shared_ptr<dcp::Text>
+simple_text()
{
- return std::make_shared<dcp::SubtitleString>(
+ return std::make_shared<dcp::TextString>(
optional<string>(),
false,
false,
@@ -437,7 +437,7 @@ make_simple_with_interop_subs (boost::filesystem::path path)
auto dcp = make_simple (path, 1, 24, dcp::Standard::INTEROP);
auto subs = make_shared<dcp::InteropTextAsset>();
- subs->add (simple_subtitle());
+ subs->add(simple_text());
boost::filesystem::create_directory (path / "subs");
dcp::ArrayData data(4096);
@@ -460,7 +460,7 @@ make_simple_with_smpte_subs (boost::filesystem::path path)
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
subs->set_start_time (dcp::Time());
- subs->add (simple_subtitle());
+ subs->add(simple_text());
dcp::ArrayData fake_font(1024);
subs->add_font("font", fake_font);
@@ -479,7 +479,7 @@ make_simple_with_interop_ccaps (boost::filesystem::path path)
auto dcp = make_simple (path, 1, 24, dcp::Standard::INTEROP);
auto subs = make_shared<dcp::InteropTextAsset>();
- subs->add (simple_subtitle());
+ subs->add(simple_text());
subs->write (path / "ccap.xml");
auto reel_caps = make_shared<dcp::ReelInteropTextAsset>(dcp::TextType::CAPTION, subs, dcp::Fraction(24, 1), 240, 0);
@@ -497,7 +497,7 @@ make_simple_with_smpte_ccaps (boost::filesystem::path path)
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
subs->set_start_time (dcp::Time());
- subs->add (simple_subtitle());
+ subs->add(simple_text());
dcp::ArrayData fake_font(1024);
subs->add_font("font", fake_font);
subs->write (path / "ccap.mxf");
diff --git a/test/test.h b/test/test.h
index df7bda89..d796a4a4 100644
--- a/test/test.h
+++ b/test/test.h
@@ -21,8 +21,8 @@
#include "cpl.h"
#include "dcp.h"
#include "reel.h"
-#include "subtitle.h"
#include "reel_asset.h"
+#include "text.h"
#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
#include <boost/test/unit_test.hpp>
@@ -59,7 +59,7 @@ extern std::shared_ptr<dcp::SoundAsset> simple_sound (
boost::optional<dcp::Key> key = boost::optional<dcp::Key>(),
int channels = 6
);
-extern std::shared_ptr<dcp::Subtitle> simple_subtitle ();
+extern std::shared_ptr<dcp::Text> simple_text();
extern std::shared_ptr<dcp::ReelMarkersAsset> simple_markers (int frames = 24);
extern std::shared_ptr<dcp::DCP> make_simple (
boost::filesystem::path path,
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 81d31c72..63e2f352 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -2073,7 +2073,7 @@ void
add_test_subtitle (shared_ptr<dcp::TextAsset> asset, int start_frame, int end_frame, float v_position = 0, dcp::VAlign v_align = dcp::VAlign::CENTER, string text = "Hello")
{
asset->add (
- std::make_shared<dcp::SubtitleString>(
+ std::make_shared<dcp::TextString>(
optional<string>(),
false,
false,
@@ -2289,7 +2289,7 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_subtitle_languages)
{
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
- subs->add (simple_subtitle());
+ subs->add(simple_text());
add_font(subs);
subs->write (path / "subs1.mxf");
auto reel_subs = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::SUBTITLE, subs, dcp::Fraction(24, 1), reel_length, 0);
@@ -2299,7 +2299,7 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_subtitle_languages)
{
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("en-US"));
- subs->add (simple_subtitle());
+ subs->add(simple_text());
add_font(subs);
subs->write (path / "subs2.mxf");
auto reel_subs = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::SUBTITLE, subs, dcp::Fraction(24, 1), reel_length, 0);
@@ -2351,7 +2351,7 @@ BOOST_AUTO_TEST_CASE (verify_multiple_closed_caption_languages_allowed)
{
auto ccaps = make_shared<dcp::SMPTETextAsset>();
ccaps->set_language (dcp::LanguageTag("de-DE"));
- ccaps->add (simple_subtitle());
+ ccaps->add(simple_text());
add_font(ccaps);
ccaps->write (path / "subs1.mxf");
auto reel_ccaps = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::CAPTION, ccaps, dcp::Fraction(24, 1), reel_length, 0);
@@ -2361,7 +2361,7 @@ BOOST_AUTO_TEST_CASE (verify_multiple_closed_caption_languages_allowed)
{
auto ccaps = make_shared<dcp::SMPTETextAsset>();
ccaps->set_language (dcp::LanguageTag("en-US"));
- ccaps->add (simple_subtitle());
+ ccaps->add(simple_text());
add_font(ccaps);
ccaps->write (path / "subs2.mxf");
auto reel_ccaps = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::CAPTION, ccaps, dcp::Fraction(24, 1), reel_length, 0);
@@ -3575,7 +3575,7 @@ verify_subtitles_must_be_in_all_reels_check (path dir, bool add_to_reel1, bool a
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
subs->set_start_time (dcp::Time());
- subs->add (simple_subtitle());
+ subs->add(simple_text());
add_font(subs);
subs->write (dir / "subs.mxf");
auto reel_subs = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::SUBTITLE, subs, dcp::Fraction(24, 1), reel_length, 0);
@@ -3708,7 +3708,7 @@ verify_closed_captions_must_be_in_all_reels_check (path dir, int caps_in_reel1,
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
subs->set_start_time (dcp::Time());
- subs->add (simple_subtitle());
+ subs->add(simple_text());
add_font(subs);
subs->write (dir / "subs.mxf");
@@ -3839,7 +3839,7 @@ verify_text_entry_point_check(dcp::TextType type, path dir, dcp::VerificationNot
auto subs = make_shared<dcp::SMPTETextAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
subs->set_start_time (dcp::Time());
- subs->add (simple_subtitle());
+ subs->add(simple_text());
add_font(subs);
subs->write (dir / "subs.mxf");
auto reel_text = make_shared<T>(type, subs, dcp::Fraction(24, 1), reel_length, 0);
@@ -5844,7 +5844,7 @@ BOOST_AUTO_TEST_CASE(overlapping_subtitles)
{
auto asset = make_shared<dcp::InteropTextAsset>();
- asset->add(std::make_shared<dcp::SubtitleString>(
+ asset->add(std::make_shared<dcp::TextString>(
optional<string>{}, false, false, false,
dcp::Colour{}, 42, 0,
dcp::Time(0, 0, 0, 0, 24),
@@ -5857,7 +5857,7 @@ BOOST_AUTO_TEST_CASE(overlapping_subtitles)
dcp::Effect::NONE, dcp::Colour{}, dcp::Time{}, dcp::Time{}, 0, vector<dcp::Ruby>{}
));
- asset->add(std::make_shared<dcp::SubtitleString>(
+ asset->add(std::make_shared<dcp::TextString>(
optional<string>{}, false, false, false,
dcp::Colour{}, 42, 0,
dcp::Time(0, 0, 2, 0, 24),
diff --git a/tools/dcpdiff.cc b/tools/dcpdiff.cc
index 7c7c4b71..6c101ab0 100644
--- a/tools/dcpdiff.cc
+++ b/tools/dcpdiff.cc
@@ -198,7 +198,7 @@ main (int argc, char* argv[])
options.reel_annotation_texts_can_differ = true;
break;
case 'F':
- options.export_differing_subtitles = true;
+ options.export_differing_texts = true;
break;
}
}
diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc
index 4a790561..8a7f738e 100644
--- a/tools/dcpinfo.cc
+++ b/tools/dcpinfo.cc
@@ -50,8 +50,8 @@
#include "smpte_text_asset.h"
#include "sound_asset.h"
#include "text_asset.h"
-#include "subtitle_image.h"
-#include "subtitle_string.h"
+#include "text_image.h"
+#include "text_string.h"
#include <getopt.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
@@ -251,7 +251,7 @@ main_subtitle (vector<string> const& only, shared_ptr<Reel> reel, bool list_subt
OUTPUT_SUBTITLE(" Subtitle ID: %1", ms->id());
if (ms->asset_ref().resolved()) {
- auto subs = ms->asset()->subtitles ();
+ auto subs = ms->asset()->texts();
OUTPUT_SUBTITLE("\n Subtitle: %1 subtitles", subs.size());
auto iop = dynamic_pointer_cast<InteropTextAsset>(ms->asset());
if (iop) {
@@ -263,13 +263,13 @@ main_subtitle (vector<string> const& only, shared_ptr<Reel> reel, bool list_subt
}
if (list_subtitles) {
for (auto k: subs) {
- auto ks = dynamic_pointer_cast<const SubtitleString>(k);
+ auto ks = dynamic_pointer_cast<const TextString>(k);
if (ks) {
stringstream s;
s << *ks;
OUTPUT_SUBTITLE("%1\n", s.str());
}
- auto is = dynamic_pointer_cast<const SubtitleImage>(k);
+ auto is = dynamic_pointer_cast<const TextImage>(k);
if (is) {
stringstream s;
s << *is;