Account for split branch in libdcp. split
authorCarl Hetherington <cth@carlh.net>
Tue, 5 Dec 2023 00:59:44 +0000 (01:59 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 5 Dec 2023 00:59:44 +0000 (01:59 +0100)
37 files changed:
src/lib/analyse_subtitles_job.cc
src/lib/content_factory.cc
src/lib/content_text.h
src/lib/dcp_decoder.cc
src/lib/dcp_decoder.h
src/lib/dcp_examiner.cc
src/lib/dcp_subtitle.cc
src/lib/dcp_subtitle.h
src/lib/dcp_subtitle_content.cc
src/lib/dcp_subtitle_decoder.cc
src/lib/dcp_subtitle_decoder.h
src/lib/ffmpeg_decoder.cc
src/lib/font_id_allocator.cc
src/lib/font_id_allocator.h
src/lib/hints.cc
src/lib/map_cli.cc
src/lib/reel_writer.cc
src/lib/reel_writer.h
src/lib/render_text.cc
src/lib/render_text.h
src/lib/string_text.h
src/lib/string_text_file_decoder.cc
src/lib/subtitle_encoder.cc
src/lib/subtitle_encoder.h
src/lib/text_decoder.cc
src/lib/text_decoder.h
src/lib/util.cc
src/lib/util.h
test/dcp_subtitle_test.cc
test/render_subtitles_test.cc
test/srt_subtitle_test.cc
test/ssa_subtitle_test.cc
test/subtitle_font_id_test.cc
test/subtitle_position_test.cc
test/subtitle_reel_number_test.cc
test/subtitle_reel_test.cc
test/subtitle_timing_test.cc

index b41990db5f738dcfc5aad537a96b359861a4948d..ffc6b3fe2e1c8595c470a3ab5d3e262d46e41c36 100644 (file)
@@ -115,20 +115,20 @@ AnalyseSubtitlesJob::analyse(PlayerText const& text, TextType type)
 
        /* We can provide dummy values for time and frame rate here as they are only used to calculate fades */
        dcp::Size const frame = _film->frame_size();
-       std::vector<dcp::SubtitleStandard> override_standard;
+       std::vector<dcp::TextStandard> override_standard;
        if (_film->interop()) {
                /* Since the film is Interop there is only one way the vpositions in the subs can be interpreted
                 * (we assume).
                 */
-               override_standard.push_back(dcp::SubtitleStandard::INTEROP);
+               override_standard.push_back(dcp::TextStandard::INTEROP);
        } else {
                /* We're using the great new SMPTE standard, which means there are two different ways that vposition
                 * could be interpreted; we will write SMPTE-2014 standard assets, but if the projection system uses
                 * SMPTE 20{07,10} instead they won't be placed how we intended.  To show the user this, make the
                 * bounding rectangle enclose both possibilities.
                 */
-               override_standard.push_back(dcp::SubtitleStandard::SMPTE_2007);
-               override_standard.push_back(dcp::SubtitleStandard::SMPTE_2014);
+               override_standard.push_back(dcp::TextStandard::SMPTE_2007);
+               override_standard.push_back(dcp::TextStandard::SMPTE_2014);
        }
 
        for (auto standard: override_standard) {
index dfa1ba55e4d4795ebdc66e23408390ec7c1b7814..bac41f940a38dd27de7e53d33aec862b87cd144f 100644 (file)
@@ -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);
index 51d4e8009942899c7008dcb838d27733de37af03..4b59ac65f4ccfa1d5f33277956e6fee9f8538177 100644 (file)
@@ -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>
 
 
index 3a187186390dcaa76330494f1e94410d51b87476..9e8959d7116b30101075b051195ade16f90a528f 100644 (file)
@@ -281,7 +281,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());
@@ -289,16 +289,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();
@@ -308,12 +308,12 @@ DCPDecoder::pass_texts (
                                                        ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
                                                        ),
                                                strings,
-                                               asset->subtitle_standard()
+                                               asset->text_standard()
                                                );
                                        strings.clear ();
                                }
 
-                               dcp::SubtitleString is_copy = *is;
+                               dcp::TextString is_copy = *is;
                                is_copy.set_font(_font_id_allocator.font_id(_reel - _reels.begin(), asset->id(), is_copy.font().get_value_or("")));
                                strings.push_back(is_copy);
                        }
@@ -344,7 +344,7 @@ DCPDecoder::pass_texts (
                                        ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
                                        ),
                                strings,
-                               asset->subtitle_standard()
+                               asset->text_standard()
                                );
                        strings.clear ();
                }
