summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-24 23:19:08 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-24 23:19:08 +0100
commitf8005516a681b805ccc2d929f63312ac711fdc24 (patch)
tree9785795f122a1be7fcae2498dd9c7ac80b219fcd /src
parente9ab736ffa8088301edd658afcc98a9add517205 (diff)
Allow setting of a CPL's MXF keys.
Diffstat (limited to 'src')
-rw-r--r--src/cpl.cc8
-rw-r--r--src/cpl.h2
-rw-r--r--src/reel.cc11
-rw-r--r--src/reel.h3
4 files changed, 24 insertions, 0 deletions
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<PathAssetMap> asset_maps, string id) const
return make_pair ("", shared_ptr<const parse::AssetMapAsset> ());
}
+
+void
+CPL::set_mxf_keys (Key key)
+{
+ for (list<shared_ptr<Reel> >::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 <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#include <libxml++/libxml++.h>
+#include <libdcp/key.h>
#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<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> notes) const;