#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"
#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"
/** 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
)
/** 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();
/** 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
)
/** 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,
)
{
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()) {
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();
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) {
}
}
- 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);
/** 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,
)
{
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();
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);
}
static
void
verify_text_lines_and_characters (
- shared_ptr<SubtitleAsset> asset,
+ shared_ptr<TextAsset> asset,
int warning_length,
int error_length,
LinesCharactersResult* result
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);
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);