From f8005516a681b805ccc2d929f63312ac711fdc24 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 24 Sep 2013 23:19:08 +0100 Subject: Allow setting of a CPL's MXF keys. --- src/cpl.cc | 8 ++++++++ src/cpl.h | 2 ++ src/reel.cc | 11 +++++++++++ src/reel.h | 3 +++ 4 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/cpl.cc b/src/cpl.cc index 4c4d2e75..5d57c7c7 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -377,3 +377,11 @@ CPL::asset_from_id (list asset_maps, string id) const return make_pair ("", shared_ptr ()); } + +void +CPL::set_mxf_keys (Key key) +{ + for (list >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) { + (*i)->set_mxf_keys (key); + } +} diff --git a/src/cpl.h b/src/cpl.h index ee0da9a0..aadc7347 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -86,6 +86,8 @@ public: bool encrypted () const; + void set_mxf_keys (Key); + std::string id () const { return _id; } diff --git a/src/reel.cc b/src/reel.cc index ffb184ab..51aa560c 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -104,3 +104,14 @@ Reel::add_kdm (KDM const & kdm) } } } + +void +Reel::set_mxf_keys (Key key) +{ + _main_picture->set_key (key); + if (_main_sound) { + _main_sound->set_key (key); + } + + /* XXX: subtitle asset? */ +} diff --git a/src/reel.h b/src/reel.h index a5e79331..5dcb97c2 100644 --- a/src/reel.h +++ b/src/reel.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "types.h" namespace xmlpp { @@ -66,6 +67,8 @@ public: void write_to_cpl (xmlpp::Element *, bool) const; bool encrypted () const; + + void set_mxf_keys (libdcp::Key); bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function notes) const; -- cgit v1.2.3