Monotonic timestamp source for MIDI input events, measured in seconds from a base captured when the port opened.
More...
Monotonic timestamp source for MIDI input events, measured in seconds from a base captured when the port opened.
MidiEvent::timestamp is documented as "absolute time in seconds" (buffer.hpp). The Windows backend reports seconds-since-open via QPC (winmidi_device.cpp) and CoreMIDI reports host-time seconds; the Linux ALSA raw-midi path previously hardcoded 0.0, losing all timing. This helper gives the ALSA path the same seconds-since-open semantics as Windows using std::chrono::steady_clock, which is guaranteed monotonic.
The now-taking overloads are pure, so the conversion is unit-testable with synthetic time points without depending on the wall clock.