diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-12-20 23:41:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-03-12 23:41:00 +0100 |
| commit | 9936ec84cb2a5e5f8f4fe77bcd5742f06bdb2d6c (patch) | |
| tree | 95d48e9cd856b2c92d14e7b91da3ab1f0d49bdda /src/lib/dcpomatic_time.cc | |
| parent | 521424e747dced3ade9600fc62c48526e199ef16 (diff) | |
Add operator<= for HMSF.
Diffstat (limited to 'src/lib/dcpomatic_time.cc')
| -rw-r--r-- | src/lib/dcpomatic_time.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index ac797f8f4..60fc5342a 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -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)) |