index 2c0cd8f413ad7612ceeeae3e122694a9bf6d2bf2..b68eae80e7eca37f2dfa559ec9c0647ffbb918e2 100644 (file)
@@ -30,7 +30,7 @@
 #include <dcp/mono_picture_asset_reader.h>
 #include <dcp/stereo_picture_asset_reader.h>
 #include <dcp/sound_asset_reader.h>
-#include <dcp/subtitle_asset.h>
+#include <dcp/text_asset.h>
 
 
 namespace dcp {
@@ -77,7 +77,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,
index ca77f2db3bdaedfc560206e8937a9df9889ef4a0..f7ef559efb18befef8a520f4e8ff006ebfb097b7 100644 (file)
@@ -48,7 +48,7 @@
 #include <dcp/stereo_picture_asset.h>
 #include <dcp/stereo_picture_asset_reader.h>
 #include <dcp/stereo_picture_frame.h>
-#include <dcp/subtitle_asset.h>
+#include <dcp/text_asset.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -326,7 +326,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()) {
index c2c3f7f70a6c4215955c82c963090d8ab1a5b8b2..c2d390b55b9cd30ef3b929398f220e75f2c53937 100644 (file)
@@ -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();
                }
index 285dd55bc4a1e931a3d3ab550bef2565c4dcdc55..0f79281030ea2b32da87c9b68af80877685d666b 100644 (file)
 
 
 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;
 };
 
 
index b3e24d5e2dceef959cfb74d67fecbb64f62b9928..5458f13913a7652cc1ee18ab8c366a510e6b891b 100644 (file)
@@ -23,8 +23,8 @@
 #include "film.h"
 #include "text_content.h"
 #include <dcp/raw_convert.h>
-#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 <dcp/interop_load_font_node.h>
 #include <libxml++/libxml++.h>
 
@@ -59,8 +59,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);
        }
@@ -70,7 +70,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();
 
index b3e6d75531bcbf4fd86ffd0d812aae9558048f19..04dfddd1293b24a7aa14192db508c34dfc21f567 100644 (file)
@@ -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,10 +45,10 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<
        /* Load the XML or MXF file */
        auto const asset = load (content->path(0));
        asset->fix_empty_font_ids ();
-       _subtitles = asset->subtitles ();
+       _subtitles = asset->texts();
        _next = _subtitles.begin ();
 
-       _subtitle_standard = asset->subtitle_standard();
+       _subtitle_standard = asset->text_standard();
 
        text.push_back (make_shared<TextDecoder>(this, content->only_text()));
        update_position();
@@ -84,12 +84,12 @@ DCPSubtitleDecoder::pass ()
           time of emitting the first.
        */
 
-       vector<dcp::SubtitleString> s;
+       vector<dcp::TextString> s;
        vector<dcp::SubtitleImage> 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) {
                        s.push_back (*ns);
                        ++_next;
@@ -115,7 +115,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()),
index 45a4999ddcf769781bd87c8a577264b6511a6e06..cb5952d5d35e4be9dfcc67e58c089b9e3ac376de 100644 (file)
@@ -37,11 +37,11 @@ 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;
+       dcp::TextStandard _subtitle_standard;
 };
index 6e9d671a2fa87792e2ea5b58d6b2d9b2e136822c..1da2998ef5fd5cfa533ee58609d9704f1de596d1 100644 (file)
@@ -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>
index 70eda2b0613caa2402a24502d9e89d7a769073ed..529361e41e9be40e65412e8710f65aeeb969ad02 100644 (file)
@@ -26,7 +26,7 @@
 #include <dcp/reel.h>
 #include <dcp/reel_closed_caption_asset.h>
 #include <dcp/reel_subtitle_asset.h>
-#include <dcp/subtitle_asset.h>
+#include <dcp/text_asset.h>
 #include <set>
 #include <string>
 #include <vector>
@@ -57,7 +57,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()) {
                _map[Font(reel_index, asset->id(), font.first)] = 0;
index bd99cad6313fa336ddddef6df85d08d0a161d2ec..edec394ae8ac072fd364f7c2e4372adf06b3d335 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace dcp {
        class Reel;
-       class SubtitleAsset;
+       class TextAsset;
 }
 
 
@@ -68,7 +68,7 @@ public:
        std::string font_id(int reel_index, std::string asset_id, std::string font_id) const;
 
 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
        {
index b4d94dbcc3d03ab4ab06de1045c94cdd2b7f153f..0d4546c136a4e6227779cf22ad2e66d0a75d13fd 100644 (file)
@@ -351,7 +351,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);
 }
