, _content_kind (content_kind)
, _content_version_id ("urn:uuid:" + make_uuid ())
{
- /* default _content_version_id to and _content_version_label to
+ /* default _content_version_id to a random ID and _content_version_label to
a random ID and the current time.
*/
- _content_version_id = "urn:uuid:" + make_uuid() + LocalTime().as_string ();
- _content_version_label_text = _content_version_id;
+ _content_version_id = "urn:uuid:" + make_uuid();
+ _content_version_label_text = _content_version_id + LocalTime().as_string ();
}
/** Construct a CPL object from a XML file */
cxml::Document f ("CompositionPlaylist");
f.read_file (file);
- _id = f.string_child ("Id");
- if (_id.length() > 9) {
- _id = _id.substr (9);
- }
+ _id = remove_urn_uuid (f.string_child ("Id"));
_annotation_text = f.optional_string_child ("AnnotationText").get_value_or ("");
_metadata.issuer = f.optional_string_child ("Issuer").get_value_or ("");
_metadata.creator = f.optional_string_child ("Creator").get_value_or ("");
}
void
-CPL::resolve_refs (list<shared_ptr<Object> > objects)
+CPL::resolve_refs (list<shared_ptr<Asset> > assets)
{
BOOST_FOREACH (shared_ptr<Reel> i, _reels) {
- i->resolve_refs (objects);
+ i->resolve_refs (assets);
}
}
DCP_ASSERT (false);
}
}
+
+int64_t
+CPL::duration () const
+{
+ int64_t d = 0;
+ BOOST_FOREACH (shared_ptr<Reel> i, _reels) {
+ d += i->duration ();
+ }
+ return d;
+}