+ note (DCP_ERROR, "Reel: assets differ");
+ return false;
+ }
+
+ if (_main_subtitle && !_main_subtitle->equals (other->_main_subtitle, opt, note)) {
+ return false;
+ }
+
+ if (_closed_caption && !_closed_caption->equals (other->_closed_caption, opt, note)) {
+ return false;
+ }
+
+ if ((_atmos && !other->_atmos) || (!_atmos && other->_atmos)) {
+ note (DCP_ERROR, "Reel: assets differ");
+ return false;
+ }
+
+ if (_atmos && !_atmos->equals (other->_atmos, opt, note)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool
+Reel::encrypted () const
+{
+ return (
+ (_main_picture && _main_picture->encrypted ()) ||
+ (_main_sound && _main_sound->encrypted ()) ||
+ (_main_subtitle && _main_subtitle->encrypted ()) ||
+ (_closed_caption && _closed_caption->encrypted ()) ||
+ (_atmos && _atmos->encrypted ())
+ );
+}
+
+void
+Reel::add (DecryptedKDM const & kdm)
+{
+ list<DecryptedKDMKey> keys = kdm.keys ();
+
+ for (list<DecryptedKDMKey>::iterator i = keys.begin(); i != keys.end(); ++i) {
+ if (_main_picture && i->id() == _main_picture->key_id()) {
+ _main_picture->asset()->set_key (i->key ());
+ }
+ if (_main_sound && i->id() == _main_sound->key_id()) {
+ _main_sound->asset()->set_key (i->key ());
+ }
+ if (_main_subtitle && i->id() == _main_subtitle->key_id()) {
+ shared_ptr<SMPTESubtitleAsset> s = dynamic_pointer_cast<SMPTESubtitleAsset> (_main_subtitle->asset());
+ if (s) {
+ s->set_key (i->key ());
+ }
+ }
+ if (_closed_caption && i->id() == _closed_caption->key_id()) {
+ shared_ptr<SMPTESubtitleAsset> s = dynamic_pointer_cast<SMPTESubtitleAsset> (_closed_caption->asset());
+ if (s) {
+ s->set_key (i->key ());
+ }
+ }
+ if (_atmos && i->id() == _atmos->key_id()) {
+ _atmos->asset()->set_key (i->key ());
+ }