Add operator<= for HMSF.
[dcpomatic.git] / src / lib / dcpomatic_time.cc
index ac797f8f4205589c5ad605dc768deb83bbfed54e..60fc5342a33437414fec6f1b76ad38086320324c 100644 (file)
@@ -27,6 +27,25 @@ using std::string;
 using namespace dcpomatic;
 
 
+bool
+dcpomatic::operator<=(HMSF const& a, HMSF const& b)
+{
+       if (a.h != b.h) {
+               return a.h <= b.h;
+       }
+
+       if (a.m != b.m) {
+               return a.m <= b.m;
+       }
+
+       if (a.s != b.s) {
+               return a.s <= b.s;
+       }
+
+       return a.f <= b.f;
+}
+
+
 template <>
 Time<ContentTimeDifferentiator, DCPTimeDifferentiator>::Time (DCPTime d, FrameRateChange f)
        : _t (llrint(d.get() * f.speed_up))