index e38af69cf08e9773dba3d7b00b18683c06ad434b..7a88278818dd4f4b2176b5c566fd5201e9d38673 100644 (file)
@@ -24,7 +24,7 @@
 #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_picture_asset.h>
@@ -35,7 +35,7 @@
 #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/smpte_text_asset.h>
 #include <dcp/sound_asset.h>
 #include <dcp/stereo_picture_asset.h>
 #include <boost/optional.hpp>
@@ -277,15 +277,15 @@ 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()) {
+                       for (auto subtitle: interop->texts()) {
                                if (auto image = dynamic_pointer_cast<const dcp::SubtitleImage>(subtitle)) {
                                        auto const output_path = *output_dir / asset->id() / image->file()->filename();
                                        copy(*image->file(), output_path, hard_link, soft_link);
index 1b33cae852eedcbb1ed5330d9e20bf52bc77bd03..8d30c16681eb5260cebb4ab254b412a0bcd11ea9 100644 (file)
@@ -39,7 +39,7 @@
 #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_picture_asset.h>
 #include <dcp/raw_convert.h>
 #include <dcp/reel.h>
@@ -52,7 +52,7 @@
 #include <dcp/reel_smpte_subtitle_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_picture_asset.h>
@@ -465,7 +465,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
 template <class Interop, class SMPTE, class Result>
 shared_ptr<Result>
 maybe_add_text (
-       shared_ptr<dcp::SubtitleAsset> asset,
+       shared_ptr<dcp::TextAsset> asset,
        int64_t picture_duration,
        shared_ptr<dcp::Reel> reel,
        int reel_index,
@@ -483,7 +483,7 @@ 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"));
@@ -493,7 +493,7 @@ maybe_add_text (
                                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
@@ -832,15 +832,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");
@@ -850,7 +850,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) {
@@ -870,7 +870,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,
@@ -908,7 +908,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool
 
 
 float
-ReelWriter::convert_vertical_position(StringText const& subtitle, dcp::SubtitleStandard to) const
+ReelWriter::convert_vertical_position(StringText const& subtitle, dcp::TextStandard to) const
 {
        if (dcp::uses_baseline(subtitle.valign_standard) == dcp::uses_baseline(to)) {
                /* The from and to standards use the same alignment reference */
@@ -938,7 +938,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:
@@ -974,8 +974,8 @@ ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track,
        for (auto i: subs.string) {
                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);
+               i.set_v_position(convert_vertical_position(i, film()->interop() ? dcp::TextStandard::INTEROP : dcp::TextStandard::SMPTE_2014));
+               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.
index c9052c832fd8570223bc8e4b6b6166bb14a2b25a..783981b5d682db7332cd3c90867ecb8f7bec82d6 100644 (file)
@@ -52,7 +52,7 @@ namespace dcp {
        class SoundAssetWriter;
        class StereoPictureAsset;
        class StereoPictureAssetWriter;
-       class SubtitleAsset;
+       class TextAsset;
 }
 
 
@@ -104,7 +104,7 @@ private:
        long frame_info_position (Frame frame, Eyes eyes) const;
        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;
@@ -117,7 +117,7 @@ private:
                std::set<DCPTextTrack> ensure_closed_captions
                ) const;
        void create_reel_markers (std::shared_ptr<dcp::Reel> reel) const;
-       float convert_vertical_position(StringText const& subtitle, dcp::SubtitleStandard to) const;
+       float convert_vertical_position(StringText const& subtitle, dcp::TextStandard to) const;
 
        dcpomatic::DCPTimePeriod _period;
        /** the first picture frame index that does not already exist in our MXF */
@@ -139,8 +139,8 @@ private:
        std::shared_ptr<dcp::PictureAssetWriter> _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;
 
index 870f3045d31340fb692c98cb65d8c858d6c4b38f..6aed151817b04c9aadbafe7726e77e8e50a4c076 100644 (file)
@@ -242,12 +242,12 @@ x_position(dcp::HAlign align, float position, int target_width, int layout_width
  *  @return y position of the top of the subtitle bounding box (in pixels) from the top of the screen.
  */
 static int
-y_position(dcp::SubtitleStandard standard, dcp::VAlign align, float position, int target_height, int baseline_to_bottom, int layout_height)
+y_position(dcp::TextStandard standard, dcp::VAlign align, float position, int target_height, int baseline_to_bottom, int layout_height)
 {
        int y = 0;
        switch (standard) {
-       case dcp::SubtitleStandard::INTEROP:
-       case dcp::SubtitleStandard::SMPTE_2014:
+       case dcp::TextStandard::INTEROP:
+       case dcp::TextStandard::SMPTE_2014:
                switch (align) {
                case dcp::VAlign::TOP:
                        /* position is distance from top of frame to subtitle baseline */
@@ -263,8 +263,8 @@ y_position(dcp::SubtitleStandard standard, dcp::VAlign align, float position, in
                        break;
                }
                break;
-       case dcp::SubtitleStandard::SMPTE_2007:
-       case dcp::SubtitleStandard::SMPTE_2010:
+       case dcp::TextStandard::SMPTE_2007:
+       case dcp::TextStandard::SMPTE_2010:
                switch (align) {
                case dcp::VAlign::TOP:
                        /* v_position is distance from top of frame to top of subtitle */
@@ -452,7 +452,7 @@ render_text(vector<StringText> subtitles, dcp::Size target, DCPTime time, int fr
 
 
 vector<dcpomatic::Rect<int>>
-bounding_box(vector<StringText> subtitles, dcp::Size target, optional<dcp::SubtitleStandard> override_standard)
+bounding_box(vector<StringText> subtitles, dcp::Size target, optional<dcp::TextStandard> override_standard)
 {
        vector<StringText> pending;
        vector<dcpomatic::Rect<int>> rects;
index ff34dc10d8c1cc4b6c687dd086c9e0443535bd32..18264e0d02bd25836389cff46ac03be79c895268 100644 (file)
@@ -34,7 +34,7 @@ namespace dcpomatic {
 
 std::string marked_up(std::vector<StringText> subtitles, int target_height, float fade_factor, std::string font_name);
 std::vector<PositionImage> render_text(std::vector<StringText>, dcp::Size, dcpomatic::DCPTime, int);
-std::vector<dcpomatic::Rect<int>> bounding_box(std::vector<StringText> subtitles, dcp::Size target, boost::optional<dcp::SubtitleStandard> override_standard = boost::none);
+std::vector<dcpomatic::Rect<int>> bounding_box(std::vector<StringText> subtitles, dcp::Size target, boost::optional<dcp::TextStandard> override_standard = boost::none);
 
 
 class FontMetrics
index 787231b8cf2d57b2ed3a8dda65b1ea7e42fb312c..827b426cc11f4467088bedcf9280cff563ed02c1 100644 (file)
@@ -24,8 +24,8 @@
 
 
 #include "font.h"
-#include <dcp/subtitle_standard.h>
-#include <dcp/subtitle_string.h>
+#include <dcp/text_standard.h>
+#include <dcp/text_string.h>
 
 
 /** A wrapper for SubtitleString which allows us to:
  *    - 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::TextStandard valign_standard_)
+               : dcp::TextString(dcp_)
                , outline_width (outline_width_)
                , font (font_)
                , valign_standard (valign_standard_)
@@ -67,7 +67,7 @@ public:
         *     center - centre of screen to baseline of subtitle
         *     bottom - bottom of screen to baseline of subtitle
         */
-       dcp::SubtitleStandard valign_standard;
+       dcp::TextStandard valign_standard;
 };
 
 
index 2ec0ec1cb74f10cc3f32769c378670f97204efd3..5b6e343b8a31c1d657186ade66f13b69471c8201 100644 (file)
@@ -23,7 +23,7 @@
 #include "string_text_file_content.h"
 #include "text_content.h"
 #include "text_decoder.h"
-#include <dcp/subtitle_string.h>
+#include <dcp/text_string.h>
 #include <iostream>
 
 
index 8b1d9a15ba7b5f9ca1d1d60d5da531f1f5580c8d..89e5215889df461173b78e64d1f42e4a8865be69 100644 (file)
@@ -25,9 +25,9 @@
 #include "player.h"
 #include "subtitle_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 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j
                        }
                }
 
-               _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 @@ SubtitleEncoder::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 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
        }
 
        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 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
                        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 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
                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) {
index 0815b1fffbca7e8e02487a8fdfd5664205a81214..3fc7445b942c614c4a727ffc5fad642464fae20a 100644 (file)
@@ -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;
index 75fa33605b0f2f3188f1fc47141a0d609cebd632..847f297bacf36645a94aa4e0f68b1d823573e253 100644 (file)
@@ -127,7 +127,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::TextStandard valign_standard)
 {
        vector<StringText> string_texts;
 
@@ -273,7 +273,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,
@@ -312,7 +312,7 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & sub_subti
                                dcp_subtitle,
                                content()->outline_width(),
                                font,
-                               dcp::SubtitleStandard::SMPTE_2014
+                               dcp::TextStandard::SMPTE_2014
                                );
                        set_forced_appearance(content(), string_text);
                        string_texts.push_back(string_text);
@@ -332,7 +332,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::TextStandard valign_standard)
 {
        emit_plain_start (period.from, subtitles, valign_standard);
        emit_stop (period.to);
index 1a7632fd82b8448366dddc0676531c8b04fd9a27..91f452b604f93c9822a072bc2d641086cd73d7bc 100644 (file)
@@ -29,8 +29,8 @@
 #include "rect.h"
 #include "content_text.h"
 #include "types.h"
-#include <dcp/subtitle_standard.h>
-#include <dcp/subtitle_string.h>
+#include <dcp/text_standard.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::TextStandard 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::TextStandard valign_standard);
        void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle);
        void emit_stop (dcpomatic::ContentTime to);
 
index d23989afaadff0556842b8ba5fe6f01e86b96efd..9884df730588e9ae8981198fa8bde3c63deb4fe9 100644 (file)
@@ -59,7 +59,7 @@
 #include <dcp/picture_asset.h>
 #include <dcp/raw_convert.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
@@ -468,7 +468,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>()
                );
@@ -754,7 +754,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);
 }
index b92869b253a776167c72bbd1b20159a1a9015e4e..f4bf51e8e7088c5394dd472788e310a6f76abb15 100644 (file)
@@ -49,7 +49,7 @@
 namespace dcp {
        class PictureAsset;
        class SoundAsset;
-       class SubtitleAsset;
+       class TextAsset;
 }
 
 extern std::string program_name;
@@ -81,7 +81,7 @@ 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);
index 9b7b77279968f6afffa977c448a685ebb7989ed4..fc7aee984f51873101f35ae98241ef5155c3d0d9 100644 (file)
@@ -39,7 +39,7 @@
 #include "test.h"
 #include <dcp/mono_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>
 
@@ -292,12 +292,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.
         */
index e3034def01f209d7bab87914163bbe653d20eed4..dec686a21860fb6ddba35ac21d349e984dd51c15 100644 (file)
@@ -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 <boost/test/unit_test.hpp>
 
 
@@ -43,7 +43,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,
@@ -69,7 +69,7 @@ add(std::vector<StringText>& s, std::string text, bool italic, bool bold, bool u
                                ),
                        2,
                        std::shared_ptr<dcpomatic::Font>(),
-                       dcp::SubtitleStandard::SMPTE_2014
+                       dcp::TextStandard::SMPTE_2014
                        )
                );
 }
@@ -125,7 +125,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),
@@ -156,7 +156,7 @@ BOOST_AUTO_TEST_CASE(render_text_with_newline_test)
 
        std::vector<StringText> st;
        for (auto i: ss) {
-               st.push_back({i, 0, make_shared<dcpomatic::Font>("foo"), dcp::SubtitleStandard::SMPTE_2014});
+               st.push_back({i, 0, make_shared<dcpomatic::Font>("foo"), dcp::TextStandard::SMPTE_2014});
        }
 
        auto images = render_text(st, dcp::Size(1998, 1080), {}, 24);
