X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcpomatic_time.cc;h=ac797f8f4205589c5ad605dc768deb83bbfed54e;hb=18cb0e914922cd76e9c205e88962816970b5c0cb;hp=4f6c9b664e3c0ad28a7068f7cb5b03654ed77676;hpb=dc2eacb1e0fdbae03dd3fedd0146026ef333a7b2;p=dcpomatic.git diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index 4f6c9b664..ac797f8f4 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2016 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,27 +18,33 @@ */ + #include "dcpomatic_time.h" #include + using std::string; +using namespace dcpomatic; + template <> Time::Time (DCPTime d, FrameRateChange f) - : _t (llrint (d.get() * f.speed_up)) + : _t (llrint(d.get() * f.speed_up)) { } + template <> Time::Time (ContentTime d, FrameRateChange f) - : _t (llrint (d.get() / f.speed_up)) + : _t (llrint(d.get() / f.speed_up)) { } + DCPTime -min (DCPTime a, DCPTime b) +dcpomatic::min (DCPTime a, DCPTime b) { if (a < b) { return a; @@ -47,8 +53,9 @@ min (DCPTime a, DCPTime b) return b; } + DCPTime -max (DCPTime a, DCPTime b) +dcpomatic::max (DCPTime a, DCPTime b) { if (a > b) { return a; @@ -57,8 +64,9 @@ max (DCPTime a, DCPTime b) return b; } + ContentTime -min (ContentTime a, ContentTime b) +dcpomatic::min (ContentTime a, ContentTime b) { if (a < b) { return a; @@ -67,8 +75,9 @@ min (ContentTime a, ContentTime b) return b; } + ContentTime -max (ContentTime a, ContentTime b) +dcpomatic::max (ContentTime a, ContentTime b) { if (a > b) { return a; @@ -77,8 +86,9 @@ max (ContentTime a, ContentTime b) return b; } + string -to_string (ContentTime t) +dcpomatic::to_string (ContentTime t) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS @@ -89,8 +99,9 @@ to_string (ContentTime t) return buffer; } + string -to_string (DCPTime t) +dcpomatic::to_string (DCPTime t) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS @@ -101,8 +112,9 @@ to_string (DCPTime t) return buffer; } + string -to_string (DCPTimePeriod p) +dcpomatic::to_string (DCPTimePeriod p) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS