/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
#include "reel_picture_asset.h"
-#include "picture_mxf.h"
+#include "picture_asset.h"
#include "dcp_assert.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
}
-ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureMXF> asset, int64_t entry_point)
- : ReelMXFAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point)
+ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureAsset> asset, int64_t entry_point)
+ : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point)
+ , ReelMXF (asset->key_id())
, _frame_rate (asset->frame_rate ())
, _screen_aspect_ratio (asset->screen_aspect_ratio ())
{
-
+
}
ReelPictureAsset::ReelPictureAsset (shared_ptr<const cxml::Node> node)
- : ReelMXFAsset (node)
+ : ReelAsset (node)
+ , ReelMXF (node)
{
_frame_rate = Fraction (node->string_child ("FrameRate"));
try {
_screen_aspect_ratio = Fraction (node->string_child ("ScreenAspectRatio"));
} catch (XMLError& e) {
- /* Maybe it's not a fraction */
- }
- try {
- float f = node->number_child<float> ("ScreenAspectRatio");
- _screen_aspect_ratio = Fraction (f * 1000, 1000);
- } catch (bad_cast& e) {
+ /* It's not a fraction */
+ try {
+ float f = node->number_child<float> ("ScreenAspectRatio");
+ _screen_aspect_ratio = Fraction (f * 1000, 1000);
+ } catch (bad_cast& e) {
+ }
}
}
/* Find <MainPicture> */
xmlpp::Node* mp = find_child (node, cpl_node_name ());
-
+
mp->add_child ("FrameRate")->add_child_text (String::compose ("%1 %2", _frame_rate.numerator, _frame_rate.denominator));
if (standard == INTEROP) {
stringstream s;
);
}
- if (!key_id ().empty ()) {
+ 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 ());
+ mp->add_child_before (hash, "KeyId")->add_child_text ("urn:uuid:" + key_id().get ());
}
}
if (!ReelAsset::equals (other, opt, note)) {
return false;
}
-
+
shared_ptr<const ReelPictureAsset> rpa = dynamic_pointer_cast<const ReelPictureAsset> (other);
if (!rpa) {
return false;