diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-12-19 20:02:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-03 09:41:16 +0200 |
| commit | 7f35c43bafa0ce654b4cfb9c7ea5b6ea0c1ddd37 (patch) | |
| tree | bfb13f90192169e07c286dbd0535fc627dc02631 /src/lib/dcpomatic_time.h | |
| parent | 13d5b07d47401ac2ac3dfa58fe3baca7cf9fd64f (diff) | |
Add and use Time::proportion_of().
Diffstat (limited to 'src/lib/dcpomatic_time.h')
| -rw-r--r-- | src/lib/dcpomatic_time.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h index 2f788d580..c9f80e1e0 100644 --- a/src/lib/dcpomatic_time.h +++ b/src/lib/dcpomatic_time.h @@ -212,6 +212,10 @@ public: return ::ceil (_t * double(r) / HZ); } + double proportion_of(Time<S, O> other) const { + return static_cast<double>(_t) / other.get(); + } + bool negative() const { return _t < 0; } |
