X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Foverlaps.cc;h=32801de39e5c0449a6b85fbb1de02b7c1a1c831b;hb=9b946fc5250eff5a5dd4a661896916fcd5d9bd4b;hp=983dc7a452f5da7cc7ae75f5f258234ff75830e0;hpb=e3d86593186ebf6c73a54b679332964d6b1b750b;p=dcpomatic.git diff --git a/src/lib/overlaps.cc b/src/lib/overlaps.cc index 983dc7a45..32801de39 100644 --- a/src/lib/overlaps.cc +++ b/src/lib/overlaps.cc @@ -1,36 +1,37 @@ /* Copyright (C) 2013-2016 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ #include "overlaps.h" #include "types.h" #include "content.h" -#include -using boost::shared_ptr; +using std::shared_ptr; using boost::function; +using namespace dcpomatic; -ContentList overlaps (ContentList cl, function (shared_ptr)> part, DCPTime from, DCPTime to) +ContentList overlaps (shared_ptr film, ContentList cl, function)> part, DCPTime from, DCPTime to) { ContentList overlaps; DCPTimePeriod period (from, to); - BOOST_FOREACH (shared_ptr i, cl) { - if (part(i) && DCPTimePeriod(i->position(), i->end()).overlaps (period)) { + for (auto i: cl) { + if (part(i) && DCPTimePeriod(i->position(), i->end(film)).overlap(period)) { overlaps.push_back (i); } }