#include "reel.h"
#include "cpl.h"
#include "encryption.h"
+#include "kdm.h"
using std::string;
using std::list;
void
DCP::write_xml (XMLMetadata const & metadata, shared_ptr<Encryption> crypt) const
{
- for (list<shared_ptr<const CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
+ for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
(*i)->write_xml (metadata, crypt);
}
(*i)->write_to_pkl (asset_list);
}
- for (list<shared_ptr<const CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
+ for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
(*i)->write_to_pkl (asset_list);
}
chunk->add_child("Offset")->add_child_text ("0");
chunk->add_child("Length")->add_child_text (lexical_cast<string> (pkl_length));
- for (list<shared_ptr<const CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
+ for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
(*i)->write_to_assetmap (asset_list);
}
return false;
}
- list<shared_ptr<const CPL> >::const_iterator a = _cpls.begin ();
- list<shared_ptr<const CPL> >::const_iterator b = other._cpls.begin ();
+ list<shared_ptr<CPL> >::const_iterator a = _cpls.begin ();
+ list<shared_ptr<CPL> >::const_iterator b = other._cpls.begin ();
while (a != _cpls.end ()) {
if (!(*a)->equals (*b->get(), opt, note)) {
DCP::assets () const
{
list<shared_ptr<const Asset> > a;
- for (list<shared_ptr<const CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
+ for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
list<shared_ptr<const Asset> > t = (*i)->assets ();
a.merge (t);
}
bool
DCP::encrypted () const
{
- for (list<shared_ptr<const CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
+ for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
if ((*i)->encrypted ()) {
return true;
}
return false;
}
+
+void
+DCP::add_kdm (KDM const & kdm)
+{
+ list<KDMCipher> ciphers = kdm.ciphers ();
+
+ for (list<shared_ptr<CPL> >::iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
+ for (list<KDMCipher>::iterator j = ciphers.begin(); j != ciphers.end(); ++j) {
+ if (j->cpl_id() == (*i)->id()) {
+ (*i)->add_kdm (kdm);
+ }
+ }
+ }
+}