X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcpomatic_time.cc;h=812c756ec27891224495b1a57b3e374ee793321d;hb=ed60129bb2051649de3740ff75a7db71db9e7897;hp=98888646d0a841e26bcb077a426be8ac66e1e8e4;hpb=04533b9cf34ce8089113015715083ee9c5b2b001;p=dcpomatic.git diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index 98888646d..812c756ec 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -49,3 +49,15 @@ operator<< (ostream& s, DCPTime t) s << "[DCP " << t.get() << " " << t.seconds() << "s]"; return s; } + +bool +ContentTimePeriod::overlaps (ContentTimePeriod const & other) const +{ + return (from < other.to && to >= other.from); +} + +bool +ContentTimePeriod::contains (ContentTime const & other) const +{ + return (from <= other && other < to); +}