@@ -177,7 +177,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,
index 0ee9cb197a3f3a38c24aa0ef89b702e79523331f..702d0bbb63d977bc4cbac8c65957dc90a614e51b 100644 (file)
@@ -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>
@@ -237,12 +237,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.
         */
index 2d8102a071c16559b92666864036650ca1ffde34..2466de791189e1fa31c601482c4ba9557f6f4300 100644 (file)
@@ -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>
 
@@ -62,8 +62,8 @@ 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;
index f6bd48c51d0859260b5e36e42c63fd57f3db9f47..e420338255632979c74ad8842430daa4c676c85e 100644 (file)
@@ -29,7 +29,7 @@
 #include <dcp/dcp.h>
 #include <dcp/reel.h>
 #include <dcp/reel_subtitle_asset.h>
-#include <dcp/smpte_subtitle_asset.h>
+#include <dcp/smpte_text_asset.h>
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
@@ -127,7 +127,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);
@@ -186,7 +186,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);
@@ -254,8 +254,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_film2(name_base + "_check", { make_shared<DCPContent>(bad_film->dir(bad_film->dcp_name())) });
        make_and_verify_dcp(check_film);
index 94a06b7f82ea2c1dbc6ab924c771f374ed2fd833..785164965034ba8e4a831abb54ec7a0992983ccf 100644 (file)
@@ -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>
 
