}
-void
+xmlpp::Node*
ReelAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
xmlpp::Element* a = node->add_child (cpl_node_name (standard));
if (_hash) {
a->add_child("Hash")->add_child_text (_hash.get());
}
+ return a;
}
pair<string, string>
ReelAsset (boost::shared_ptr<Asset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
explicit ReelAsset (boost::shared_ptr<const cxml::Node>);
- virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ virtual xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
virtual bool equals (boost::shared_ptr<const ReelAsset>, EqualityOptions, NoteHandler) const;
/** @return a Ref to our actual asset */
return _hash;
}
+ std::string annotation_text () const {
+ return _annotation_text;
+ }
+
void set_annotation_text (std::string at) {
_annotation_text = at;
}
return "MDEK";
}
-void
+xmlpp::Node *
ReelAtmosAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
-
- /* Find <axd:AuxData> */
- xmlpp::Node* mp = find_child (node, cpl_node_name (standard));
- mp->add_child("axd:DataType")->add_child_text ("urn:smpte:ul:060e2b34.04010105.0e090604.00000000");
+ xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard);
+ asset->add_child("axd:DataType")->add_child_text("urn:smpte:ul:060e2b34.04010105.0e090604.00000000");
+ return asset;
}
return asset_of_type<AtmosAsset> ();
}
- void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
private:
std::string key_type () const;
: ReelAsset (node)
, ReelMXF (node)
{
- node->ignore_child ("Language");
+ _language = node->optional_string_child ("Language");
node->done ();
}
return "MDSK";
}
-void
+xmlpp::Node *
ReelClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
+ xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard);
- if (key_id ()) {
- /* Find our main tag */
- xmlpp::Node* ms = find_child (node, cpl_node_name (standard));
+ if (key_id()) {
/* Find <Hash> */
- xmlpp::Node* hash = find_child (ms, "Hash");
- ms->add_child_before (hash, "KeyId")->add_child_text ("urn:uuid:" + key_id().get ());
+ xmlpp::Node* hash = find_child (asset, "Hash");
+ asset->add_child_before(hash, "KeyId")->add_child_text("urn:uuid:" + key_id().get());
}
+
+ if (_language) {
+ asset->add_child("Language")->add_child_text(*_language);
+ }
+
+ return asset;
}
ReelClosedCaptionAsset (boost::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point);
explicit ReelClosedCaptionAsset (boost::shared_ptr<const cxml::Node>);
- void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
boost::shared_ptr<SubtitleAsset> asset () const {
return asset_of_type<SubtitleAsset> ();
}
+ void set_language (std::string l) {
+ _language = l;
+ }
+
+ void unset_language () {
+ _language = boost::optional<std::string> ();
+ }
+
+ boost::optional<std::string> language () const {
+ return _language;
+ }
+
private:
std::string key_type () const;
std::string cpl_node_name (Standard standard) const;
std::pair<std::string, std::string> cpl_node_namespace (Standard standard) const;
+
+ boost::optional<std::string> _language;
};
}
}
}
-void
+xmlpp::Node*
ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
+ xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard);
- /* Find <MainPicture> */
- xmlpp::Node* mp = find_child (node, cpl_node_name (standard));
-
- mp->add_child ("FrameRate")->add_child_text (String::compose ("%1 %2", _frame_rate.numerator, _frame_rate.denominator));
+ asset->add_child("FrameRate")->add_child_text(String::compose("%1 %2", _frame_rate.numerator, _frame_rate.denominator));
if (standard == INTEROP) {
/* Allowed values for this tag from the standard */
}
}
- mp->add_child ("ScreenAspectRatio")->add_child_text (raw_convert<string> (closest.get(), 2, true));
+ asset->add_child ("ScreenAspectRatio")->add_child_text (raw_convert<string> (closest.get(), 2, true));
} else {
- mp->add_child ("ScreenAspectRatio")->add_child_text (
+ asset->add_child ("ScreenAspectRatio")->add_child_text (
String::compose ("%1 %2", _screen_aspect_ratio.numerator, _screen_aspect_ratio.denominator)
);
}
if (key_id ()) {
/* Find <Hash> */
- xmlpp::Node* hash = find_child (mp, "Hash");
- mp->add_child_before (hash, "KeyId")->add_child_text ("urn:uuid:" + key_id().get ());
+ xmlpp::Node* hash = find_child (asset, "Hash");
+ asset->add_child_before(hash, "KeyId")->add_child_text("urn:uuid:" + key_id().get());
}
+
+ return asset;
}
string
ReelPictureAsset (boost::shared_ptr<PictureAsset> asset, int64_t entry_point);
explicit ReelPictureAsset (boost::shared_ptr<const cxml::Node>);
- virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ virtual xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
virtual bool equals (boost::shared_ptr<const ReelAsset>, EqualityOptions, NoteHandler) const;
/** @return the PictureAsset that this object refers to */
return "MDAK";
}
-void
+xmlpp::Node *
ReelSoundAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
+ xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard);
if (key_id ()) {
- /* Find <MainSound> */
- xmlpp::Node* ms = find_child (node, cpl_node_name (standard));
/* Find <Hash> */
- xmlpp::Node* hash = find_child (ms, "Hash");
- ms->add_child_before (hash, "KeyId")->add_child_text ("urn:uuid:" + key_id().get ());
+ xmlpp::Node* hash = find_child (asset, "Hash");
+ asset->add_child_before(hash, "KeyId")->add_child_text("urn:uuid:" + key_id().get());
}
+
+ return asset;
}
ReelSoundAsset (boost::shared_ptr<dcp::SoundAsset> content, int64_t entry_point);
explicit ReelSoundAsset (boost::shared_ptr<const cxml::Node>);
- void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
/** @return the SoundAsset that this object refers to */
boost::shared_ptr<SoundAsset> asset () {
return "MDSK";
}
-void
+xmlpp::Node *
ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
+ xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard);
- /* XXX: couldn't this stuff be in the parent class? All child
- classes seem to do the same thing...?
- */
if (key_id ()) {
- /* Find <MainSubtitle> */
- xmlpp::Node* ms = find_child (node, cpl_node_name (standard));
/* Find <Hash> */
- xmlpp::Node* hash = find_child (ms, "Hash");
- ms->add_child_before (hash, "KeyId")->add_child_text ("urn:uuid:" + key_id().get ());
+ xmlpp::Node* hash = find_child (asset, "Hash");
+ asset->add_child_before(hash, "KeyId")->add_child_text("urn:uuid:" + key_id().get());
}
+
+ return asset;
}
ReelSubtitleAsset (boost::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
explicit ReelSubtitleAsset (boost::shared_ptr<const cxml::Node>);
- void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
boost::shared_ptr<SubtitleAsset> asset () const {
return asset_of_type<SubtitleAsset> ();