+ for (list<shared_ptr<Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
+ if ((*i)->main_picture ()) {
+ c.push_back ((*i)->main_picture());
+ }
+ if ((*i)->main_sound ()) {
+ c.push_back ((*i)->main_sound());
+ }
+ if ((*i)->main_subtitle ()) {
+ c.push_back ((*i)->main_subtitle());
+ }
+ }
+
+ return c;
+}
+
+bool
+CPL::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+{
+ shared_ptr<const CPL> other_cpl = dynamic_pointer_cast<const CPL> (other);
+ if (!other_cpl) {
+ return false;
+ }
+
+ if (_annotation_text != other_cpl->_annotation_text && !opt.cpl_annotation_texts_can_differ) {
+ stringstream s;
+ s << "CPL: annotation texts differ: " << _annotation_text << " vs " << other_cpl->_annotation_text << "\n";
+ note (DCP_ERROR, s.str ());
+ return false;
+ }
+
+ if (_content_kind != other_cpl->_content_kind) {
+ note (DCP_ERROR, "CPL: content kinds differ");
+ return false;
+ }
+
+ if (_reels.size() != other_cpl->_reels.size()) {
+ note (DCP_ERROR, String::compose ("CPL: reel counts differ (%1 vs %2)", _reels.size(), other_cpl->_reels.size()));
+ return false;
+ }
+
+ list<shared_ptr<Reel> >::const_iterator a = _reels.begin ();
+ list<shared_ptr<Reel> >::const_iterator b = other_cpl->_reels.begin ();
+
+ while (a != _reels.end ()) {
+ if (!(*a)->equals (*b, opt, note)) {
+ return false;
+ }
+ ++a;
+ ++b;
+ }
+
+ return true;