2 #include <Process/TimeValue.hpp>
5 #include <score/serialization/IsTemplate.hpp>
6 #include <score/serialization/JSONVisitor.hpp>
10 inline QDebug operator<<(QDebug d,
const TimeVal& tv)
14 d << tv.msec() <<
"ms";
29 s.stream() << tv.impl;
34 s.stream() >> tv.impl;
43 if(Q_UNLIKELY(tv.impl > ossia::time_value::infinite_min))
45 s.stream.Int64(ossia::time_value::infinity);
47 else if(Q_UNLIKELY(tv.impl < 0))
49 qDebug() <<
"Warning: saving a time_value < 0. This likely indicates a bug: "
55 s.stream.Int64(tv.impl);
62 using namespace std::literals;
63 if(Q_LIKELY(s.base.IsInt64()))
65 tv.impl = s.base.GetInt64();
67 else if(s.base.IsUint64())
70 qDebug() <<
"Warning: loading a value > to the maximum of an int64_t: "
71 << s.base.GetUint64();
72 tv.impl = ossia::time_value::infinity;
83 qDebug() <<
"Warning: could not load a TimeVal";
Definition: VisitorInterface.hpp:53
Definition: DataStreamVisitor.hpp:27
Definition: DataStreamVisitor.hpp:202
Definition: VisitorInterface.hpp:61
Definition: JSONVisitor.hpp:52
Definition: JSONVisitor.hpp:423
Definition: VisitorInterface.hpp:13
Definition: TimeValue.hpp:21