43 LIBDCP_DISABLE_WARNINGS
44 #include <libxml++/libxml++.h>
45 LIBDCP_ENABLE_WARNINGS
50 using std::shared_ptr;
52 using boost::optional;
56 ReelSMPTETextAsset::ReelSMPTETextAsset(TextType type, shared_ptr<SMPTETextAsset> asset,
Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
57 :
ReelTextAsset(type, asset, edit_rate, intrinsic_duration, entry_point)
63 ReelSMPTETextAsset::ReelSMPTETextAsset(shared_ptr<const cxml::Node> node)
72 ReelSMPTETextAsset::cpl_node_name()
const
75 case TextType::OPEN_SUBTITLE:
76 return "MainSubtitle";
77 case TextType::OPEN_CAPTION:
78 return "tt:MainCaption";
79 case TextType::CLOSED_SUBTITLE:
80 return "ClosedSubtitle";
81 case TextType::CLOSED_CAPTION:
82 return "tt:ClosedCaption";
94 case TextType::OPEN_SUBTITLE:
95 case TextType::CLOSED_SUBTITLE:
97 case TextType::OPEN_CAPTION:
98 case TextType::CLOSED_CAPTION:
99 return make_pair(
"http://www.smpte-ra.org/schemas/429-12/2008/TT",
"tt");
108 ReelSMPTETextAsset::write_to_cpl(xmlpp::Element* node, Standard standard)
const
110 auto asset = ReelFileAsset::write_to_cpl (node, standard);
111 string const ns = _type == TextType::CLOSED_CAPTION ?
"tt" :
"";
113 cxml::add_child(asset,
"Language", ns)->add_child_text(*
_language);
A fraction (i.e. a thing with an integer numerator and an integer denominator).
std::pair< std::string, std::string > cpl_node_namespace() const override
Part of a Reel's description which refers to a subtitle or caption XML/MXF file.
boost::optional< std::string > _language
Namespace for everything in libdcp.
ReelSMPTETextAsset class.