X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcpomatic_time.cc;h=812c756ec27891224495b1a57b3e374ee793321d;hb=5e4f001bf32e3cdf65efa34803d70e6c1c00c66b;hp=98888646d0a841e26bcb077a426be8ac66e1e8e4;hpb=1f8b45c7fd49714628009f5ed2161fbaa2b4d729;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); +}