using boost::optional;
using namespace dcp;
-ReelPictureAsset::ReelPictureAsset ()
- : _frame_rate (Fraction (24, 1))
- , _screen_aspect_ratio (Fraction (1998, 1080))
-{
-
-}
-
ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureAsset> asset, int64_t entry_point)
- : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point)
- , ReelMXF (asset->key_id())
+ : ReelAsset (asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point)
+ , ReelMXF (asset, asset->key_id())
, _frame_rate (asset->frame_rate ())
, _screen_aspect_ratio (asset->screen_aspect_ratio ())
{
}
}
-void
+xmlpp::Node*
ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
+ xmlpp::Node* asset = write_to_cpl_asset (node, standard, hash());
- /* 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 ());
- }
+ write_to_cpl_mxf (asset);
+
+ return asset;
}
string
}
bool
-ReelPictureAsset::equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, NoteHandler note) const
+ReelPictureAsset::equals (shared_ptr<const ReelPictureAsset> other, EqualityOptions opt, NoteHandler note) const
{
- if (!ReelAsset::equals (other, opt, note)) {
+ if (!asset_equals (other, opt, note)) {
+ return false;
+ }
+ if (!mxf_equals (other, opt, note)) {
return false;
}