42 #include "reel_markers_asset.h"
44 LIBDCP_DISABLE_WARNINGS
45 #include <libxml++/libxml++.h>
46 LIBDCP_ENABLE_WARNINGS
52 using boost::optional;
53 using std::shared_ptr;
57 ReelMarkersAsset::ReelMarkersAsset (
Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
58 :
ReelAsset (make_uuid(), edit_rate, intrinsic_duration, entry_point)
64 ReelMarkersAsset::ReelMarkersAsset (cxml::ConstNodePtr node)
67 auto list = node->node_child (
"MarkerList");
69 for (
auto i: list->node_children(
"Marker")) {
70 set (marker_from_string(i->string_child(
"Label")),
dcp::Time(i->number_child<int64_t>(
"Offset"), edit_rate().as_float(), edit_rate().numerator));
76 ReelMarkersAsset::cpl_node_name (Standard)
const
90 ReelMarkersAsset::unset (
Marker m)
97 ReelMarkersAsset::get (
Marker m)
const
99 auto i = _markers.find (m);
100 if (i == _markers.end ()) {
108 ReelMarkersAsset::write_to_cpl (xmlpp::Node* node, Standard standard)
const
110 int const tcr = edit_rate().numerator / edit_rate().denominator;
111 auto asset = ReelAsset::write_to_cpl (node, standard);
112 auto ml = asset->add_child(
"MarkerList");
113 for (
auto const& i: _markers) {
114 auto m = ml->add_child(
"Marker");
115 m->add_child(
"Label")->add_child_text(marker_to_string(i.first));
116 m->add_child(
"Offset")->add_child_text(raw_convert<string>(i.second.as_editable_units_ceil(tcr)));
123 ReelMarkersAsset::equals (shared_ptr<const ReelMarkersAsset> other,
EqualityOptions opt, NoteHandler note)
const
125 if (!asset_equals(other, opt, note)) {
A fraction (i.e. a thing with an integer numerator and an integer denominator).
An entry in a <Reel> which refers to a use of a piece of content.
A representation of time within a DCP.
Namespace for everything in libdcp.
@ FFOI
first frame of intermission
@ FFEC
first frame of end credits
@ LFMC
last frame of moving credits
@ LFOI
last frame of intermission
@ FFMC
first frame of moving credits
@ FFTC
first frame of title credits
@ LFOC
last frame of composition
@ FFOC
first frame of composition
@ LFEC
last frame of end credits
@ LFTC
last frame of title credits
Methods for conversion to/from string.
A class to describe what "equality" means for a particular test.