diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-12-19 19:57:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-03 00:25:58 +0200 |
| commit | 8784debc7de4daeb04fb142a4097a34a20cf47a4 (patch) | |
| tree | 1025ec7043cf8412507f81d5c90dc7f4f2196186 /src/lib/dcpomatic_time.cc | |
| parent | 1bba4979cc19efaedf1258bc30f5e8f2d968dcd6 (diff) | |
Move to_string() from a free function into a member of Time.
Diffstat (limited to 'src/lib/dcpomatic_time.cc')
| -rw-r--r-- | src/lib/dcpomatic_time.cc | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index 60fc5342a..f1be46925 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -107,39 +107,13 @@ dcpomatic::max (ContentTime a, ContentTime b) string -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 -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 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()); + __mingw_snprintf (buffer, sizeof(buffer), "[DCP %s %fs -> %s %fs]", p.from.to_string().c_str(), p.from.seconds(), p.to.get().c_str(), 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()); + snprintf (buffer, sizeof(buffer), "[DCP %s %fs -> %s %fs]", p.from.to_string().c_str(), p.from.seconds(), p.to.to_string().c_str(), p.to.seconds()); #endif return buffer; } |