@@ -55,8 +55,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);
@@ -83,8 +83,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);
@@ -95,18 +95,18 @@ BOOST_AUTO_TEST_CASE(srt_correctly_placed_in_smpte)
 /** Make a DCP from some DCP subtitles and check the vertical alignment */
 static
 void
-vpos_test(dcp::VAlign reference, float position, dcp::SubtitleStandard from, dcp::Standard to)
+vpos_test(dcp::VAlign reference, float position, dcp::TextStandard from, dcp::Standard to)
 {
        string standard;
        switch (from) {
-               case dcp::SubtitleStandard::SMPTE_2007:
-               case dcp::SubtitleStandard::SMPTE_2010:
+               case dcp::TextStandard::SMPTE_2007:
+               case dcp::TextStandard::SMPTE_2010:
                        standard = "smpte_2010";
                        break;
-               case dcp::SubtitleStandard::INTEROP:
+               case dcp::TextStandard::INTEROP:
                        standard = "interop";
                        break;
-               case dcp::SubtitleStandard::SMPTE_2014:
+               case dcp::TextStandard::SMPTE_2014:
                        standard = "smpte_2014";
                        break;
        }
@@ -122,13 +122,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);
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(subtitles_correctly_placed_with_all_references)
        constexpr auto height = 0.0462963;
 
        /* Interop source */
