Rename everything.
[libdcp.git] / src / verify.cc
index 960f0438816a3c726a604ecdcf692ac79fa5f4c5..4e9c29c365cb47f715a0817630dfacf27f5e823a 100644 (file)
@@ -42,7 +42,7 @@
 #include "dcp.h"
 #include "exceptions.h"
 #include "filesystem.h"
-#include "interop_subtitle_asset.h"
+#include "interop_text_asset.h"
 #include "mono_picture_asset.h"
 #include "mono_picture_frame.h"
 #include "raw_convert.h"
@@ -54,7 +54,7 @@
 #include "reel_sound_asset.h"
 #include "reel_smpte_subtitle_asset.h"
 #include "reel_subtitle_asset.h"
-#include "smpte_subtitle_asset.h"
+#include "smpte_text_asset.h"
 #include "stereo_picture_asset.h"
 #include "stereo_picture_frame.h"
 #include "verify.h"
@@ -670,7 +670,7 @@ verify_closed_caption_reel (shared_ptr<const ReelClosedCaptionAsset> reel_asset,
 /** Verify stuff that is common to both subtitles and closed captions */
 void
 verify_smpte_timed_text_asset (
-       shared_ptr<const SMPTESubtitleAsset> asset,
+       shared_ptr<const SMPTETextAsset> asset,
        optional<int64_t> reel_asset_duration,
        vector<VerificationNote>& notes
        )
@@ -720,9 +720,9 @@ verify_smpte_timed_text_asset (
 
 /** Verify Interop subtitle / CCAP stuff */
 void
-verify_interop_text_asset(shared_ptr<const InteropSubtitleAsset> asset, vector<VerificationNote>& notes)
+verify_interop_text_asset(shared_ptr<const InteropTextAsset> asset, vector<VerificationNote>& notes)
 {
-       if (asset->subtitles().empty()) {
+       if (asset->texts().empty()) {
                notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::MISSING_SUBTITLE, asset->id(), asset->file().get() });
        }
        auto const unresolved = asset->unresolved_fonts();
@@ -735,7 +735,7 @@ verify_interop_text_asset(shared_ptr<const InteropSubtitleAsset> asset, vector<V
 /** Verify SMPTE subtitle-only stuff */
 void
 verify_smpte_subtitle_asset (
-       shared_ptr<const SMPTESubtitleAsset> asset,
+       shared_ptr<const SMPTETextAsset> asset,
        vector<VerificationNote>& notes,
        State& state
        )
@@ -778,7 +778,7 @@ verify_smpte_subtitle_asset (
 /** Verify all subtitle stuff */
 static void
 verify_subtitle_asset (
-       shared_ptr<const SubtitleAsset> asset,
+       shared_ptr<const TextAsset> asset,
        optional<int64_t> reel_asset_duration,
        function<void (string, optional<boost::filesystem::path>)> stage,
        boost::filesystem::path xsd_dtd_directory,
@@ -787,7 +787,7 @@ verify_subtitle_asset (
        )
 {
        stage ("Checking subtitle XML", asset->file());
-       /* Note: we must not use SubtitleAsset::xml_as_string() here as that will mean the data on disk
+       /* Note: we must not use TextAsset::xml_as_string() here as that will mean the data on disk
         * gets passed through libdcp which may clean up and therefore hide errors.
         */
        if (asset->raw_xml()) {
@@ -796,7 +796,7 @@ verify_subtitle_asset (
                notes.push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED});
        }
 
-       auto namespace_count = [](shared_ptr<const SubtitleAsset> asset, string root_node) {
+       auto namespace_count = [](shared_ptr<const TextAsset> asset, string root_node) {
                cxml::Document doc(root_node);
                doc.read_string(asset->raw_xml().get());
                auto root = dynamic_cast<xmlpp::Element*>(doc.node())->cobj();
@@ -807,7 +807,7 @@ verify_subtitle_asset (
                return count;
        };
 
-       auto interop = dynamic_pointer_cast<const InteropSubtitleAsset>(asset);
+       auto interop = dynamic_pointer_cast<const InteropTextAsset>(asset);
        if (interop) {
                verify_interop_text_asset(interop, notes);
                if (namespace_count(asset, "DCSubtitle") > 1) {
@@ -815,7 +815,7 @@ verify_subtitle_asset (
                }
        }
 
-       auto smpte = dynamic_pointer_cast<const SMPTESubtitleAsset>(asset);
+       auto smpte = dynamic_pointer_cast<const SMPTETextAsset>(asset);
        if (smpte) {
                verify_smpte_timed_text_asset (smpte, reel_asset_duration, notes);
                verify_smpte_subtitle_asset (smpte, notes, state);
@@ -830,7 +830,7 @@ verify_subtitle_asset (
 /** Verify all closed caption stuff */
 static void
 verify_closed_caption_asset (
-       shared_ptr<const SubtitleAsset> asset,
+       shared_ptr<const TextAsset> asset,
        optional<int64_t> reel_asset_duration,
        function<void (string, optional<boost::filesystem::path>)> stage,
        boost::filesystem::path xsd_dtd_directory,
@@ -838,7 +838,7 @@ verify_closed_caption_asset (
        )
 {
        stage ("Checking closed caption XML", asset->file());
-       /* Note: we must not use SubtitleAsset::xml_as_string() here as that will mean the data on disk
+       /* Note: we must not use TextAsset::xml_as_string() here as that will mean the data on disk
         * gets passed through libdcp which may clean up and therefore hide errors.
         */
        auto raw_xml = asset->raw_xml();
@@ -851,12 +851,12 @@ verify_closed_caption_asset (
                notes.push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED});
        }
 
-       auto interop = dynamic_pointer_cast<const InteropSubtitleAsset>(asset);
+       auto interop = dynamic_pointer_cast<const InteropTextAsset>(asset);
        if (interop) {
                verify_interop_text_asset(interop, notes);
        }
 
-       auto smpte = dynamic_pointer_cast<const SMPTESubtitleAsset>(asset);
+       auto smpte = dynamic_pointer_cast<const SMPTETextAsset>(asset);
        if (smpte) {
                verify_smpte_timed_text_asset (smpte, reel_asset_duration, notes);
        }
@@ -1161,7 +1161,7 @@ struct LinesCharactersResult
 static
 void
 verify_text_lines_and_characters (
-       shared_ptr<SubtitleAsset> asset,
+       shared_ptr<TextAsset> asset,
        int warning_length,
        int error_length,
        LinesCharactersResult* result
@@ -1189,7 +1189,7 @@ verify_text_lines_and_characters (
 
        vector<shared_ptr<Event>> events;
 
-       auto position = [](shared_ptr<const SubtitleString> sub) {
+       auto position = [](shared_ptr<const TextString> sub) {
                switch (sub->v_align()) {
                case VAlign::TOP:
                        return lrintf(sub->v_position() * 100);
@@ -1202,8 +1202,8 @@ verify_text_lines_and_characters (
                return 0L;
        };
 
-       for (auto j: asset->subtitles()) {
-               auto text = dynamic_pointer_cast<const SubtitleString>(j);
+       for (auto j: asset->texts()) {
+               auto text = dynamic_pointer_cast<const TextString>(j);
                if (text) {
                        auto in = make_shared<Event>(text->in(), position(text), text->text().length());
                        events.push_back(in);