There is no need for scts_set now. "Early" use of SCTS will just give the
value 0. DEBUG_EARLY_SCTS_USE can thus just check that
_superclock_ticks_per_second doesn't have the initial value of 0.
Make sure all code paths that use Temporal will initialize and reset it
properly. Some code paths (in tet runners) doesn't use Sessions, so
Temporal::reset() has to be invoked directly.
Just set the static superclock variable to 0 as initial value.
TempoMap will still be initialized early as a singleton, but we
introduce a new constructor so it is created empty (and thus not really
usable until Temporal::reset() or similar has populated it).
We can thus drop the static initialization of superclock. The default
superclock rate of 282240000 will now only live in Temporal::reset().
With this change there should no longer be any uninitialized use of
superclock_ticks_per_second(), and there should not be any problems for
DEBUG_EARLY_SCTS_USE to catch. (It is however broken in other ways -
that will be fixed next.)
We do not want a value as large as the previous one, which limits the time
range that can be represented in 62 bits unnecessarily. The new value is
9 times smaller than the previous value, and loses only 384000 as a significant
factor.
This commit also switches to using an (inline) accessor for superclock_ticks_per_second,
making it possible in debug/testing phases to spot early/illegal uses of the value.
Now using a globally-scoped static variable which is updated by the
AudioEngine whenever an SR change occurs. Defaults to 48kHz and can
be used even before there is a backend.
Later I'll need to push some extra changes (to support 'tempo_map_p' and 'boost::intrusive::list' etc) but these initial ones (hopefully!) won't cause any issues for the other builds.