-       auto from = dcp::SubtitleStandard::INTEROP;
+       auto from = dcp::TextStandard::INTEROP;
 
        // -> Interop
        vpos_test(dcp::VAlign::TOP, 0.2, from, dcp::Standard::INTEROP);
@@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE(subtitles_correctly_placed_with_all_references)
        vpos_test(dcp::VAlign::BOTTOM, 0.08, from, dcp::Standard::SMPTE);
 
        /* SMPTE 2010 source */
-       from = dcp::SubtitleStandard::SMPTE_2010;
+       from = dcp::TextStandard::SMPTE_2010;
 
        // -> Interop
        vpos_test(dcp::VAlign::TOP, 0.1 + height - baseline_to_bottom, from, dcp::Standard::INTEROP);
@@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE(subtitles_correctly_placed_with_all_references)
        vpos_test(dcp::VAlign::BOTTOM, 0.10 + baseline_to_bottom, from, dcp::Standard::SMPTE);
 
        /* SMPTE 2014 source */
-       from = dcp::SubtitleStandard::SMPTE_2014;
+       from = dcp::TextStandard::SMPTE_2014;
 
        // -> Interop
        vpos_test(dcp::VAlign::TOP, 0.2, from, dcp::Standard::INTEROP);
index 743d809ddfd1847842eb437365086d1ede439043..e7ac0c907cbcbf964b24b2b87d60722ac6e80a1c 100644 (file)
@@ -28,7 +28,7 @@
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
 #include <dcp/reel.h>
-#include <dcp/interop_subtitle_asset.h>
+#include <dcp/interop_text_asset.h>
 #include <dcp/reel_subtitle_asset.h>
 #include <dcp/raw_convert.h>
 #include <boost/test/unit_test.hpp>
@@ -65,7 +65,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;
index d7eb90d251eb45382eff78d2c4a78a2a1213a852..0f9abe78297291dfeda352d1916e3d6f1f78ba03 100644 (file)
@@ -28,7 +28,7 @@
 #include <dcp/dcp.h>
 #include <dcp/cpl.h>
 #include <dcp/reel.h>
-#include <dcp/interop_subtitle_asset.h>
+#include <dcp/interop_text_asset.h>
 #include <dcp/reel_closed_caption_asset.h>
 #include <dcp/reel_subtitle_asset.h>
 #include <boost/test/unit_test.hpp>
@@ -78,25 +78,25 @@ 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());
 }
 
 
 
 /** Check that with a SMPTE DCP if we have subtitles in one reel, all reels have a
- *  SubtitleAsset (even if it's empty); SMPTE Bv2.1 section 8.3.1.
+ *  TextAsset (even if it's empty); SMPTE Bv2.1 section 8.3.1.
  */
 BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
 {
@@ -224,7 +224,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);
        }
 }
 
index e5a4133adea5e709ae42f70de36be50654c6ddb2..48c3d00e52b180c7b305f38b8cd6950ecc167910 100644 (file)
@@ -61,7 +61,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));