-/** @return Pieces of content type C that overlap a specified time range in the given ContentList */
-template<class C>
-std::list<boost::shared_ptr<C> >
-overlaps (ContentList cl, DCPTime from, DCPTime to)
-{
- std::list<boost::shared_ptr<C> > overlaps;
- DCPTimePeriod period (from, to);
- for (typename ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) {
- boost::shared_ptr<C> c = boost::dynamic_pointer_cast<C> (*i);
- if (!c) {
- continue;
- }
-
- if (DCPTimePeriod(c->position(), c->end()).overlaps (period)) {
- overlaps.push_back (c);
- }
- }
-
- return overlaps;
-}
+#include "types.h"
+#include "dcpomatic_time.h"
+
+class ContentPart;
+class Film;
+
+/** @return Pieces of content with a given part (video, audio,
+ * subtitle) that overlap a specified time range in the given
+ * ContentList
+ */
+ContentList overlaps (
+ std::shared_ptr<const Film> film, ContentList cl, boost::function<bool (std::shared_ptr<const Content>)> part, dcpomatic::DCPTime from, dcpomatic::DCPTime to
+ );