If an event has a timestamp, in nanoseconds, that is > Int64.max, MIDI Monitor will crash when saving the document.
This isn't very typical for normal timestamps, since the value is in nanoseconds since boot and Int64.max is 292 years. However, it's entirely possible that we see bogus timestamps, and we need to handle them without crashing.
(We have a UInt64 and construct an Int64 from it, then encode and decode the Int64, since there is no way to encode/decode a UInt64 with NSEncoder. The UInt64 value may be out the possible range of Int64, and Swift will crash if it is.)
If an event has a timestamp, in nanoseconds, that is >
Int64.max
, MIDI Monitor will crash when saving the document.This isn't very typical for normal timestamps, since the value is in nanoseconds since boot and
Int64.max
is 292 years. However, it's entirely possible that we see bogus timestamps, and we need to handle them without crashing.(We have a
UInt64
and construct anInt64
from it, then encode and decode theInt64
, since there is no way to encode/decode aUInt64
withNSEncoder
. TheUInt64
value may be out the possible range ofInt64
, and Swift will crash if it is.)