diff --git a/src/lib/time/time.cpp b/src/lib/time/time.cpp index 996f1e07e..657e09cda 100644 --- a/src/lib/time/time.cpp +++ b/src/lib/time/time.cpp @@ -126,18 +126,20 @@ namespace time { * @warning internal Lumiera time values refer to an * implementation dependent time origin/scale. * @return string rendering of the actual, underlying - * implementation value, as \c h:m:s:ms + * implementation value, as `h:m:s:ms` */ Time::operator string() const { return string (lumiera_tmpbuf_print_time (t_)); } - /** @note recommendation to use TCode for external representation */ + /** @note recommendation is to use TCode for external representation + * @remarks this is the most prevalent internal diagnostics display + * of any "time-like" value, it is meant to be compact. */ TimeValue::operator string() const { gavl_time_t time = t_; - int millis, seconds; + int64_t millis, seconds; bool negative = (time < 0); if (negative) time = -time; @@ -151,15 +153,37 @@ namespace time { ; } + Offset::operator string() const + { + return (t_< 0? "" : "∆") + + TimeValue::operator string(); + } + + Duration::operator string() const + { + return "≺"+TimeValue::operator string()+"≻"; + } + TimeSpan::operator string() const { return string (lumiera_tmpbuf_print_time (t_)) - + "["+string(dur_)+"]"; + + string (dur_); + } + + + /** visual framerate representation (for diagnostics) */ + FrameRate::operator string() const + { + return 1==denominator() ? lexical_cast (numerator())+"FPS" + : lexical_cast (numerator()) + + "/" + + lexical_cast (denominator()) + + "FPS"; } /** @internal backdoor to sneak in a raw time value - * bypassing any normalisation and limiting */ + * bypassing any normalisation and limiting */ TimeValue TimeValue::buildRaw_ (gavl_time_t raw) { @@ -186,17 +210,6 @@ namespace time { return Duration (1, *this); } - - - /** visual framerate representation (for diagnostics) */ - FrameRate::operator string() const - { - return 1==denominator() ? lexical_cast (numerator())+"FPS" - : lexical_cast (numerator()) - + "/" - + lexical_cast (denominator()) - + "FPS"; - } diff --git a/src/lib/time/timevalue.hpp b/src/lib/time/timevalue.hpp index d4585eb0c..1e63dc15d 100644 --- a/src/lib/time/timevalue.hpp +++ b/src/lib/time/timevalue.hpp @@ -315,6 +315,9 @@ namespace time { return TimeValue(std::llabs (t_)); } + /** @internal diagnostics, indicating ∆ */ + operator std::string () const; + // Supporting sign flip Offset operator- () const; }; @@ -402,6 +405,10 @@ namespace time { void accept (Mutation const&); + + /** @internal diagnostics */ + operator std::string () const; + /// Supporting backwards use as offset Offset operator- () const;