diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-16 22:40:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | d3302b79771116d7e79a841e40e5a1917975442c (patch) | |
| tree | efd464a422fa6a700eaa09a8c2859940f7cd5bdc /src/lib/overlaps.h | |
| parent | e3d86593186ebf6c73a54b679332964d6b1b750b (diff) | |
More of previous.
Diffstat (limited to 'src/lib/overlaps.h')
| -rw-r--r-- | src/lib/overlaps.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/lib/overlaps.h b/src/lib/overlaps.h index 6018af15f..d8a44b554 100644 --- a/src/lib/overlaps.h +++ b/src/lib/overlaps.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,23 +17,14 @@ */ -/** @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; - } +#include "types.h" +#include "dcpomatic_time.h" - if (DCPTimePeriod(c->position(), c->end()).overlaps (period)) { - overlaps.push_back (c); - } - } +class ContentPart; - return overlaps; -} +/** @return Pieces of content with a given part (video, audio, + * subtitle) that overlap a specified time range in the given + * ContentList */ +ContentList overlaps ( + ContentList cl, boost::function<boost::shared_ptr<ContentPart> (boost::shared_ptr<const Content>)> part, DCPTime from, DCPTime to + ); |
