From e3033879f7693d40f652f013b00c76deed6994da Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 4 Dec 2023 23:14:40 +0100 Subject: [PATCH] Rename everything. --- examples/read_dcp.cc | 6 +- src/asset_factory.cc | 4 +- src/combine.cc | 4 +- src/dcp.cc | 12 +- ...ubtitle_asset.cc => interop_text_asset.cc} | 58 +++---- ..._subtitle_asset.h => interop_text_asset.h} | 38 ++--- src/reel.cc | 10 +- src/reel_closed_caption_asset.cc | 8 +- src/reel_closed_caption_asset.h | 12 +- src/reel_interop_closed_caption_asset.cc | 3 +- src/reel_interop_closed_caption_asset.h | 12 +- src/reel_interop_subtitle_asset.cc | 2 +- src/reel_interop_subtitle_asset.h | 16 +- src/reel_smpte_closed_caption_asset.cc | 2 +- src/reel_smpte_closed_caption_asset.h | 12 +- src/reel_smpte_subtitle_asset.cc | 4 +- src/reel_smpte_subtitle_asset.h | 14 +- src/reel_subtitle_asset.cc | 8 +- src/reel_subtitle_asset.h | 14 +- ..._subtitle_asset.cc => smpte_text_asset.cc} | 100 ++++++------ ...te_subtitle_asset.h => smpte_text_asset.h} | 38 ++--- src/subtitle_image.cc | 8 +- src/subtitle_image.h | 6 +- src/{subtitle.cc => text.cc} | 10 +- src/{subtitle.h => text.h} | 20 +-- src/{subtitle_asset.cc => text_asset.cc} | 130 +++++++-------- src/{subtitle_asset.h => text_asset.h} | 48 +++--- ...set_internal.cc => text_asset_internal.cc} | 12 +- ...asset_internal.h => text_asset_internal.h} | 12 +- ...{subtitle_standard.cc => text_standard.cc} | 10 +- src/{subtitle_standard.h => text_standard.h} | 10 +- src/{subtitle_string.cc => text_string.cc} | 20 +-- src/{subtitle_string.h => text_string.h} | 26 +-- src/verify.cc | 38 ++--- src/wscript | 30 ++-- test/combine_test.cc | 6 +- test/dcp_font_test.cc | 12 +- test/decryption_test.cc | 8 +- test/encryption_test.cc | 2 +- test/interop_subtitle_test.cc | 152 +++++++++--------- test/kdm_test.cc | 4 +- test/rewrite_subs.cc | 10 +- test/shared_subtitle_test.cc | 22 +-- test/smpte_subtitle_test.cc | 122 +++++++------- test/subs_in_out.cc | 8 +- test/test.cc | 16 +- test/test.h | 5 +- test/verify_test.cc | 80 ++++----- tools/dcpdumpsub.cc | 4 +- tools/dcpinfo.cc | 16 +- 50 files changed, 607 insertions(+), 617 deletions(-) rename src/{interop_subtitle_asset.cc => interop_text_asset.cc} (83%) rename src/{interop_subtitle_asset.h => interop_text_asset.h} (80%) rename src/{smpte_subtitle_asset.cc => smpte_text_asset.cc} (83%) rename src/{smpte_subtitle_asset.h => smpte_text_asset.h} (87%) rename src/{subtitle.cc => text.cc} (94%) rename src/{subtitle.h => text.h} (88%) rename src/{subtitle_asset.cc => text_asset.cc} (86%) rename src/{subtitle_asset.h => text_asset.h} (83%) rename src/{subtitle_asset_internal.cc => text_asset_internal.cc} (97%) rename src/{subtitle_asset_internal.h => text_asset_internal.h} (95%) rename src/{subtitle_standard.cc => text_standard.cc} (84%) rename src/{subtitle_standard.h => text_standard.h} (88%) rename src/{subtitle_string.cc => text_string.cc} (91%) rename src/{subtitle_string.h => text_string.h} (89%) diff --git a/examples/read_dcp.cc b/examples/read_dcp.cc index f099409f..d87cb60e 100644 --- a/examples/read_dcp.cc +++ b/examples/read_dcp.cc @@ -32,7 +32,7 @@ #include "mono_picture_asset_reader.h" #include "stereo_picture_asset.h" #include "sound_asset.h" -#include "subtitle_asset.h" +#include "text_asset.h" #include "openjpeg_image.h" #include "colour_conversion.h" #include "rgb_xyz.h" @@ -77,8 +77,8 @@ main () std::cout << "3D picture\n"; } else if (std::dynamic_pointer_cast(i)) { std::cout << "Sound\n"; - } else if (std::dynamic_pointer_cast(i)) { - std::cout << "Subtitle\n"; + } else if (std::dynamic_pointer_cast(i)) { + std::cout << "Subtitle / closed caption\n"; } else if (std::dynamic_pointer_cast(i)) { std::cout << "CPL\n"; } diff --git a/src/asset_factory.cc b/src/asset_factory.cc index d326ba68..4884f090 100644 --- a/src/asset_factory.cc +++ b/src/asset_factory.cc @@ -41,7 +41,7 @@ #include "atmos_asset.h" #include "compose.hpp" #include "mono_picture_asset.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" #include "sound_asset.h" #include "stereo_picture_asset.h" #include "stereo_picture_asset.h" @@ -90,7 +90,7 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_ case ASDCP::ESS_JPEG_2000_S: return make_shared(path); case ASDCP::ESS_TIMED_TEXT: - return make_shared(path); + return make_shared(path); case ASDCP::ESS_DCDATA_DOLBY_ATMOS: return make_shared(path); default: diff --git a/src/combine.cc b/src/combine.cc index b7a625f0..74456bfb 100644 --- a/src/combine.cc +++ b/src/combine.cc @@ -45,7 +45,7 @@ #include "exceptions.h" #include "filesystem.h" #include "font_asset.h" -#include "interop_subtitle_asset.h" +#include "interop_text_asset.h" #include "raw_convert.h" #include #include @@ -139,7 +139,7 @@ dcp::combine ( continue; } - auto sub = dynamic_pointer_cast(j); + auto sub = dynamic_pointer_cast(j); if (sub) { /* Interop fonts are really fiddly. The font files are assets (in the ASSETMAP) * and also linked from the font XML by filename. We have to fix both these things, diff --git a/src/dcp.cc b/src/dcp.cc index d603cfae..a809529e 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -49,7 +49,7 @@ #include "exceptions.h" #include "filesystem.h" #include "font_asset.h" -#include "interop_subtitle_asset.h" +#include "interop_text_asset.h" #include "metadata.h" #include "mono_picture_asset.h" #include "picture_asset.h" @@ -57,7 +57,7 @@ #include "raw_convert.h" #include "reel_asset.h" #include "reel_subtitle_asset.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" #include "sound_asset.h" #include "stereo_picture_asset.h" #include "util.h" @@ -221,7 +221,7 @@ DCP::read (vector* notes, bool ignore_incorrect_picture_m if ( pkl_type == remove_parameters(CPL::static_pkl_type(standard)) || - pkl_type == remove_parameters(InteropSubtitleAsset::static_pkl_type(standard))) { + pkl_type == remove_parameters(InteropTextAsset::static_pkl_type(standard))) { auto p = new xmlpp::DomParser; try { p->parse_file(dcp::filesystem::fix_long_path(path).string()); @@ -243,13 +243,13 @@ DCP::read (vector* notes, bool ignore_incorrect_picture_m if (standard == Standard::SMPTE && notes) { notes->push_back (VerificationNote(VerificationNote::Type::ERROR, VerificationNote::Code::MISMATCHED_STANDARD)); } - other_assets.push_back (make_shared(path)); + other_assets.push_back(make_shared(path)); } } else if ( *pkl_type == remove_parameters(PictureAsset::static_pkl_type(standard)) || *pkl_type == remove_parameters(SoundAsset::static_pkl_type(standard)) || *pkl_type == remove_parameters(AtmosAsset::static_pkl_type(standard)) || - *pkl_type == remove_parameters(SMPTESubtitleAsset::static_pkl_type(standard)) + *pkl_type == remove_parameters(SMPTETextAsset::static_pkl_type(standard)) ) { bool found_threed_marked_as_twod = false; @@ -542,7 +542,7 @@ DCP::assets (bool ignore_unresolved) const auto o = j->asset_ref().asset(); assets.push_back (o); /* More Interop special-casing */ - auto sub = dynamic_pointer_cast(o); + auto sub = dynamic_pointer_cast(o); if (sub) { add_to_container(assets, sub->font_assets()); } diff --git a/src/interop_subtitle_asset.cc b/src/interop_text_asset.cc similarity index 83% rename from src/interop_subtitle_asset.cc rename to src/interop_text_asset.cc index 32c3f66a..d9515573 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_text_asset.cc @@ -33,7 +33,7 @@ /** @file src/interop_subtitle_asset.cc - * @brief InteropSubtitleAsset class + * @brief InteropTextAsset class */ @@ -44,10 +44,10 @@ #include "font_asset.h" #include "file.h" #include "interop_load_font_node.h" -#include "interop_subtitle_asset.h" +#include "interop_text_asset.h" #include "raw_convert.h" -#include "subtitle_asset_internal.h" #include "subtitle_image.h" +#include "text_asset_internal.h" #include "util.h" #include "warnings.h" #include "xml.h" @@ -70,8 +70,8 @@ using boost::optional; using namespace dcp; -InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file) - : SubtitleAsset (file) +InteropTextAsset::InteropTextAsset(boost::filesystem::path file) + : TextAsset(file) { _raw_xml = dcp::file_to_string (file); @@ -89,11 +89,11 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file) for (auto i: xml->node()->get_children()) { auto e = dynamic_cast(i); if (e && (e->get_name() == "Font" || e->get_name() == "Subtitle")) { - parse_subtitles (e, ps, optional(), Standard::INTEROP); + parse_texts(e, ps, optional(), Standard::INTEROP); } } - for (auto i: _subtitles) { + for (auto i: _texts) { auto si = dynamic_pointer_cast(i); if (si) { si->read_png_file (file.parent_path() / String::compose("%1.png", si->id())); @@ -102,14 +102,8 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file) } -InteropSubtitleAsset::InteropSubtitleAsset () -{ - -} - - string -InteropSubtitleAsset::xml_as_string () const +InteropTextAsset::xml_as_string() const { xmlpp::Document doc; auto root = doc.create_root_node ("DCSubtitle"); @@ -126,14 +120,14 @@ InteropSubtitleAsset::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, {}); } void -InteropSubtitleAsset::add_font (string load_id, dcp::ArrayData data) +InteropTextAsset::add_font(string load_id, dcp::ArrayData data) { _fonts.push_back (Font(load_id, make_uuid(), data)); auto const uri = String::compose("font_%1.ttf", _load_font_nodes.size()); @@ -142,13 +136,13 @@ InteropSubtitleAsset::add_font (string load_id, dcp::ArrayData data) bool -InteropSubtitleAsset::equals(shared_ptr other_asset, EqualityOptions const& options, NoteHandler note) const +InteropTextAsset::equals(shared_ptr other_asset, EqualityOptions const& options, NoteHandler note) const { - if (!SubtitleAsset::equals (other_asset, options, note)) { + if (!TextAsset::equals(other_asset, options, note)) { return false; } - auto other = dynamic_pointer_cast (other_asset); + auto other = dynamic_pointer_cast(other_asset); if (!other) { return false; } @@ -174,7 +168,7 @@ InteropSubtitleAsset::equals(shared_ptr other_asset, EqualityOption } if (_movie_title != other->_movie_title) { - note (NoteType::ERROR, "Subtitle movie titles differ"); + note (NoteType::ERROR, "Subtitle or closed caption movie titles differ"); return false; } @@ -183,7 +177,7 @@ InteropSubtitleAsset::equals(shared_ptr other_asset, EqualityOption vector> -InteropSubtitleAsset::load_font_nodes () const +InteropTextAsset::load_font_nodes() const { vector> lf; copy (_load_font_nodes.begin(), _load_font_nodes.end(), back_inserter (lf)); @@ -192,7 +186,7 @@ InteropSubtitleAsset::load_font_nodes () const void -InteropSubtitleAsset::write (boost::filesystem::path p) const +InteropTextAsset::write(boost::filesystem::path p) const { File f(p, "wb"); if (!f) { @@ -206,7 +200,7 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const _file = p; /* Image subtitles */ - for (auto i: _subtitles) { + for (auto i: _texts) { auto im = dynamic_pointer_cast (i); if (im) { im->write_png_file(p.parent_path() / String::compose("%1.png", im->id())); @@ -230,7 +224,7 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const * a list of font ID, load ID and data. */ void -InteropSubtitleAsset::resolve_fonts (vector> assets) +InteropTextAsset::resolve_fonts(vector> assets) { for (auto asset: assets) { auto font = dynamic_pointer_cast(asset); @@ -256,7 +250,7 @@ InteropSubtitleAsset::resolve_fonts (vector> assets) vector> -InteropSubtitleAsset::font_assets() +InteropTextAsset::font_assets() { vector> assets; for (auto const& i: _fonts) { @@ -268,7 +262,7 @@ InteropSubtitleAsset::font_assets() vector> -InteropSubtitleAsset::font_assets() const +InteropTextAsset::font_assets() const { vector> assets; for (auto const& i: _fonts) { @@ -280,11 +274,11 @@ InteropSubtitleAsset::font_assets() const void -InteropSubtitleAsset::add_to_assetmap (AssetMap& asset_map, boost::filesystem::path root) const +InteropTextAsset::add_to_assetmap(AssetMap& asset_map, boost::filesystem::path root) const { Asset::add_to_assetmap(asset_map, root); - for (auto i: _subtitles) { + for (auto i: _texts) { auto im = dynamic_pointer_cast(i); if (im) { DCP_ASSERT(im->file()); @@ -295,11 +289,11 @@ InteropSubtitleAsset::add_to_assetmap (AssetMap& asset_map, boost::filesystem::p void -InteropSubtitleAsset::add_to_pkl (shared_ptr pkl, boost::filesystem::path root) const +InteropTextAsset::add_to_pkl(shared_ptr pkl, boost::filesystem::path root) const { Asset::add_to_pkl (pkl, root); - for (auto i: _subtitles) { + for (auto i: _texts) { auto im = dynamic_pointer_cast (i); if (im) { auto png_image = im->png_image (); @@ -310,7 +304,7 @@ InteropSubtitleAsset::add_to_pkl (shared_ptr pkl, boost::filesystem::path r void -InteropSubtitleAsset::set_font_file (string load_id, boost::filesystem::path file) +InteropTextAsset::set_font_file(string load_id, boost::filesystem::path file) { for (auto& i: _fonts) { if (i.load_id == load_id) { @@ -327,7 +321,7 @@ InteropSubtitleAsset::set_font_file (string load_id, boost::filesystem::path fil vector -InteropSubtitleAsset::unresolved_fonts() const +InteropTextAsset::unresolved_fonts() const { vector unresolved; for (auto load_font_node: _load_font_nodes) { diff --git a/src/interop_subtitle_asset.h b/src/interop_text_asset.h similarity index 80% rename from src/interop_subtitle_asset.h rename to src/interop_text_asset.h index f63740d5..b2602224 100644 --- a/src/interop_subtitle_asset.h +++ b/src/interop_text_asset.h @@ -32,17 +32,17 @@ */ -/** @file src/interop_subtitle_asset.h - * @brief InteropSubtitleAsset class +/** @file src/interop_text_asset.h + * @brief InteropTextAsset class */ -#ifndef DCP_INTEROP_SUBTITLE_ASSET_H -#define DCP_INTEROP_SUBTITLE_ASSET_H +#ifndef DCP_INTEROP_TEXT_ASSET_H +#define DCP_INTEROP_TEXT_ASSET_H -#include "subtitle_asset.h" -#include "subtitle_standard.h" +#include "text_asset.h" +#include "text_standard.h" #include @@ -52,16 +52,16 @@ namespace dcp { class InteropLoadFontNode; -/** @class InteropSubtitleAsset - * @brief A set of subtitles to be read and/or written in the Inter-Op format +/** @class InteropTextAsset + * @brief A set of subtitles or closed captions to be read and/or written in the Inter-Op format * * Inter-Op subtitles are sometimes known as CineCanvas. */ -class InteropSubtitleAsset : public SubtitleAsset +class InteropTextAsset : public TextAsset { public: - InteropSubtitleAsset (); - explicit InteropSubtitleAsset (boost::filesystem::path file); + InteropTextAsset() = default; + explicit InteropTextAsset(boost::filesystem::path file); bool equals ( std::shared_ptr, @@ -93,38 +93,38 @@ public: std::vector unresolved_fonts() const; /** Set the reel number or sub-element identifier - * of these subtitles. + * of these subtitles / closed captions. * @param n New reel number. */ void set_reel_number (std::string n) { _reel_number = n; } - /** Set the language tag of these subtitles. + /** Set the language tag of these subtitles / closed captions. * @param l New language. */ void set_language (std::string l) { _language = l; } - /** @return title of the movie that the subtitles are for */ + /** @return title of the movie that the subtitles / closed captions are for */ void set_movie_title (std::string m) { _movie_title = m; } /** @return reel number or sub-element of a programme that - * these subtitles refer to. + * these subtitles / closed captions refer to. */ std::string reel_number () const { return _reel_number; } - /** @return language used in the subtitles */ + /** @return language used in the subtitles / closed captions */ std::string language () const { return _language; } - /** @return movie title that these subtitles are for */ + /** @return movie title that these subtitles / closed captions are for */ std::string movie_title () const { return _movie_title; } @@ -134,8 +134,8 @@ public: return 1000; } - SubtitleStandard subtitle_standard() const override { - return SubtitleStandard::INTEROP; + TextStandard text_standard() const override { + return TextStandard::INTEROP; } static std::string static_pkl_type (Standard) { diff --git a/src/reel.cc b/src/reel.cc index a8481d59..95769140 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -40,7 +40,7 @@ #include "decrypted_kdm.h" #include "decrypted_kdm_key.h" #include "equality_options.h" -#include "interop_subtitle_asset.h" +#include "interop_text_asset.h" #include "mono_picture_asset.h" #include "picture_asset.h" #include "reel.h" @@ -55,10 +55,10 @@ #include "reel_sound_asset.h" #include "reel_stereo_picture_asset.h" #include "reel_subtitle_asset.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" #include "sound_asset.h" #include "stereo_picture_asset.h" -#include "subtitle_asset.h" +#include "text_asset.h" #include "util.h" #include #include @@ -409,7 +409,7 @@ Reel::resolve_refs (vector> assets) /* Interop subtitle handling is all special cases */ if (_main_subtitle->asset_ref().resolved()) { - auto iop = dynamic_pointer_cast (_main_subtitle->asset_ref().asset()); + auto iop = dynamic_pointer_cast(_main_subtitle->asset_ref().asset()); if (iop) { iop->resolve_fonts (assets); } @@ -421,7 +421,7 @@ Reel::resolve_refs (vector> assets) /* Interop subtitle handling is all special cases */ if (i->asset_ref().resolved()) { - auto iop = dynamic_pointer_cast (i->asset_ref().asset()); + auto iop = dynamic_pointer_cast(i->asset_ref().asset()); if (iop) { iop->resolve_fonts (assets); } diff --git a/src/reel_closed_caption_asset.cc b/src/reel_closed_caption_asset.cc index e5649d6a..a9ba32f5 100644 --- a/src/reel_closed_caption_asset.cc +++ b/src/reel_closed_caption_asset.cc @@ -39,8 +39,8 @@ #include "dcp_assert.h" #include "reel_closed_caption_asset.h" -#include "smpte_subtitle_asset.h" -#include "subtitle_asset.h" +#include "smpte_text_asset.h" +#include "text_asset.h" #include "warnings.h" LIBDCP_DISABLE_WARNINGS #include @@ -53,10 +53,10 @@ using std::dynamic_pointer_cast; using namespace dcp; -ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) +ReelClosedCaptionAsset::ReelClosedCaptionAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelFileAsset ( asset, - dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : boost::none, + dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : boost::none, asset->id(), edit_rate, intrinsic_duration, diff --git a/src/reel_closed_caption_asset.h b/src/reel_closed_caption_asset.h index 405de34b..adc1e1eb 100644 --- a/src/reel_closed_caption_asset.h +++ b/src/reel_closed_caption_asset.h @@ -44,7 +44,7 @@ #include "language_tag.h" #include "reel_asset.h" #include "reel_file_asset.h" -#include "subtitle_asset.h" +#include "text_asset.h" struct verify_invalid_language2; @@ -59,15 +59,15 @@ namespace dcp { class ReelClosedCaptionAsset : public ReelFileAsset { public: - ReelClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelClosedCaptionAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelClosedCaptionAsset (std::shared_ptr); - std::shared_ptr asset () const { - return asset_of_type(); + std::shared_ptr asset () const { + return asset_of_type(); } - std::shared_ptr asset () { - return asset_of_type(); + std::shared_ptr asset () { + return asset_of_type(); } bool equals(std::shared_ptr, EqualityOptions const&, NoteHandler) const; diff --git a/src/reel_interop_closed_caption_asset.cc b/src/reel_interop_closed_caption_asset.cc index be968068..ea1b85c9 100644 --- a/src/reel_interop_closed_caption_asset.cc +++ b/src/reel_interop_closed_caption_asset.cc @@ -46,14 +46,13 @@ using std::string; using namespace dcp; -ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset (shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) +ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset(shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelClosedCaptionAsset (asset, edit_rate, intrinsic_duration, entry_point) { } - ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset (shared_ptr node) : ReelClosedCaptionAsset (node) { diff --git a/src/reel_interop_closed_caption_asset.h b/src/reel_interop_closed_caption_asset.h index 5e8f7c1e..7e1ee6c5 100644 --- a/src/reel_interop_closed_caption_asset.h +++ b/src/reel_interop_closed_caption_asset.h @@ -41,7 +41,7 @@ #define LIBDCP_REEL_INTEROP_CLOSED_CAPTION_ASSET_H -#include "interop_subtitle_asset.h" +#include "interop_text_asset.h" #include "reel_closed_caption_asset.h" @@ -51,15 +51,15 @@ namespace dcp { class ReelInteropClosedCaptionAsset : public ReelClosedCaptionAsset { public: - ReelInteropClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelInteropClosedCaptionAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelInteropClosedCaptionAsset (std::shared_ptr); - std::shared_ptr interop_asset () const { - return asset_of_type(); + std::shared_ptr interop_asset() const { + return asset_of_type(); } - std::shared_ptr interop_asset () { - return asset_of_type(); + std::shared_ptr interop_asset() { + return asset_of_type(); } xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; diff --git a/src/reel_interop_subtitle_asset.cc b/src/reel_interop_subtitle_asset.cc index 5f295d53..6b9ef79c 100644 --- a/src/reel_interop_subtitle_asset.cc +++ b/src/reel_interop_subtitle_asset.cc @@ -50,7 +50,7 @@ using boost::optional; using namespace dcp; -ReelInteropSubtitleAsset::ReelInteropSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) +ReelInteropSubtitleAsset::ReelInteropSubtitleAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelSubtitleAsset (asset, edit_rate, intrinsic_duration, entry_point) { diff --git a/src/reel_interop_subtitle_asset.h b/src/reel_interop_subtitle_asset.h index 7e90e9e0..1a7da9d4 100644 --- a/src/reel_interop_subtitle_asset.h +++ b/src/reel_interop_subtitle_asset.h @@ -32,12 +32,12 @@ */ -/** @file src/reel_interop_subtitle_asset.h - * @brief ReelInteropSubtitleAsset class +/** @file src/reel_interop_text_asset.h + * @brief ReelInteropTextAsset class */ -#include "interop_subtitle_asset.h" +#include "interop_text_asset.h" #include "reel_file_asset.h" #include "reel_subtitle_asset.h" @@ -51,15 +51,15 @@ namespace dcp { class ReelInteropSubtitleAsset : public ReelSubtitleAsset { public: - ReelInteropSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelInteropSubtitleAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelInteropSubtitleAsset (std::shared_ptr); - std::shared_ptr interop_asset () const { - return asset_of_type(); + std::shared_ptr interop_asset () const { + return asset_of_type(); } - std::shared_ptr interop_asset () { - return asset_of_type(); + std::shared_ptr interop_asset () { + return asset_of_type(); } }; diff --git a/src/reel_smpte_closed_caption_asset.cc b/src/reel_smpte_closed_caption_asset.cc index a2a68202..22f23b8e 100644 --- a/src/reel_smpte_closed_caption_asset.cc +++ b/src/reel_smpte_closed_caption_asset.cc @@ -51,7 +51,7 @@ using std::string; using namespace dcp; -ReelSMPTEClosedCaptionAsset::ReelSMPTEClosedCaptionAsset (shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) +ReelSMPTEClosedCaptionAsset::ReelSMPTEClosedCaptionAsset(shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelClosedCaptionAsset (asset, edit_rate, intrinsic_duration, entry_point) { diff --git a/src/reel_smpte_closed_caption_asset.h b/src/reel_smpte_closed_caption_asset.h index 32a79efd..e4eb4f64 100644 --- a/src/reel_smpte_closed_caption_asset.h +++ b/src/reel_smpte_closed_caption_asset.h @@ -43,7 +43,7 @@ #include "reel_file_asset.h" #include "reel_closed_caption_asset.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" namespace dcp { @@ -52,15 +52,15 @@ namespace dcp { class ReelSMPTEClosedCaptionAsset : public ReelClosedCaptionAsset { public: - ReelSMPTEClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelSMPTEClosedCaptionAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelSMPTEClosedCaptionAsset (std::shared_ptr); - std::shared_ptr smpte_asset () { - return asset_of_type(); + std::shared_ptr smpte_asset() { + return asset_of_type(); } - std::shared_ptr smpte_asset () const { - return asset_of_type(); + std::shared_ptr smpte_asset() const { + return asset_of_type(); } xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; diff --git a/src/reel_smpte_subtitle_asset.cc b/src/reel_smpte_subtitle_asset.cc index 64440547..80762269 100644 --- a/src/reel_smpte_subtitle_asset.cc +++ b/src/reel_smpte_subtitle_asset.cc @@ -38,7 +38,7 @@ #include "reel_smpte_subtitle_asset.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" #include "warnings.h" LIBDCP_DISABLE_WARNINGS #include @@ -51,7 +51,7 @@ using boost::optional; using namespace dcp; -ReelSMPTESubtitleAsset::ReelSMPTESubtitleAsset (shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) +ReelSMPTESubtitleAsset::ReelSMPTESubtitleAsset(shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelSubtitleAsset (asset, edit_rate, intrinsic_duration, entry_point) { diff --git a/src/reel_smpte_subtitle_asset.h b/src/reel_smpte_subtitle_asset.h index 2a097309..d2ba3fd4 100644 --- a/src/reel_smpte_subtitle_asset.h +++ b/src/reel_smpte_subtitle_asset.h @@ -38,13 +38,13 @@ #include "reel_subtitle_asset.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" namespace dcp { -class SMPTESubtitleAsset; +class SMPTETextAsset; /** @class ReelSMPTESubtitleAsset @@ -53,15 +53,15 @@ class SMPTESubtitleAsset; class ReelSMPTESubtitleAsset : public ReelSubtitleAsset { public: - ReelSMPTESubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelSMPTESubtitleAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelSMPTESubtitleAsset (std::shared_ptr); - std::shared_ptr smpte_asset () const { - return asset_of_type(); + std::shared_ptr smpte_asset() const { + return asset_of_type(); } - std::shared_ptr smpte_asset () { - return asset_of_type(); + std::shared_ptr smpte_asset() { + return asset_of_type(); } private: diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index d856a05e..6e091c81 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -39,8 +39,8 @@ #include "language_tag.h" #include "reel_subtitle_asset.h" -#include "smpte_subtitle_asset.h" -#include "subtitle_asset.h" +#include "smpte_text_asset.h" +#include "text_asset.h" #include "warnings.h" LIBDCP_DISABLE_WARNINGS #include @@ -54,10 +54,10 @@ using boost::optional; using namespace dcp; -ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) +ReelSubtitleAsset::ReelSubtitleAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelFileAsset ( asset, - dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : boost::none, + dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : boost::none, asset->id(), edit_rate, intrinsic_duration, diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h index 8b694fd6..7bc38a0f 100644 --- a/src/reel_subtitle_asset.h +++ b/src/reel_subtitle_asset.h @@ -44,7 +44,7 @@ #include "language_tag.h" #include "reel_asset.h" #include "reel_file_asset.h" -#include "subtitle_asset.h" +#include "text_asset.h" struct verify_invalid_language1; @@ -53,7 +53,7 @@ struct verify_invalid_language1; namespace dcp { -class SubtitleAsset; +class TextAsset; /** @class ReelSubtitleAsset @@ -62,15 +62,15 @@ class SubtitleAsset; class ReelSubtitleAsset : public ReelFileAsset { public: - ReelSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelSubtitleAsset(std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelSubtitleAsset (std::shared_ptr); - std::shared_ptr asset () const { - return asset_of_type(); + std::shared_ptr asset() const { + return asset_of_type(); } - std::shared_ptr asset () { - return asset_of_type(); + std::shared_ptr asset() { + return asset_of_type(); } xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_text_asset.cc similarity index 83% rename from src/smpte_subtitle_asset.cc rename to src/smpte_text_asset.cc index 0ff1d7ef..d373f86d 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_text_asset.cc @@ -45,7 +45,7 @@ #include "filesystem.h" #include "raw_convert.h" #include "smpte_load_font_node.h" -#include "smpte_subtitle_asset.h" +#include "smpte_text_asset.h" #include "subtitle_image.h" #include "util.h" #include "warnings.h" @@ -79,19 +79,19 @@ static string const subtitle_smpte_ns_2010 = "http://www.smpte-ra.org/schemas/42 static string const subtitle_smpte_ns_2014 = "http://www.smpte-ra.org/schemas/428-7/2014/DCST"; -SMPTESubtitleAsset::SMPTESubtitleAsset(SubtitleStandard standard) +SMPTETextAsset::SMPTETextAsset(TextStandard standard) : MXF(Standard::SMPTE) , _edit_rate (24, 1) , _time_code_rate (24) - , _subtitle_standard(standard) + , _text_standard(standard) , _xml_id (make_uuid()) { } -SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) - : SubtitleAsset (file) +SMPTETextAsset::SMPTETextAsset(boost::filesystem::path file) + : TextAsset(file) { auto xml = make_shared("SubtitleReel"); @@ -139,7 +139,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (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) { + for (auto i: _texts) { auto im = dynamic_pointer_cast(i); if (im && im->png_image().size() == 0) { /* Even more dubious; allow .png or urn:uuid:.png */ @@ -158,7 +158,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) } /* Check that all required image data have been found */ - for (auto i: _subtitles) { + for (auto i: _texts) { auto im = dynamic_pointer_cast(i); if (im && im->png_image().size() == 0) { throw MissingSubtitleImageError (im->id()); @@ -168,16 +168,16 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) void -SMPTESubtitleAsset::parse_xml (shared_ptr xml) +SMPTETextAsset::parse_xml(shared_ptr xml) { if (xml->namespace_uri() == subtitle_smpte_ns_2007) { - _subtitle_standard = SubtitleStandard::SMPTE_2007; + _text_standard = TextStandard::SMPTE_2007; } else if (xml->namespace_uri() == subtitle_smpte_ns_2010) { - _subtitle_standard = SubtitleStandard::SMPTE_2010; + _text_standard = TextStandard::SMPTE_2010; } else if (xml->namespace_uri() == subtitle_smpte_ns_2014) { - _subtitle_standard = SubtitleStandard::SMPTE_2014; + _text_standard = TextStandard::SMPTE_2014; } else { - throw XMLError("Unrecognised subtitle namespace " + xml->namespace_uri()); + throw XMLError("Unrecognised subtitle or closed caption namespace " + xml->namespace_uri()); } _xml_id = remove_urn_uuid(xml->string_child("Id")); _load_font_nodes = type_children (xml, "LoadFont"); @@ -211,17 +211,17 @@ SMPTESubtitleAsset::parse_xml (shared_ptr xml) for (auto i: xml->node()->get_children()) { auto const e = dynamic_cast(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); } void -SMPTESubtitleAsset::read_mxf_resources (shared_ptr reader, shared_ptr dec) +SMPTETextAsset::read_mxf_resources(shared_ptr reader, shared_ptr dec) { ASDCP::TimedText::TimedTextDescriptor descriptor; reader->FillTimedTextDescriptor (descriptor); @@ -265,12 +265,12 @@ SMPTESubtitleAsset::read_mxf_resources (shared_ptr } case ASDCP::TimedText::MT_PNG: { - auto j = _subtitles.begin(); - while (j != _subtitles.end() && ((!dynamic_pointer_cast(*j)) || dynamic_pointer_cast(*j)->id() != id)) { + auto j = _texts.begin(); + while (j != _texts.end() && ((!dynamic_pointer_cast(*j)) || dynamic_pointer_cast(*j)->id() != id)) { ++j; } - if (j != _subtitles.end()) { + if (j != _texts.end()) { dynamic_pointer_cast(*j)->set_png_image(ArrayData(buffer.RoData(), buffer.Size())); } break; @@ -283,7 +283,7 @@ SMPTESubtitleAsset::read_mxf_resources (shared_ptr void -SMPTESubtitleAsset::read_mxf_descriptor (shared_ptr reader) +SMPTETextAsset::read_mxf_descriptor(shared_ptr reader) { ASDCP::TimedText::TimedTextDescriptor descriptor; reader->FillTimedTextDescriptor (descriptor); @@ -300,7 +300,7 @@ SMPTESubtitleAsset::read_mxf_descriptor (shared_ptr void -SMPTESubtitleAsset::set_key (Key key) +SMPTETextAsset::set_key(Key key) { /* See if we already have a key; if we do, and we have a file, we'll already have read that file. @@ -343,7 +343,7 @@ SMPTESubtitleAsset::set_key (Key key) vector> -SMPTESubtitleAsset::load_font_nodes () const +SMPTETextAsset::load_font_nodes() const { vector> lf; copy (_load_font_nodes.begin(), _load_font_nodes.end(), back_inserter(lf)); @@ -352,7 +352,7 @@ SMPTESubtitleAsset::load_font_nodes () const bool -SMPTESubtitleAsset::valid_mxf (boost::filesystem::path file) +SMPTETextAsset::valid_mxf(boost::filesystem::path file) { ASDCP::TimedText::MXFReader reader; Kumu::DefaultLogSink().UnsetFilterFlag(Kumu::LOG_ALLOW_ALL); @@ -363,7 +363,7 @@ SMPTESubtitleAsset::valid_mxf (boost::filesystem::path file) string -SMPTESubtitleAsset::xml_as_string () const +SMPTETextAsset::xml_as_string() const { xmlpp::Document doc; auto root = doc.create_root_node ("SubtitleReel"); @@ -393,14 +393,14 @@ SMPTESubtitleAsset::xml_as_string () const load_font->set_attribute ("ID", i->id); } - subtitles_as_xml (root->add_child("SubtitleList"), _time_code_rate, Standard::SMPTE); + texts_as_xml(root->add_child("SubtitleList"), _time_code_rate, Standard::SMPTE); return format_xml(doc, std::make_pair(string{}, schema_namespace())); } void -SMPTESubtitleAsset::write (boost::filesystem::path p) const +SMPTETextAsset::write(boost::filesystem::path p) const { EncryptionContext enc (key(), Standard::SMPTE); @@ -430,7 +430,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const /* Image subtitle references */ - for (auto i: _subtitles) { + for (auto i: _texts) { auto si = dynamic_pointer_cast(i); if (si) { ASDCP::TimedText::TimedTextResourceDescriptor res; @@ -453,7 +453,7 @@ SMPTESubtitleAsset::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)); } @@ -486,7 +486,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const /* Image subtitle payload */ - for (auto i: _subtitles) { + for (auto i: _texts) { auto si = dynamic_pointer_cast(i); if (si) { ASDCP::TimedText::FrameBuffer buffer; @@ -505,15 +505,15 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const } bool -SMPTESubtitleAsset::equals(shared_ptr other_asset, EqualityOptions const& options, NoteHandler note) const +SMPTETextAsset::equals(shared_ptr other_asset, EqualityOptions const& options, NoteHandler note) const { - if (!SubtitleAsset::equals (other_asset, options, note)) { + if (!TextAsset::equals (other_asset, options, note)) { return false; } - auto other = dynamic_pointer_cast(other_asset); + auto other = dynamic_pointer_cast(other_asset); if (!other) { - note (NoteType::ERROR, "Subtitles are in different standards"); + note(NoteType::ERROR, "subtitles or closed captions are in different standards"); return false; } @@ -536,46 +536,46 @@ SMPTESubtitleAsset::equals(shared_ptr other_asset, EqualityOptions } if (_content_title_text != other->_content_title_text) { - note (NoteType::ERROR, "Subtitle content title texts differ"); + note(NoteType::ERROR, "Subtitle / closed 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 / closed 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 / closed 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 / closed caption issue dates differ"); } else { - note (NoteType::ERROR, "Subtitle issue dates differ"); + note(NoteType::ERROR, "Subtitle / closed caption issue dates differ"); return false; } } if (_reel_number != other->_reel_number) { - note (NoteType::ERROR, "Subtitle reel numbers differ"); + note(NoteType::ERROR, "Subtitle / closed caption reel numbers differ"); return false; } if (_edit_rate != other->_edit_rate) { - note (NoteType::ERROR, "Subtitle edit rates differ"); + note(NoteType::ERROR, "Subtitle / closed 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 / closed caption time code rates differ"); return false; } if (_start_time != other->_start_time) { - note (NoteType::ERROR, "Subtitle start times differ"); + note(NoteType::ERROR, "Subtitle / closed caption start times differ"); return false; } @@ -584,7 +584,7 @@ SMPTESubtitleAsset::equals(shared_ptr other_asset, EqualityOptions void -SMPTESubtitleAsset::add_font (string load_id, dcp::ArrayData data) +SMPTETextAsset::add_font(string load_id, dcp::ArrayData data) { string const uuid = make_uuid (); _fonts.push_back (Font(load_id, uuid, data)); @@ -593,22 +593,22 @@ SMPTESubtitleAsset::add_font (string load_id, dcp::ArrayData data) void -SMPTESubtitleAsset::add (shared_ptr s) +SMPTETextAsset::add(shared_ptr s) { - SubtitleAsset::add (s); - _intrinsic_duration = latest_subtitle_out().as_editable_units_ceil(_edit_rate.numerator / _edit_rate.denominator); + TextAsset::add(s); + _intrinsic_duration = latest_text_out().as_editable_units_ceil(_edit_rate.numerator / _edit_rate.denominator); } string -SMPTESubtitleAsset::schema_namespace() const +SMPTETextAsset::schema_namespace() const { - switch (_subtitle_standard) { - case SubtitleStandard::SMPTE_2007: + switch (_text_standard) { + case TextStandard::SMPTE_2007: return subtitle_smpte_ns_2007; - case SubtitleStandard::SMPTE_2010: + case TextStandard::SMPTE_2010: return subtitle_smpte_ns_2010; - case SubtitleStandard::SMPTE_2014: + case TextStandard::SMPTE_2014: return subtitle_smpte_ns_2014; default: DCP_ASSERT(false); diff --git a/src/smpte_subtitle_asset.h b/src/smpte_text_asset.h similarity index 87% rename from src/smpte_subtitle_asset.h rename to src/smpte_text_asset.h index 26144fe1..b052fa79 100644 --- a/src/smpte_subtitle_asset.h +++ b/src/smpte_text_asset.h @@ -32,12 +32,12 @@ */ -#ifndef LIBDCP_SMPTE_SUBTITLE_ASSET_H -#define LIBDCP_SMPTE_SUBTITLE_ASSET_H +#ifndef LIBDCP_SMPTE_TEXT_ASSET_H +#define LIBDCP_SMPTE_TEXT_ASSET_H -/** @file src/smpte_subtitle_asset.h - * @brief SMPTESubtitleAsset class +/** @file src/smpte_text_asset.h + * @brief SMPTETextAsset class */ @@ -45,8 +45,8 @@ #include "language_tag.h" #include "local_time.h" #include "mxf.h" -#include "subtitle_asset.h" -#include "subtitle_standard.h" +#include "text_asset.h" +#include "text_standard.h" #include @@ -69,18 +69,18 @@ namespace dcp { class SMPTELoadFontNode; -/** @class SMPTESubtitleAsset - * @brief A set of subtitles to be read and/or written in the SMPTE format +/** @class SMPTETextAsset + * @brief A set of subtitles or closed captions to be read and/or written in the SMPTE format */ -class SMPTESubtitleAsset : public SubtitleAsset, public MXF +class SMPTETextAsset : public TextAsset, public MXF { public: - explicit SMPTESubtitleAsset(SubtitleStandard standard = SubtitleStandard::SMPTE_2014); + explicit SMPTETextAsset(TextStandard standard = TextStandard::SMPTE_2014); - /** Construct a SMPTESubtitleAsset by reading an MXF or XML file + /** Construct a SMPTETextAsset by reading an MXF or XML file * @param file Filename */ - explicit SMPTESubtitleAsset (boost::filesystem::path file); + explicit SMPTETextAsset(boost::filesystem::path file); bool equals ( std::shared_ptr, @@ -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) override; + void add(std::shared_ptr) 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 / closed captions are for, * to be presented to the user */ std::string content_title_text () const { @@ -167,7 +167,7 @@ public: return _edit_rate; } - /** @return subdivision of 1 second that is used for subtitle times; + /** @return subdivision of 1 second that is used for subtitle / closed caption times; * e.g. a time_code_rate of 250 means that a subtitle time of 0:0:0:001 * represents 4ms. */ @@ -191,8 +191,8 @@ public: return _resource_id; } - SubtitleStandard subtitle_standard() const override { - return _subtitle_standard; + TextStandard text_standard() const override { + return _text_standard; } static bool valid_mxf (boost::filesystem::path); @@ -236,12 +236,12 @@ private: Fraction _edit_rate; int _time_code_rate = 0; boost::optional