summaryrefslogtreecommitdiff
path: root/src/lib/dcp_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-24 11:40:34 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-24 14:28:32 +0100
commit1a693725f9a8cc6ba58f65b2f1ef03255d295f23 (patch)
tree91596f7800dcc02103c90f8f19c763f45281603e /src/lib/dcp_content.cc
parenta03e9a98ed667eb44c9dfbbeaf6da57f44992914 (diff)
Basic template support (#485).
Diffstat (limited to 'src/lib/dcp_content.cc')
-rw-r--r--src/lib/dcp_content.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 03e6f1aaa..a5c0e5da2 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -51,6 +51,7 @@ using boost::shared_ptr;
using boost::scoped_ptr;
using boost::optional;
using boost::function;
+using boost::dynamic_pointer_cast;
using dcp::raw_convert;
int const DCPContentProperty::CAN_BE_PLAYED = 600;
@@ -192,11 +193,11 @@ DCPContent::technical_summary () const
}
void
-DCPContent::as_xml (xmlpp::Node* node) const
+DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const
{
node->add_child("Type")->add_child_text ("DCP");
- Content::as_xml (node);
+ Content::as_xml (node, with_paths);
if (video) {
video->as_xml (node);
@@ -448,3 +449,14 @@ DCPContent::can_reference_subtitle (list<string>& why_not) const
return can_reference (bind (&Content::subtitle, _1), _("There is other subtitle content overlapping this DCP; remove it."), why_not);
}
+
+void
+DCPContent::use_template (shared_ptr<const Content> c)
+{
+ shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (c);
+ DCPOMATIC_ASSERT (dc);
+
+ _reference_video = dc->_reference_video;
+ _reference_audio = dc->_reference_audio;
+ _reference_subtitle = dc->_reference_subtitle;
+}