diff options
49 files changed, 223 insertions, 216 deletions
@@ -534,7 +534,7 @@ def make_spec(filename, version, target, options, requires=None): print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f) def dependencies(target, options): - deps = [('libdcp', 'v1.9.14', {'c++17': target.platform == 'osx'})] + deps = [('libdcp', 'v1.9.15', {'c++17': target.platform == 'osx'})] deps.append(('libsub', 'v1.6.49')) deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23')) deps.append(('rtaudio', 'f619b76')) diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index dfa1ba55e..bac41f940 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -41,7 +41,7 @@ #include "compose.hpp" #include <libcxml/cxml.h> #include <dcp/filesystem.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/smpte_text_asset.h> #include <boost/algorithm/string.hpp> #include "i18n.h" @@ -178,7 +178,7 @@ content_factory (boost::filesystem::path path) throw KDMAsContentError (); } single = make_shared<DCPSubtitleContent>(path); - } else if (ext == ".mxf" && dcp::SMPTESubtitleAsset::valid_mxf(path)) { + } else if (ext == ".mxf" && dcp::SMPTETextAsset::valid_mxf(path)) { single = make_shared<DCPSubtitleContent>(path); } else if (ext == ".mxf" && VideoMXFContent::valid_mxf(path)) { single = make_shared<VideoMXFContent>(path); diff --git a/src/lib/content_text.h b/src/lib/content_text.h index 51d4e8009..4b59ac65f 100644 --- a/src/lib/content_text.h +++ b/src/lib/content_text.h @@ -27,7 +27,7 @@ #include "dcpomatic_time.h" #include "rect.h" #include "string_text.h" -#include <dcp/subtitle_string.h> +#include <dcp/text_string.h> #include <vector> diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 35b175736..b61138577 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -36,9 +36,8 @@ #include <dcp/dcp.h> #include <dcp/raw_convert.h> #include <dcp/exceptions.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_picture_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/reel.h> #include <dcp/scope_guard.h> #include <libxml++/libxml++.h> diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index abbaaf15d..cd792c0b7 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -45,17 +45,16 @@ #include <dcp/mono_mpeg2_picture_asset.h> #include <dcp/reel.h> #include <dcp/reel_atmos_asset.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/search.h> #include <dcp/sound_asset_reader.h> #include <dcp/sound_frame.h> #include <dcp/stereo_j2k_picture_asset.h> #include <dcp/stereo_j2k_picture_asset_reader.h> #include <dcp/stereo_j2k_picture_frame.h> -#include <dcp/subtitle_image.h> +#include <dcp/text_image.h> #include <iostream> #include "i18n.h" @@ -318,7 +317,7 @@ DCPDecoder::pass_texts (ContentTime next, dcp::Size size) void DCPDecoder::pass_texts ( - ContentTime next, shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size + ContentTime next, shared_ptr<dcp::TextAsset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size ) { auto const vfr = _dcp_content->active_video_frame_rate (film()); @@ -326,16 +325,16 @@ DCPDecoder::pass_texts ( auto const frame = next.frames_round (vfr); if (_decode_referenced || !reference) { - auto subs = asset->subtitles_during ( + auto subs = asset->texts_during( dcp::Time (entry_point + frame, vfr, vfr), dcp::Time (entry_point + frame + 1, vfr, vfr), true ); - vector<dcp::SubtitleString> strings; + vector<dcp::TextString> strings; for (auto i: subs) { - auto is = dynamic_pointer_cast<const dcp::SubtitleString>(i); + auto is = dynamic_pointer_cast<const dcp::TextString>(i); if (is) { if (!strings.empty() && (strings.back().in() != is->in() || strings.back().out() != is->out())) { auto b = strings.back(); @@ -350,7 +349,7 @@ DCPDecoder::pass_texts ( strings.clear (); } - dcp::SubtitleString is_copy = *is; + auto is_copy = *is; if (is_copy.font()) { is_copy.set_font(_font_id_allocator.font_id(_reel - _reels.begin(), asset->id(), is_copy.font().get())); } else { @@ -363,7 +362,7 @@ DCPDecoder::pass_texts ( this would need to be done both here and in DCPSubtitleDecoder. */ - auto ii = dynamic_pointer_cast<const dcp::SubtitleImage>(i); + auto ii = dynamic_pointer_cast<const dcp::TextImage>(i); if (ii) { emit_subtitle_image ( ContentTimePeriod ( diff --git a/src/lib/dcp_decoder.h b/src/lib/dcp_decoder.h index ee0f30694..56a13874b 100644 --- a/src/lib/dcp_decoder.h +++ b/src/lib/dcp_decoder.h @@ -32,7 +32,7 @@ #include <dcp/mono_mpeg2_picture_asset_reader.h> #include <dcp/mpeg2_transcode.h> #include <dcp/sound_asset_reader.h> -#include <dcp/subtitle_asset.h> +#include <dcp/text_asset.h> namespace dcp { @@ -79,7 +79,7 @@ private: void pass_texts (dcpomatic::ContentTime next, dcp::Size size); void pass_texts ( dcpomatic::ContentTime next, - std::shared_ptr<dcp::SubtitleAsset> asset, + std::shared_ptr<dcp::TextAsset> asset, bool reference, int64_t entry_point, std::shared_ptr<TextDecoder> decoder, diff --git a/src/lib/dcp_digest_file.cc b/src/lib/dcp_digest_file.cc index 4278caa98..57e87bd6f 100644 --- a/src/lib/dcp_digest_file.cc +++ b/src/lib/dcp_digest_file.cc @@ -24,9 +24,9 @@ #include <dcp/mxf.h> #include <dcp/reel.h> #include <dcp/reel_picture_asset.h> +#include <dcp/reel_smpte_text_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> -#include <dcp/reel_smpte_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> @@ -80,7 +80,7 @@ write_dcp_digest_file ( if (in_reel->main_sound()) { add_asset(film_key, in_reel->main_sound(), in_reel->main_sound()->asset(), out_reel, "MainSound"); } - if (auto smpte_sub = dynamic_pointer_cast<dcp::ReelSMPTESubtitleAsset>(in_reel->main_subtitle())) { + if (auto smpte_sub = dynamic_pointer_cast<dcp::ReelSMPTETextAsset>(in_reel->main_subtitle())) { add_asset(film_key, smpte_sub, smpte_sub->smpte_asset(), out_reel, "MainSubtitle"); } } diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index a7af9feca..3f8b4ca90 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -39,11 +39,10 @@ #include <dcp/mpeg2_transcode.h> #include <dcp/reel.h> #include <dcp/reel_atmos_asset.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_markers_asset.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/search.h> #include <dcp/sound_asset.h> #include <dcp/sound_asset.h> @@ -51,7 +50,7 @@ #include <dcp/stereo_j2k_picture_asset.h> #include <dcp/stereo_j2k_picture_asset_reader.h> #include <dcp/stereo_j2k_picture_frame.h> -#include <dcp/subtitle_asset.h> +#include <dcp/text_asset.h> #include <iostream> #include "i18n.h" @@ -343,7 +342,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant) LOG_GENERAL_NC ("Subtitle has no key"); break; } - sub->subtitles (); + sub->texts(); } if (i->atmos() && i->atmos()->asset_ref().resolved()) { diff --git a/src/lib/dcp_subtitle.cc b/src/lib/dcp_subtitle.cc index c2c3f7f70..c2d390b55 100644 --- a/src/lib/dcp_subtitle.cc +++ b/src/lib/dcp_subtitle.cc @@ -22,8 +22,8 @@ #include "dcp_subtitle.h" #include "exceptions.h" #include "compose.hpp" -#include <dcp/interop_subtitle_asset.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/interop_text_asset.h> +#include <dcp/smpte_text_asset.h> #include <memory> #include "i18n.h" @@ -35,22 +35,22 @@ using std::string; using std::make_shared; -shared_ptr<dcp::SubtitleAsset> +shared_ptr<dcp::TextAsset> DCPSubtitle::load (boost::filesystem::path file) const { - shared_ptr<dcp::SubtitleAsset> sc; + shared_ptr<dcp::TextAsset> sc; string interop_error; string smpte_error; try { - sc = make_shared<dcp::InteropSubtitleAsset>(file); + sc = make_shared<dcp::InteropTextAsset>(file); } catch (exception& e) { interop_error = e.what (); } if (!sc) { try { - sc = make_shared<dcp::SMPTESubtitleAsset>(file); + sc = make_shared<dcp::SMPTETextAsset>(file); } catch (exception& e) { smpte_error = e.what(); } diff --git a/src/lib/dcp_subtitle.h b/src/lib/dcp_subtitle.h index 285dd55bc..0f7928103 100644 --- a/src/lib/dcp_subtitle.h +++ b/src/lib/dcp_subtitle.h @@ -28,14 +28,14 @@ namespace dcp { - class SubtitleAsset; + class TextAsset; } class DCPSubtitle { protected: - std::shared_ptr<dcp::SubtitleAsset> load (boost::filesystem::path) const; + std::shared_ptr<dcp::TextAsset> load(boost::filesystem::path) const; }; diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index 58007ac34..cbd8638f3 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -25,9 +25,9 @@ #include "font_id_allocator.h" #include "text_content.h" #include <dcp/interop_load_font_node.h> -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <dcp/raw_convert.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/smpte_text_asset.h> #include <libxml++/libxml++.h> #include "i18n.h" @@ -64,8 +64,8 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) auto subtitle_asset = load(path(0)); - auto iop = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(subtitle_asset); - auto smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(subtitle_asset); + auto iop = dynamic_pointer_cast<dcp::InteropTextAsset>(subtitle_asset); + auto smpte = dynamic_pointer_cast<dcp::SMPTETextAsset>(subtitle_asset); if (smpte) { set_video_frame_rate(film, smpte->edit_rate().numerator); } @@ -75,7 +75,7 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) /* Default to turning these subtitles on */ only_text()->set_use (true); - _length = ContentTime::from_seconds(subtitle_asset->latest_subtitle_out().as_seconds()); + _length = ContentTime::from_seconds(subtitle_asset->latest_text_out().as_seconds()); subtitle_asset->fix_empty_font_ids(); add_fonts(only_text(), subtitle_asset); @@ -83,7 +83,7 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) void -DCPSubtitleContent::add_fonts(shared_ptr<TextContent> content, shared_ptr<dcp::SubtitleAsset> subtitle_asset) +DCPSubtitleContent::add_fonts(shared_ptr<TextContent> content, shared_ptr<dcp::TextAsset> subtitle_asset) { FontIDAllocator font_id_allocator; diff --git a/src/lib/dcp_subtitle_content.h b/src/lib/dcp_subtitle_content.h index a3cd78b39..53b2eaf5c 100644 --- a/src/lib/dcp_subtitle_content.h +++ b/src/lib/dcp_subtitle_content.h @@ -42,7 +42,7 @@ public: dcpomatic::DCPTime approximate_length () const override; private: - void add_fonts(std::shared_ptr<TextContent> content, std::shared_ptr<dcp::SubtitleAsset> subtitle_asset); + void add_fonts(std::shared_ptr<TextContent> content, std::shared_ptr<dcp::TextAsset> subtitle_asset); dcpomatic::ContentTime _length; }; diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 711dc77f2..95e80ac19 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -25,7 +25,7 @@ #include "font.h" #include "text_content.h" #include "util.h" -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <dcp/load_font_node.h> @@ -45,7 +45,7 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr< /* Load the XML or MXF file */ _asset = load(content->path(0)); _asset->fix_empty_font_ids(); - _subtitles = _asset->subtitles(); + _subtitles = _asset->texts(); _next = _subtitles.begin (); _subtitle_standard = _asset->subtitle_standard(); @@ -91,14 +91,14 @@ DCPSubtitleDecoder::pass () time of emitting the first. */ - vector<dcp::SubtitleString> s; - vector<dcp::SubtitleImage> i; + vector<dcp::TextString> s; + vector<dcp::TextImage> i; auto const p = content_time_period (*_next); while (_next != _subtitles.end () && content_time_period (*_next) == p) { - auto ns = dynamic_pointer_cast<const dcp::SubtitleString>(*_next); + auto ns = dynamic_pointer_cast<const dcp::TextString>(*_next); if (ns) { - dcp::SubtitleString ns_copy = *ns; + auto ns_copy = *ns; if (ns_copy.font()) { ns_copy.set_font(_font_id_allocator.font_id(0, _asset->id(), ns_copy.font().get())); } else { @@ -111,7 +111,7 @@ DCPSubtitleDecoder::pass () this would need to be done both here and in DCPDecoder. */ - auto ni = dynamic_pointer_cast<const dcp::SubtitleImage>(*_next); + auto ni = dynamic_pointer_cast<const dcp::TextImage>(*_next); if (ni) { emit_subtitle_image (p, *ni, film()->frame_size(), only_text()); ++_next; @@ -128,7 +128,7 @@ DCPSubtitleDecoder::pass () ContentTimePeriod -DCPSubtitleDecoder::content_time_period (shared_ptr<const dcp::Subtitle> s) const +DCPSubtitleDecoder::content_time_period(shared_ptr<const dcp::Text> s) const { return { ContentTime::from_seconds(s->in().as_seconds()), diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h index 9d0851253..f11fc3044 100644 --- a/src/lib/dcp_subtitle_decoder.h +++ b/src/lib/dcp_subtitle_decoder.h @@ -38,14 +38,14 @@ public: boost::optional<dcpomatic::ContentTime> first () const; private: - dcpomatic::ContentTimePeriod content_time_period (std::shared_ptr<const dcp::Subtitle> s) const; + dcpomatic::ContentTimePeriod content_time_period(std::shared_ptr<const dcp::Text> s) const; void update_position(); - std::vector<std::shared_ptr<const dcp::Subtitle>> _subtitles; - std::vector<std::shared_ptr<const dcp::Subtitle>>::const_iterator _next; + std::vector<std::shared_ptr<const dcp::Text>> _subtitles; + std::vector<std::shared_ptr<const dcp::Text>>::const_iterator _next; dcp::SubtitleStandard _subtitle_standard; - std::shared_ptr<dcp::SubtitleAsset> _asset; + std::shared_ptr<dcp::TextAsset> _asset; FontIDAllocator _font_id_allocator; }; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 29ab5aaf8..9713a26f6 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -45,7 +45,7 @@ #include "util.h" #include "video_decoder.h" #include "video_filter_graph.h" -#include <dcp/subtitle_string.h> +#include <dcp/text_string.h> #include <sub/ssa_reader.h> #include <sub/subtitle.h> #include <sub/collect.h> diff --git a/src/lib/font_id_allocator.cc b/src/lib/font_id_allocator.cc index d5430e858..b85fc90dc 100644 --- a/src/lib/font_id_allocator.cc +++ b/src/lib/font_id_allocator.cc @@ -24,9 +24,8 @@ #include "dcpomatic_assert.h" #include "font_id_allocator.h" #include <dcp/reel.h> -#include <dcp/reel_closed_caption_asset.h> -#include <dcp/reel_subtitle_asset.h> -#include <dcp/subtitle_asset.h> +#include <dcp/reel_text_asset.h> +#include <dcp/text_asset.h> #include <set> #include <string> #include <vector> @@ -61,7 +60,7 @@ FontIDAllocator::add_fonts_from_reels(vector<shared_ptr<dcp::Reel>> const& reels void -FontIDAllocator::add_fonts_from_asset(int reel_index, shared_ptr<const dcp::SubtitleAsset> asset) +FontIDAllocator::add_fonts_from_asset(int reel_index, shared_ptr<const dcp::TextAsset> asset) { for (auto const& font: asset->font_data()) { add_font(reel_index, asset->id(), font.first); diff --git a/src/lib/font_id_allocator.h b/src/lib/font_id_allocator.h index 6737907c1..2a242a8cf 100644 --- a/src/lib/font_id_allocator.h +++ b/src/lib/font_id_allocator.h @@ -32,7 +32,7 @@ namespace dcp { class Reel; - class SubtitleAsset; + class TextAsset; } @@ -74,7 +74,7 @@ public: } private: - void add_fonts_from_asset(int reel_index, std::shared_ptr<const dcp::SubtitleAsset> asset); + void add_fonts_from_asset(int reel_index, std::shared_ptr<const dcp::TextAsset> asset); struct Font { diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 1114d0acb..9a947f98d 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -42,8 +42,7 @@ #include <dcp/filesystem.h> #include <dcp/raw_convert.h> #include <dcp/reel.h> -#include <dcp/reel_closed_caption_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <boost/algorithm/string.hpp> #include <iostream> @@ -372,7 +371,7 @@ Hints::check_loudness () static bool -subtitle_mxf_too_big (shared_ptr<dcp::SubtitleAsset> asset) +subtitle_mxf_too_big(shared_ptr<dcp::TextAsset> asset) { return asset && asset->file() && dcp::filesystem::file_size(*asset->file()) >= (MAX_TEXT_MXF_SIZE - SIZE_SLACK); } diff --git a/src/lib/map_cli.cc b/src/lib/map_cli.cc index be3841deb..149e09fbc 100644 --- a/src/lib/map_cli.cc +++ b/src/lib/map_cli.cc @@ -24,18 +24,17 @@ #include "util.h" #include <dcp/cpl.h> #include <dcp/dcp.h> -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <dcp/filesystem.h> #include <dcp/font_asset.h> #include <dcp/mono_j2k_picture_asset.h> #include <dcp/reel.h> #include <dcp/reel_atmos_asset.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_file_asset.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/reel_text_asset.h> +#include <dcp/smpte_text_asset.h> #include <dcp/sound_asset.h> #include <dcp/stereo_j2k_picture_asset.h> #include <boost/optional.hpp> @@ -292,16 +291,16 @@ map_cli(int argc, char* argv[], std::function<void (string)> out) } }; - auto maybe_copy_font_and_images = [&maybe_copy, output_dir, copy](shared_ptr<const dcp::SubtitleAsset> asset, bool rename, bool hard_link, bool soft_link) { - auto interop = dynamic_pointer_cast<const dcp::InteropSubtitleAsset>(asset); + auto maybe_copy_font_and_images = [&maybe_copy, output_dir, copy](shared_ptr<const dcp::TextAsset> asset, bool rename, bool hard_link, bool soft_link) { + auto interop = dynamic_pointer_cast<const dcp::InteropTextAsset>(asset); boost::optional<boost::filesystem::path> extra; if (interop) { extra = interop->id(); for (auto font_asset: interop->font_assets()) { maybe_copy(font_asset->id(), rename, hard_link, soft_link, extra); } - for (auto subtitle: interop->subtitles()) { - if (auto image = dynamic_pointer_cast<const dcp::SubtitleImage>(subtitle)) { + for (auto subtitle: interop->texts()) { + if (auto image = dynamic_pointer_cast<const dcp::TextImage>(subtitle)) { auto const output_path = *output_dir / asset->id() / image->file()->filename(); copy(*image->file(), output_path, hard_link, soft_link); } diff --git a/src/lib/player.cc b/src/lib/player.cc index 14cd95906..20792aec4 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -54,10 +54,9 @@ #include "timer.h" #include "video_decoder.h" #include <dcp/reel.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <algorithm> #include <iostream> #include <stdint.h> diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index d8aff1162..5210466b2 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -41,24 +41,22 @@ #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/filesystem.h> -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <dcp/mono_j2k_picture_asset.h> #include <dcp/raw_convert.h> #include <dcp/reel.h> #include <dcp/reel_atmos_asset.h> -#include <dcp/reel_interop_closed_caption_asset.h> -#include <dcp/reel_interop_subtitle_asset.h> +#include <dcp/reel_interop_text_asset.h> #include <dcp/reel_markers_asset.h> #include <dcp/reel_mono_picture_asset.h> -#include <dcp/reel_smpte_closed_caption_asset.h> -#include <dcp/reel_smpte_subtitle_asset.h> +#include <dcp/reel_smpte_text_asset.h> #include <dcp/reel_sound_asset.h> #include <dcp/reel_stereo_picture_asset.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/smpte_text_asset.h> #include <dcp/sound_asset.h> #include <dcp/sound_asset_writer.h> #include <dcp/stereo_j2k_picture_asset.h> -#include <dcp/subtitle_image.h> +#include <dcp/text_image.h> #include "i18n.h" @@ -416,12 +414,13 @@ ReelWriter::finish (boost::filesystem::path output_dcp) /** Try to make a ReelAsset for a subtitles or closed captions in a given period in the DCP. - * A SubtitleAsset can be provided, or we will use one from @ref refs if not. + * A TextAsset can be provided, or we will use one from @ref refs if not. */ template <class Interop, class SMPTE, class Result> shared_ptr<Result> maybe_add_text ( - shared_ptr<dcp::SubtitleAsset> asset, + shared_ptr<dcp::TextAsset> asset, + dcp::TextType type, int64_t picture_duration, shared_ptr<dcp::Reel> reel, int reel_index, @@ -439,17 +438,18 @@ maybe_add_text ( shared_ptr<Result> reel_asset; if (asset) { - if (auto interop = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(asset)) { + if (auto interop = dynamic_pointer_cast<dcp::InteropTextAsset>(asset)) { auto directory = output_dcp / interop->id (); dcp::filesystem::create_directories(directory); interop->write (directory / subtitle_asset_filename(asset, reel_index, reel_count, content_summary, ".xml")); reel_asset = make_shared<Interop> ( + type, interop, dcp::Fraction(film->video_frame_rate(), 1), picture_duration, 0 ); - } else if (auto smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(asset)) { + } else if (auto smpte = dynamic_pointer_cast<dcp::SMPTETextAsset>(asset)) { /* All our assets should be the same length; use the picture asset length here as a reference to set the subtitle one. We'll use the duration rather than the intrinsic duration; we don't care if the picture asset has been trimmed, we're @@ -460,6 +460,7 @@ maybe_add_text ( output_dcp / subtitle_asset_filename(asset, reel_index, reel_count, content_summary, ".mxf") ); reel_asset = make_shared<SMPTE> ( + type, smpte, dcp::Fraction(film->video_frame_rate(), 1), picture_duration, @@ -602,14 +603,15 @@ ReelWriter::create_reel_text ( set<DCPTextTrack> ensure_closed_captions ) const { - auto subtitle = maybe_add_text<dcp::ReelInteropSubtitleAsset, dcp::ReelSMPTESubtitleAsset, dcp::ReelSubtitleAsset> ( - _subtitle_asset, duration, reel, _reel_index, _reel_count, _content_summary, refs, film(), _period, output_dcp, _text_only + auto subtitle = maybe_add_text<dcp::ReelInteropTextAsset, dcp::ReelSMPTETextAsset, dcp::ReelTextAsset> ( + _subtitle_asset, dcp::TextType::OPEN_SUBTITLE, duration, reel, _reel_index, _reel_count, _content_summary, refs, film(), _period, output_dcp, _text_only ); if (!subtitle && ensure_subtitles) { /* We had no subtitle asset, but we've been asked to make sure there is one */ - subtitle = maybe_add_text<dcp::ReelInteropSubtitleAsset, dcp::ReelSMPTESubtitleAsset, dcp::ReelSubtitleAsset> ( + subtitle = maybe_add_text<dcp::ReelInteropTextAsset, dcp::ReelSMPTETextAsset, dcp::ReelTextAsset>( empty_text_asset(TextType::OPEN_SUBTITLE, optional<DCPTextTrack>(), true), + dcp::TextType::OPEN_SUBTITLE, duration, reel, _reel_index, @@ -631,8 +633,8 @@ ReelWriter::create_reel_text ( } for (auto const& i: _closed_caption_assets) { - auto a = maybe_add_text<dcp::ReelInteropClosedCaptionAsset, dcp::ReelSMPTEClosedCaptionAsset, dcp::ReelClosedCaptionAsset> ( - i.second, duration, reel, _reel_index, _reel_count, _content_summary, refs, film(), _period, output_dcp, _text_only + auto a = maybe_add_text<dcp::ReelInteropTextAsset, dcp::ReelSMPTETextAsset, dcp::ReelTextAsset>( + i.second, dcp::TextType::CLOSED_CAPTION, duration, reel, _reel_index, _reel_count, _content_summary, refs, film(), _period, output_dcp, _text_only ); DCPOMATIC_ASSERT (a); a->set_annotation_text (i.first.name); @@ -645,8 +647,9 @@ ReelWriter::create_reel_text ( /* Make empty tracks for anything we've been asked to ensure but that we haven't added */ for (auto i: ensure_closed_captions) { - auto a = maybe_add_text<dcp::ReelInteropClosedCaptionAsset, dcp::ReelSMPTEClosedCaptionAsset, dcp::ReelClosedCaptionAsset> ( + auto a = maybe_add_text<dcp::ReelInteropTextAsset, dcp::ReelSMPTETextAsset, dcp::ReelTextAsset>( empty_text_asset(TextType::CLOSED_CAPTION, i, true), + dcp::TextType::CLOSED_CAPTION, duration, reel, _reel_index, @@ -791,15 +794,15 @@ ReelWriter::write (shared_ptr<const AudioBuffers> audio) } -shared_ptr<dcp::SubtitleAsset> +shared_ptr<dcp::TextAsset> ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool with_dummy) const { - shared_ptr<dcp::SubtitleAsset> asset; + shared_ptr<dcp::TextAsset> asset; optional<string> font; auto lang = film()->subtitle_languages(); if (film()->interop()) { - auto s = make_shared<dcp::InteropSubtitleAsset>(); + auto s = make_shared<dcp::InteropTextAsset>(); s->set_movie_title (film()->name()); if (type == TextType::OPEN_SUBTITLE) { s->set_language (lang.first ? lang.first->to_string() : "Unknown"); @@ -809,7 +812,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool s->set_reel_number (raw_convert<string> (_reel_index + 1)); asset = s; } else { - auto s = make_shared<dcp::SMPTESubtitleAsset>(); + auto s = make_shared<dcp::SMPTETextAsset>(); s->set_content_title_text (film()->name()); s->set_metadata (mxf_metadata()); if (type == TextType::OPEN_SUBTITLE && lang.first) { @@ -829,7 +832,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool if (with_dummy) { asset->add( - std::make_shared<dcp::SubtitleString>( + std::make_shared<dcp::TextString>( font, false, false, @@ -897,7 +900,7 @@ ReelWriter::convert_vertical_position(StringText const& subtitle, dcp::SubtitleS void ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track, DCPTimePeriod period, FontIdMap const& fonts, shared_ptr<dcpomatic::Font> chosen_interop_font) { - shared_ptr<dcp::SubtitleAsset> asset; + shared_ptr<dcp::TextAsset> asset; switch (type) { case TextType::OPEN_SUBTITLE: @@ -934,7 +937,7 @@ ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track, i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), tcr)); i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr)); i.set_v_position(convert_vertical_position(i, film()->interop() ? dcp::SubtitleStandard::INTEROP : dcp::SubtitleStandard::SMPTE_2014)); - auto sub = make_shared<dcp::SubtitleString>(i); + auto sub = make_shared<dcp::TextString>(i); /* i.font is a shared_ptr<Font> which uniquely identifies the font we want, * though if we are Interop we can only have one font, so we'll use the chosen * one instead. @@ -951,7 +954,7 @@ ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track, for (auto i: subs.bitmap) { asset->add ( - make_shared<dcp::SubtitleImage>( + make_shared<dcp::TextImage>( image_as_png(i.image), dcp::Time(period.from.seconds() - _period.from.seconds(), tcr), dcp::Time(period.to.seconds() - _period.from.seconds(), tcr), diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h index 0b243b264..ac6531148 100644 --- a/src/lib/reel_writer.h +++ b/src/lib/reel_writer.h @@ -57,7 +57,7 @@ namespace dcp { class SoundAssetWriter; class StereoJ2KPictureAsset; class StereoJ2KPictureAssetWriter; - class SubtitleAsset; + class TextAsset; } @@ -107,7 +107,7 @@ private: Frame check_existing_picture_asset (boost::filesystem::path asset); bool existing_picture_frame_ok (dcp::File& asset_file, std::shared_ptr<InfoFileHandle> info_file, Frame frame) const; - std::shared_ptr<dcp::SubtitleAsset> empty_text_asset (TextType type, boost::optional<DCPTextTrack> track, bool with_dummy) const; + std::shared_ptr<dcp::TextAsset> empty_text_asset (TextType type, boost::optional<DCPTextTrack> track, bool with_dummy) const; std::shared_ptr<dcp::ReelPictureAsset> create_reel_picture (std::shared_ptr<dcp::Reel> reel, std::list<ReferencedReelAsset> const & refs) const; void create_reel_sound (std::shared_ptr<dcp::Reel> reel, std::list<ReferencedReelAsset> const & refs) const; @@ -145,8 +145,8 @@ private: std::shared_ptr<dcp::MPEG2PictureAssetWriter> _mpeg2_picture_asset_writer; std::shared_ptr<dcp::SoundAsset> _sound_asset; std::shared_ptr<dcp::SoundAssetWriter> _sound_asset_writer; - std::shared_ptr<dcp::SubtitleAsset> _subtitle_asset; - std::map<DCPTextTrack, std::shared_ptr<dcp::SubtitleAsset>> _closed_caption_assets; + std::shared_ptr<dcp::TextAsset> _subtitle_asset; + std::map<DCPTextTrack, std::shared_ptr<dcp::TextAsset>> _closed_caption_assets; std::shared_ptr<dcp::AtmosAsset> _atmos_asset; std::shared_ptr<dcp::AtmosAssetWriter> _atmos_asset_writer; diff --git a/src/lib/referenced_reel_asset.cc b/src/lib/referenced_reel_asset.cc index 3175d772d..5ef3b9ae7 100644 --- a/src/lib/referenced_reel_asset.cc +++ b/src/lib/referenced_reel_asset.cc @@ -27,10 +27,9 @@ #include "referenced_reel_asset.h" #include <dcp/reel.h> #include <dcp/reel_asset.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <cmath> diff --git a/src/lib/string_text.h b/src/lib/string_text.h index 787231b8c..d39a889cf 100644 --- a/src/lib/string_text.h +++ b/src/lib/string_text.h @@ -25,7 +25,7 @@ #include "font.h" #include <dcp/subtitle_standard.h> -#include <dcp/subtitle_string.h> +#include <dcp/text_string.h> /** A wrapper for SubtitleString which allows us to: @@ -36,13 +36,13 @@ * - include details of how v_align should be interpreted * * - specify the font by referring to a Font object from the content we came from, rather than - * having to use a DCP ID like in dcp::SubtitleString. + * having to use a DCP ID like in dcp::TextString. */ -class StringText : public dcp::SubtitleString +class StringText : public dcp::TextString { public: - StringText(dcp::SubtitleString dcp_, int outline_width_, std::shared_ptr<dcpomatic::Font> font_, dcp::SubtitleStandard valign_standard_) - : dcp::SubtitleString (dcp_) + StringText(dcp::TextString dcp_, int outline_width_, std::shared_ptr<dcpomatic::Font> font_, dcp::SubtitleStandard valign_standard_) + : dcp::TextString(dcp_) , outline_width (outline_width_) , font (font_) , valign_standard (valign_standard_) diff --git a/src/lib/string_text_file_decoder.cc b/src/lib/string_text_file_decoder.cc index 2ec0ec1cb..585d68888 100644 --- a/src/lib/string_text_file_decoder.cc +++ b/src/lib/string_text_file_decoder.cc @@ -19,11 +19,11 @@ */ -#include "string_text_file_decoder.h" #include "string_text_file_content.h" +#include "string_text_file_decoder.h" #include "text_content.h" #include "text_decoder.h" -#include <dcp/subtitle_string.h> +#include <dcp/text_string.h> #include <iostream> diff --git a/src/lib/subtitle_film_encoder.cc b/src/lib/subtitle_film_encoder.cc index 93ccc177b..8356433a8 100644 --- a/src/lib/subtitle_film_encoder.cc +++ b/src/lib/subtitle_film_encoder.cc @@ -25,9 +25,9 @@ #include "player.h" #include "subtitle_film_encoder.h" #include <dcp/filesystem.h> -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <dcp/raw_convert.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/smpte_text_asset.h> #include <boost/filesystem.hpp> #include <boost/bind/bind.hpp> @@ -79,7 +79,7 @@ SubtitleFilmEncoder::SubtitleFilmEncoder(shared_ptr<const Film> film, shared_ptr } } - _assets.push_back(make_pair(shared_ptr<dcp::SubtitleAsset>(), dcp::filesystem::change_extension(filename, extension))); + _assets.push_back(make_pair(shared_ptr<dcp::TextAsset>(), dcp::filesystem::change_extension(filename, extension))); } for (auto i: film->reels()) { @@ -108,12 +108,12 @@ SubtitleFilmEncoder::go() if (!i.first) { /* No subtitles arrived for this asset; make an empty one so we write something to the output */ if (_film->interop()) { - auto s = make_shared<dcp::InteropSubtitleAsset>(); + auto s = make_shared<dcp::InteropTextAsset>(); s->set_movie_title (_film->name()); s->set_reel_number (raw_convert<string>(reel + 1)); i.first = s; } else { - auto s = make_shared<dcp::SMPTESubtitleAsset>(); + auto s = make_shared<dcp::SMPTETextAsset>(); s->set_content_title_text (_film->name()); s->set_reel_number (reel + 1); i.first = s; @@ -140,10 +140,10 @@ SubtitleFilmEncoder::text(PlayerText subs, TextType type, optional<DCPTextTrack> } if (!_assets[_reel_index].first) { - shared_ptr<dcp::SubtitleAsset> asset; + shared_ptr<dcp::TextAsset> asset; auto lang = _film->subtitle_languages (); if (_film->interop ()) { - auto s = make_shared<dcp::InteropSubtitleAsset>(); + auto s = make_shared<dcp::InteropTextAsset>(); s->set_movie_title (_film->name()); if (lang.first) { s->set_language (lang.first->to_string()); @@ -151,7 +151,7 @@ SubtitleFilmEncoder::text(PlayerText subs, TextType type, optional<DCPTextTrack> s->set_reel_number (raw_convert<string>(_reel_index + 1)); _assets[_reel_index].first = s; } else { - auto s = make_shared<dcp::SMPTESubtitleAsset>(); + auto s = make_shared<dcp::SMPTETextAsset>(); s->set_content_title_text (_film->name()); if (lang.first) { s->set_language (*lang.first); @@ -176,7 +176,7 @@ SubtitleFilmEncoder::text(PlayerText subs, TextType type, optional<DCPTextTrack> if (_film->interop() && !_include_font) { i.unset_font (); } - _assets[_reel_index].first->add (make_shared<dcp::SubtitleString>(i)); + _assets[_reel_index].first->add(make_shared<dcp::TextString>(i)); } if (_split_reels && (_reel_index < int(_reels.size()) - 1) && period.from > _reels[_reel_index].from) { diff --git a/src/lib/subtitle_film_encoder.h b/src/lib/subtitle_film_encoder.h index 54231794d..6482916cb 100644 --- a/src/lib/subtitle_film_encoder.h +++ b/src/lib/subtitle_film_encoder.h @@ -26,7 +26,7 @@ namespace dcp { - class SubtitleAsset; + class TextAsset; } @@ -53,7 +53,7 @@ public: private: void text (PlayerText subs, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period); - std::vector<std::pair<std::shared_ptr<dcp::SubtitleAsset>, boost::filesystem::path>> _assets; + std::vector<std::pair<std::shared_ptr<dcp::TextAsset>, boost::filesystem::path>> _assets; std::vector<dcpomatic::DCPTimePeriod> _reels; bool _split_reels; bool _include_font; diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index 945ffaa03..36909c2ee 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -128,7 +128,7 @@ TextDecoder::remove_invalid_characters_for_xml(string text) void -TextDecoder::emit_plain_start(ContentTime from, vector<dcp::SubtitleString> subtitles, dcp::SubtitleStandard valign_standard) +TextDecoder::emit_plain_start(ContentTime from, vector<dcp::TextString> subtitles, dcp::SubtitleStandard valign_standard) { vector<StringText> string_texts; @@ -274,7 +274,7 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & sub_subti return dcp::Colour(lrintf(c.r * 255), lrintf(c.g * 255), lrintf(c.b * 255)); }; - auto dcp_subtitle = dcp::SubtitleString( + auto dcp_subtitle = dcp::TextString( optional<string>(), block.italic, block.bold, @@ -337,7 +337,7 @@ TextDecoder::emit_stop (ContentTime to) void -TextDecoder::emit_plain(ContentTimePeriod period, vector<dcp::SubtitleString> subtitles, dcp::SubtitleStandard valign_standard) +TextDecoder::emit_plain(ContentTimePeriod period, vector<dcp::TextString> subtitles, dcp::SubtitleStandard valign_standard) { emit_plain_start (period.from, subtitles, valign_standard); emit_stop (period.to); diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h index 1a7632fd8..26248ef06 100644 --- a/src/lib/text_decoder.h +++ b/src/lib/text_decoder.h @@ -30,7 +30,7 @@ #include "content_text.h" #include "types.h" #include <dcp/subtitle_standard.h> -#include <dcp/subtitle_string.h> +#include <dcp/text_string.h> #include <boost/signals2.hpp> @@ -52,9 +52,9 @@ public: void emit_bitmap_start (ContentBitmapText const& bitmap); void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect); - void emit_plain_start(dcpomatic::ContentTime from, std::vector<dcp::SubtitleString> s, dcp::SubtitleStandard valign_standard); + void emit_plain_start(dcpomatic::ContentTime from, std::vector<dcp::TextString> s, dcp::SubtitleStandard valign_standard); void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle); - void emit_plain(dcpomatic::ContentTimePeriod period, std::vector<dcp::SubtitleString> s, dcp::SubtitleStandard valign_standard); + void emit_plain(dcpomatic::ContentTimePeriod period, std::vector<dcp::TextString> s, dcp::SubtitleStandard valign_standard); void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle); void emit_stop (dcpomatic::ContentTime to); diff --git a/src/lib/text_type.cc b/src/lib/text_type.cc index b1dcfc99c..4f8f50ac5 100644 --- a/src/lib/text_type.cc +++ b/src/lib/text_type.cc @@ -38,6 +38,10 @@ string_to_text_type(string s) return TextType::UNKNOWN; } else if (s == "open-subtitle") { return TextType::OPEN_SUBTITLE; + } else if (s == "open-caption") { + return TextType::OPEN_CAPTION; + } else if (s == "closed-subtitle") { + return TextType::CLOSED_SUBTITLE; } else if (s == "closed-caption") { return TextType::CLOSED_CAPTION; } else { @@ -53,6 +57,10 @@ text_type_to_string(TextType t) return "unknown"; case TextType::OPEN_SUBTITLE: return "open-subtitle"; + case TextType::OPEN_CAPTION: + return "open-caption"; + case TextType::CLOSED_SUBTITLE: + return "closed-subtitle"; case TextType::CLOSED_CAPTION: return "closed-caption"; default: @@ -68,6 +76,10 @@ text_type_to_name(TextType t) return _("Timed text"); case TextType::OPEN_SUBTITLE: return _("Open subtitles"); + case TextType::OPEN_CAPTION: + return _("Open captions"); + case TextType::CLOSED_SUBTITLE: + return _("Closed subtitles"); case TextType::CLOSED_CAPTION: return _("Closed captions"); default: diff --git a/src/lib/text_type.h b/src/lib/text_type.h index d21e03a60..94224af4e 100644 --- a/src/lib/text_type.h +++ b/src/lib/text_type.h @@ -34,8 +34,6 @@ * - open: on-screen * - closed: only visible by some audience members * - * At the moment DoM supports open subtitles and closed captions. - * * There is some use of the word `subtitle' in the code which may mean * caption in some contexts. */ @@ -43,6 +41,8 @@ enum class TextType { UNKNOWN, OPEN_SUBTITLE, + OPEN_CAPTION, + CLOSED_SUBTITLE, CLOSED_CAPTION, COUNT }; diff --git a/src/lib/util.cc b/src/lib/util.cc index 172b8d763..2e3485075 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -61,7 +61,7 @@ #include <dcp/raw_convert.h> #include <dcp/scope_guard.h> #include <dcp/sound_asset.h> -#include <dcp/subtitle_asset.h> +#include <dcp/text_asset.h> #include <dcp/util.h> #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS @@ -475,7 +475,7 @@ LIBDCP_ENABLE_WARNINGS #if defined(DCPOMATIC_WINDOWS) || defined(DCPOMATIC_OSX) /* Render something to fontconfig to create its cache */ vector<StringText> subs; - dcp::SubtitleString ss( + dcp::TextString ss( optional<string>(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HAlign::CENTER, 0, dcp::VAlign::CENTER, 0, dcp::Direction::LTR, "Hello dolly", dcp::Effect::NONE, dcp::Colour(), dcp::Time(), dcp::Time(), 0, std::vector<dcp::Ruby>() ); @@ -763,7 +763,7 @@ audio_asset_filename (shared_ptr<dcp::SoundAsset> asset, int reel_index, int ree string -subtitle_asset_filename (shared_ptr<dcp::SubtitleAsset> asset, int reel_index, int reel_count, optional<string> summary, string extension) +subtitle_asset_filename (shared_ptr<dcp::TextAsset> asset, int reel_index, int reel_count, optional<string> summary, string extension) { return asset_filename(asset, "sub", reel_index, reel_count, summary, extension); } @@ -910,7 +910,7 @@ utf8_strlen (string s) /** @param size Size of picture that the subtitle will be overlaid onto */ void -emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, shared_ptr<TextDecoder> decoder) +emit_subtitle_image(ContentTimePeriod period, dcp::TextImage sub, dcp::Size size, shared_ptr<TextDecoder> decoder) { /* XXX: this is rather inefficient; decoding the image just to get its size */ FFmpegImageProxy proxy (sub.png_image()); diff --git a/src/lib/util.h b/src/lib/util.h index 7c40c5ce8..d6ed0bccc 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -36,7 +36,7 @@ #include <dcp/atmos_asset.h> #include <dcp/decrypted_kdm.h> #include <dcp/util.h> -#include <dcp/subtitle_image.h> +#include <dcp/text_image.h> #include <boost/optional.hpp> #include <boost/filesystem.hpp> #include <boost/date_time/gregorian/gregorian.hpp> @@ -50,7 +50,7 @@ namespace dcp { class PictureAsset; class SoundAsset; - class SubtitleAsset; + class TextAsset; } extern std::string program_name; @@ -82,13 +82,13 @@ extern dcp::Size fit_ratio_within (float ratio, dcp::Size); extern void set_backtrace_file (boost::filesystem::path); extern std::string video_asset_filename (std::shared_ptr<dcp::PictureAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary); extern std::string audio_asset_filename (std::shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary); -extern std::string subtitle_asset_filename (std::shared_ptr<dcp::SubtitleAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary, std::string extension); +extern std::string subtitle_asset_filename (std::shared_ptr<dcp::TextAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary, std::string extension); extern std::string atmos_asset_filename (std::shared_ptr<dcp::AtmosAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary); extern std::string careful_string_filter (std::string); extern std::pair<int, int> audio_channel_types (std::list<int> mapped, int channels); extern std::shared_ptr<AudioBuffers> remap (std::shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping map); extern size_t utf8_strlen (std::string s); -extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, std::shared_ptr<TextDecoder> decoder); +extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::TextImage sub, dcp::Size size, std::shared_ptr<TextDecoder> decoder); extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)>); extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta); extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index f9293ed09..29fc543ba 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -43,9 +43,8 @@ #include <dcp/mono_mpeg2_picture_frame.h> #include <dcp/locale_convert.h> #include <dcp/raw_convert.h> -#include <dcp/reel_closed_caption_asset.h> #include <dcp/reel_file_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <cerrno> #include <cfloat> #include <set> @@ -945,19 +944,21 @@ Writer::write (ReferencedReelAsset asset) { _reel_assets.push_back (asset); - if (dynamic_pointer_cast<dcp::ReelSubtitleAsset>(asset.asset)) { - _have_subtitles = true; - } else if (auto ccap = dynamic_pointer_cast<dcp::ReelClosedCaptionAsset>(asset.asset)) { - /* This feels quite fragile. We have a referenced reel and want to know if it's - * part of a given closed-caption track so that we can fill if it has any - * missing reels. I guess for that purpose almost any DCPTextTrack values are - * fine so long as they are consistent. - */ - DCPTextTrack track; - track.name = ccap->annotation_text().get_value_or(""); - track.language = dcp::LanguageTag(ccap->language().get_value_or("en-US")); - if (_have_closed_captions.find(track) == _have_closed_captions.end()) { - _have_closed_captions.insert(track); + if (auto text_asset = dynamic_pointer_cast<dcp::ReelTextAsset>(asset.asset)) { + if (text_asset->type() == dcp::TextType::OPEN_SUBTITLE || text_asset->type() == dcp::TextType::OPEN_CAPTION) { + _have_subtitles = true; + } else { + /* This feels quite fragile. We have a referenced reel and want to know if it's + * part of a given closed-caption track so that we can fill if it has any + * missing reels. I guess for that purpose almost any DCPTextTrack values are + * fine so long as they are consistent. + */ + DCPTextTrack track; + track.name = text_asset->annotation_text().get_value_or(""); + track.language = dcp::LanguageTag(text_asset->language().get_value_or("en-US")); + if (_have_closed_captions.find(track) == _have_closed_captions.end()) { + _have_closed_captions.insert(track); + } } } } diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc index 47c7bac14..5293608c9 100644 --- a/src/tools/dcpomatic_editor.cc +++ b/src/tools/dcpomatic_editor.cc @@ -36,7 +36,7 @@ #include <dcp/reel.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS #include <wx/cmdline.h> diff --git a/test/closed_caption_test.cc b/test/closed_caption_test.cc index 1a9531f4a..75890f87f 100644 --- a/test/closed_caption_test.cc +++ b/test/closed_caption_test.cc @@ -26,7 +26,7 @@ #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> -#include <dcp/reel_closed_caption_asset.h> +#include <dcp/reel_text_asset.h> #include <boost/test/unit_test.hpp> diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 22e4fd9ff..32a1ff98a 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -39,7 +39,7 @@ #include "test.h" #include <dcp/mono_j2k_picture_asset.h> #include <dcp/openjpeg_image.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/smpte_text_asset.h> #include <boost/test/unit_test.hpp> #include <iostream> @@ -280,12 +280,12 @@ BOOST_AUTO_TEST_CASE(entity_from_dcp_source) dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING, }); - dcp::SMPTESubtitleAsset check(dcp_file(film, "sub_")); - auto subs = check.subtitles(); + dcp::SMPTETextAsset check(dcp_file(film, "sub_")); + auto subs = check.texts(); BOOST_REQUIRE_EQUAL(subs.size(), 1U); - auto sub = std::dynamic_pointer_cast<const dcp::SubtitleString>(subs[0]); + auto sub = std::dynamic_pointer_cast<const dcp::TextString>(subs[0]); BOOST_REQUIRE(sub); - /* libdcp::SubtitleAsset gets the text from the XML with get_content(), which + /* dcp::TextAsset gets the text from the XML with get_content(), which * resolves the 5 predefined entities & " < > ' so we shouldn't see any * entity here. */ diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 9ff3c3817..e89890542 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -30,7 +30,7 @@ #include "lib/render_text.h" #include "lib/string_text.h" #include "test.h" -#include <dcp/subtitle_string.h> +#include <dcp/text_string.h> #include <pango/pango-utils.h> #include <boost/test/unit_test.hpp> @@ -44,7 +44,7 @@ add(std::vector<StringText>& s, std::string text, bool italic, bool bold, bool u { s.push_back ( StringText ( - dcp::SubtitleString ( + dcp::TextString( boost::optional<std::string> (), italic, bold, @@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE (marked_up_test6) BOOST_AUTO_TEST_CASE(render_text_with_newline_test) { - std::list<dcp::SubtitleString> ss = { + std::list<dcp::TextString> ss = { { {}, true, false, false, dcp::Colour(255, 255, 255), 42, 1.0, dcp::Time(0, 0, 0, 0, 24), dcp::Time(0, 0, 1, 0, 24), @@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE(render_text_with_newline_test) BOOST_AUTO_TEST_CASE (render_text_test) { - auto dcp_string = dcp::SubtitleString( + auto dcp_string = dcp::TextString( {}, false, false, false, dcp::Colour(255, 255, 255), 42, 1.0, dcp::Time(0, 0, 0, 0, 24), dcp::Time(0, 0, 1, 0, 24), 0.5, dcp::HAlign::CENTER, diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 031749a8c..7bfbf1cbe 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -32,8 +32,8 @@ #include "lib/string_text_file_content.h" #include "lib/text_content.h" #include "test.h" -#include <dcp/smpte_subtitle_asset.h> -#include <dcp/subtitle_string.h> +#include <dcp/smpte_text_asset.h> +#include <dcp/text_string.h> #include <boost/algorithm/string.hpp> #include <boost/test/unit_test.hpp> #include <list> @@ -229,12 +229,12 @@ BOOST_AUTO_TEST_CASE(srt_subtitle_entity) dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING, }); - dcp::SMPTESubtitleAsset check(dcp_file(film, "sub_")); - auto subs = check.subtitles(); + dcp::SMPTETextAsset check(dcp_file(film, "sub_")); + auto subs = check.texts(); BOOST_REQUIRE_EQUAL(subs.size(), 1U); - auto sub = std::dynamic_pointer_cast<const dcp::SubtitleString>(subs[0]); + auto sub = std::dynamic_pointer_cast<const dcp::TextString>(subs[0]); BOOST_REQUIRE(sub); - /* libdcp::SubtitleAsset gets the text from the XML with get_content(), which + /* dcp::TextAsset gets the text from the XML with get_content(), which * resolves the 5 predefined entities & " < > ' so we shouldn't see any * entity here. */ diff --git a/test/ssa_subtitle_test.cc b/test/ssa_subtitle_test.cc index ffd374d45..d21f7c450 100644 --- a/test/ssa_subtitle_test.cc +++ b/test/ssa_subtitle_test.cc @@ -33,7 +33,7 @@ #include "lib/text_content.h" #include "test.h" #include <dcp/equality_options.h> -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <boost/test/unit_test.hpp> #include <boost/algorithm/string.hpp> @@ -63,11 +63,11 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1) make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD }); - auto ref = make_shared<dcp::InteropSubtitleAsset>(TestPaths::private_data() / "DKH_UT_EN20160601def.xml"); - auto check = make_shared<dcp::InteropSubtitleAsset>(subtitle_file(film)); + auto ref = make_shared<dcp::InteropTextAsset>(TestPaths::private_data() / "DKH_UT_EN20160601def.xml"); + auto check = make_shared<dcp::InteropTextAsset>(subtitle_file(film)); dcp::EqualityOptions options; - options.max_subtitle_vertical_position_error = 0.1; + options.max_text_vertical_position_error = 0.1; BOOST_CHECK(ref->equals(check, options, [](dcp::NoteType t, string n) { if (t == dcp::NoteType::ERROR) { std::cerr << n << "\n"; diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc index 9a901727b..b358e7d3e 100644 --- a/test/subtitle_font_id_test.cc +++ b/test/subtitle_font_id_test.cc @@ -30,8 +30,8 @@ #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> -#include <dcp/reel_subtitle_asset.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/reel_text_asset.h> +#include <dcp/smpte_text_asset.h> #include "test.h" #include <boost/test/unit_test.hpp> @@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(make_dcp_with_subs_without_font_tag) }); auto check_file = subtitle_file(film); - dcp::SMPTESubtitleAsset check_asset(check_file); + dcp::SMPTETextAsset check_asset(check_file); BOOST_CHECK_EQUAL(check_asset.load_font_nodes().size(), 1U); auto check_font_data = check_asset.font_data(); BOOST_CHECK_EQUAL(check_font_data.size(), 1U); @@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(make_dcp_with_subs_in_dcp_without_font_tag) }); auto check_file = subtitle_file(film); - dcp::SMPTESubtitleAsset check_asset(check_file); + dcp::SMPTETextAsset check_asset(check_file); BOOST_CHECK_EQUAL(check_asset.load_font_nodes().size(), 1U); auto check_font_data = check_asset.font_data(); BOOST_CHECK_EQUAL(check_font_data.size(), 1U); @@ -256,8 +256,8 @@ BOOST_AUTO_TEST_CASE(subtitle_with_no_font_test) BOOST_REQUIRE(check_subs); BOOST_CHECK_EQUAL(check_subs->font_data().size(), 1U); - BOOST_REQUIRE_EQUAL(check_subs->subtitles().size(), 1U); - BOOST_CHECK(!std::dynamic_pointer_cast<const dcp::SubtitleString>(check_subs->subtitles()[0])->font().has_value()); + BOOST_REQUIRE_EQUAL(check_subs->texts().size(), 1U); + BOOST_CHECK(!std::dynamic_pointer_cast<const dcp::TextString>(check_subs->texts()[0])->font().has_value()); auto check_film = new_test_film(name_base + "_check", { make_shared<DCPContent>(bad_film->dir(bad_film->dcp_name())) }); make_and_verify_dcp(check_film); @@ -289,7 +289,7 @@ BOOST_AUTO_TEST_CASE(use_first_loadfont_as_default) BOOST_REQUIRE(!cpl->reels().empty()); auto reel = cpl->reels()[0]; BOOST_REQUIRE(reel->main_subtitle()->asset()); - auto subtitle = std::dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(reel->main_subtitle()->asset()); + auto subtitle = std::dynamic_pointer_cast<dcp::SMPTETextAsset>(reel->main_subtitle()->asset()); BOOST_REQUIRE_EQUAL(subtitle->font_data().size(), 1U); BOOST_CHECK(subtitle->font_data().begin()->second == dcp::ArrayData("test/data/Inconsolata-VF.ttf")); } diff --git a/test/subtitle_position_test.cc b/test/subtitle_position_test.cc index 9c71b0d70..05e305478 100644 --- a/test/subtitle_position_test.cc +++ b/test/subtitle_position_test.cc @@ -25,9 +25,9 @@ #include "lib/make_dcp.h" #include "lib/text_content.h" #include "test.h" -#include <dcp/interop_subtitle_asset.h> +#include <dcp/interop_text_asset.h> #include <dcp/language_tag.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/smpte_text_asset.h> #include <boost/test/unit_test.hpp> #include <vector> @@ -56,8 +56,8 @@ BOOST_AUTO_TEST_CASE(srt_correctly_placed_in_interop) auto output = subtitle_file(film); - dcp::InteropSubtitleAsset asset(output); - auto output_subs = asset.subtitles(); + dcp::InteropTextAsset asset(output); + auto output_subs = asset.texts(); BOOST_REQUIRE_EQUAL(output_subs.size(), 1U); BOOST_CHECK(output_subs[0]->v_align() == dcp::VAlign::BOTTOM); @@ -84,8 +84,8 @@ BOOST_AUTO_TEST_CASE(srt_correctly_placed_in_smpte) auto output = subtitle_file(film); - dcp::SMPTESubtitleAsset asset(output); - auto output_subs = asset.subtitles(); + dcp::SMPTETextAsset asset(output); + auto output_subs = asset.texts(); BOOST_REQUIRE_EQUAL(output_subs.size(), 1U); BOOST_CHECK(output_subs[0]->v_align() == dcp::VAlign::BOTTOM); @@ -123,13 +123,13 @@ vpos_test(dcp::VAlign reference, float position, dcp::SubtitleStandard from, dcp BOOST_REQUIRE(!wait_for_jobs()); auto out = subtitle_file(film); - vector<shared_ptr<const dcp::Subtitle>> subtitles; + vector<shared_ptr<const dcp::Text>> subtitles; if (to == dcp::Standard::INTEROP) { - dcp::InteropSubtitleAsset asset(out); - subtitles = asset.subtitles(); + dcp::InteropTextAsset asset(out); + subtitles = asset.texts(); } else { - dcp::SMPTESubtitleAsset asset(out); - subtitles = asset.subtitles(); + dcp::SMPTETextAsset asset(out); + subtitles = asset.texts(); } BOOST_REQUIRE_EQUAL(subtitles.size(), 1U); diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc index 0648ec477..a74cc097d 100644 --- a/test/subtitle_reel_number_test.cc +++ b/test/subtitle_reel_number_test.cc @@ -28,8 +28,8 @@ #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> -#include <dcp/interop_subtitle_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/interop_text_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/raw_convert.h> #include <boost/test/unit_test.hpp> @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test) int n = 1; for (auto i: cpl->reels()) { if (i->main_subtitle()) { - auto ass = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(i->main_subtitle()->asset()); + auto ass = dynamic_pointer_cast<dcp::InteropTextAsset>(i->main_subtitle()->asset()); BOOST_REQUIRE (ass); BOOST_CHECK_EQUAL (ass->reel_number(), dcp::raw_convert<string>(n)); ++n; diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc index 8a1a8bece..877709f73 100644 --- a/test/subtitle_reel_test.cc +++ b/test/subtitle_reel_test.cc @@ -27,10 +27,9 @@ #include "test.h" #include <dcp/dcp.h> #include <dcp/cpl.h> +#include <dcp/interop_text_asset.h> #include <dcp/reel.h> -#include <dcp/interop_subtitle_asset.h> -#include <dcp/reel_closed_caption_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <boost/test/unit_test.hpp> @@ -80,19 +79,19 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_test) auto i = reels.begin (); BOOST_REQUIRE ((*i)->main_subtitle()); BOOST_REQUIRE ((*i)->main_subtitle()->asset()); - auto A = std::dynamic_pointer_cast<dcp::InteropSubtitleAsset>((*i)->main_subtitle()->asset()); + auto A = std::dynamic_pointer_cast<dcp::InteropTextAsset>((*i)->main_subtitle()->asset()); BOOST_REQUIRE (A); ++i; BOOST_REQUIRE ((*i)->main_subtitle()); BOOST_REQUIRE ((*i)->main_subtitle()->asset()); - auto B = std::dynamic_pointer_cast<dcp::InteropSubtitleAsset>((*i)->main_subtitle()->asset()); + auto B = std::dynamic_pointer_cast<dcp::InteropTextAsset>((*i)->main_subtitle()->asset()); BOOST_REQUIRE (B); - BOOST_REQUIRE_EQUAL (A->subtitles().size(), 1U); - BOOST_REQUIRE_EQUAL (B->subtitles().size(), 1U); + BOOST_REQUIRE_EQUAL(A->texts().size(), 1U); + BOOST_REQUIRE_EQUAL(B->texts().size(), 1U); /* These times should be the same as they are should be offset from the start of the reel */ - BOOST_CHECK (A->subtitles().front()->in() == B->subtitles().front()->in()); + BOOST_CHECK(A->texts().front()->in() == B->texts().front()->in()); } @@ -231,7 +230,7 @@ BOOST_AUTO_TEST_CASE (subtitles_split_at_reel_boundaries) BOOST_REQUIRE (reel_sub); auto sub = reel_sub->asset(); BOOST_REQUIRE (sub); - BOOST_CHECK_EQUAL (sub->subtitles().size(), 1U); + BOOST_CHECK_EQUAL(sub->texts().size(), 1U); } } diff --git a/test/subtitle_timing_test.cc b/test/subtitle_timing_test.cc index 2e6b319cb..0bb678655 100644 --- a/test/subtitle_timing_test.cc +++ b/test/subtitle_timing_test.cc @@ -33,7 +33,7 @@ #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <boost/test/unit_test.hpp> #include <iostream> @@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE (test_subtitle_timing_with_frame_rate_change) BOOST_REQUIRE(reel->main_subtitle()); BOOST_REQUIRE(reel->main_subtitle()->asset()); - auto subs = reel->main_subtitle()->asset()->subtitles(); + auto subs = reel->main_subtitle()->asset()->texts(); int index = 0; for (auto i: subs) { auto error = std::abs(i->in().as_seconds() - (index * content_frame_rate / dcp_frame_rate)); diff --git a/test/test.cc b/test/test.cc index acbc97ea1..09085eeea 100644 --- a/test/test.cc +++ b/test/test.cc @@ -563,7 +563,7 @@ check_dcp(boost::filesystem::path ref, boost::filesystem::path check, bool sound options.reel_hashes_can_differ = true; options.asset_hashes_can_differ = true; options.issue_dates_can_differ = true; - options.max_subtitle_vertical_position_error = 0.001; + options.max_text_vertical_position_error = 0.001; options.sound_assets_can_differ = sound_can_differ; BOOST_CHECK_MESSAGE(ref_dcp.equals(check_dcp, options, boost::bind (note, _1, _2)), check << " does not match " << ref); diff --git a/test/text_entry_point_test.cc b/test/text_entry_point_test.cc index b48111782..f748a2680 100644 --- a/test/text_entry_point_test.cc +++ b/test/text_entry_point_test.cc @@ -25,8 +25,8 @@ #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> -#include <dcp/reel_smpte_subtitle_asset.h> -#include <dcp/smpte_subtitle_asset.h> +#include <dcp/reel_smpte_text_asset.h> +#include <dcp/smpte_text_asset.h> #include <boost/test/unit_test.hpp> @@ -42,9 +42,9 @@ BOOST_AUTO_TEST_CASE(test_text_entry_point) /* Make a "bad" DCP with a non-zero text entry point */ dcp::DCP bad_dcp(path / "dcp"); - auto sub = make_shared<dcp::SMPTESubtitleAsset>(); + auto sub = make_shared<dcp::SMPTETextAsset>(); sub->write(path / "dcp" / "subs.mxf"); - auto reel_sub = make_shared<dcp::ReelSMPTESubtitleAsset>(sub, dcp::Fraction{24, 1}, 42, 6); + auto reel_sub = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::OPEN_SUBTITLE, sub, dcp::Fraction{24, 1}, 42, 6); auto reel = make_shared<dcp::Reel>(); reel->add(reel_sub); diff --git a/test/vf_test.cc b/test/vf_test.cc index 589e12d83..0313be1d9 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -45,9 +45,9 @@ #include <dcp/reel.h> #include <dcp/reel_mono_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_smpte_subtitle_asset.h> -#include <dcp/smpte_subtitle_asset.h> -#include <dcp/subtitle_string.h> +#include <dcp/reel_smpte_text_asset.h> +#include <dcp/smpte_text_asset.h> +#include <dcp/text_string.h> #include <boost/test/unit_test.hpp> #include <iostream> @@ -454,9 +454,9 @@ BOOST_AUTO_TEST_CASE(test_referencing_ov_with_missing_subtitle_in_some_reels) auto pic1 = make_picture("pic1.mxf"); auto pic2 = make_picture("pic2.mxf"); - auto sub1 = make_shared<dcp::SMPTESubtitleAsset>(); + auto sub1 = make_shared<dcp::SMPTETextAsset>(); - sub1->add(std::make_shared<dcp::SubtitleString>( + sub1->add(std::make_shared<dcp::TextString>( boost::optional<string>(), false, false, false, dcp::Colour(255, 255, 255), 42, 1, dcp::Time(0, 0, 5, 0, 24), dcp::Time(0, 0, 9, 0, 24), 0, dcp::HAlign::CENTER, @@ -470,7 +470,7 @@ BOOST_AUTO_TEST_CASE(test_referencing_ov_with_missing_subtitle_in_some_reels) sub1->write(path / "ov" / "sub.mxf"); auto reel1_pic = make_shared<dcp::ReelMonoPictureAsset>(pic1, 0); - auto reel1_sub = make_shared<dcp::ReelSMPTESubtitleAsset>(sub1, dcp::Fraction(24, 1), 240, 0); + auto reel1_sub = make_shared<dcp::ReelSMPTETextAsset>(dcp::TextType::OPEN_SUBTITLE, sub1, dcp::Fraction(24, 1), 240, 0); auto reel2_pic = make_shared<dcp::ReelMonoPictureAsset>(pic1, 0); @@ -35,7 +35,7 @@ except ImportError: from waflib import Logs, Context APPNAME = 'dcpomatic' -libdcp_version = '1.8.100' +libdcp_version = '1.9.15' libsub_version = '1.6.49' this_version = subprocess.Popen(['git', 'tag', '-l', '--points-at', 'HEAD'], stdout=subprocess.PIPE).communicate()[0] |
