X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcpomatic_time.cc;h=8abd7755530165f2f13ba50aeefc4194bf9e0fe4;hb=5f3a88d3ab1e9c1a13d7e61fc37a0c4cef8df9a5;hp=6563c6e5f9a2835082082a0116ebe489e16a3e72;hpb=b1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f;p=dcpomatic.git diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index 6563c6e5f..8abd77555 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -22,6 +22,7 @@ #include using std::string; +using namespace dcpomatic; template <> Time::Time (DCPTime d, FrameRateChange f) @@ -38,7 +39,7 @@ Time::Time (ContentTime d, Fra } DCPTime -min (DCPTime a, DCPTime b) +dcpomatic::min (DCPTime a, DCPTime b) { if (a < b) { return a; @@ -48,7 +49,7 @@ min (DCPTime a, DCPTime b) } DCPTime -max (DCPTime a, DCPTime b) +dcpomatic::max (DCPTime a, DCPTime b) { if (a > b) { return a; @@ -58,7 +59,7 @@ max (DCPTime a, DCPTime b) } ContentTime -min (ContentTime a, ContentTime b) +dcpomatic::min (ContentTime a, ContentTime b) { if (a < b) { return a; @@ -68,7 +69,7 @@ min (ContentTime a, ContentTime b) } ContentTime -max (ContentTime a, ContentTime b) +dcpomatic::max (ContentTime a, ContentTime b) { if (a > b) { return a; @@ -78,25 +79,37 @@ max (ContentTime a, ContentTime b) } string -to_string (ContentTime t) +dcpomatic::to_string (ContentTime t) { char buffer[64]; +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds()); +#else snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds()); +#endif return buffer; } string -to_string (DCPTime t) +dcpomatic::to_string (DCPTime t) { char buffer[64]; +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds()); +#else snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds()); +#endif return buffer; } string -to_string (DCPTimePeriod p) +dcpomatic::to_string (DCPTimePeriod p) { char buffer[64]; +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds()); +#else snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds()); +#endif return buffer; }