Commit Graph

21 Commits

Author SHA1 Message Date
Mads Kiilerich 91314b68a5 temporal: always use Temporal::reset() for superclock and TempoMap default values
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.)
2023-09-20 12:30:53 -06:00
Paul Davis 733d59c65b temporal: unit testing more like unit testing
But still not really.
2023-06-08 14:01:17 -06:00
Paul Davis 01b8187cd3 temporal: add rudimentary paste test 2023-06-08 14:01:17 -06:00
Paul Davis 6039cea3dc temporal: improve cut buffer slightly by using different meters 2023-06-08 14:01:17 -06:00
Paul Davis 9e4b1d59a7 temporal: do something when pasting the cut buffer guard points
Don't think this is quite right yet - we get guard points even when
they are not really necessary
2023-06-06 09:04:34 -06:00
Paul Davis 7789df5b1c temporal: get cut/copy/paste test code slightly more useful 2023-06-05 16:35:17 -06:00
Paul Davis 7f977bf3e4 add skeleton unit test for tempo map cut buffer 2023-05-04 18:48:50 -06:00
Paul Davis 31a3c3c6f3 temporal: fix bad escape sequence in test source code 2023-02-15 18:36:23 -07:00
Paul Davis ee64390c48 fix libtemporal tests after API changes to the library 2023-02-15 17:51:28 -07:00
Paul Davis c7cf4d96e0 confusing comments - just say no 2022-11-21 18:33:17 -07:00
Paul Davis a84d3e04c4 tests: add new test to check that tempo map reset changes beat time correctly 2022-11-21 18:18:21 -07:00
Paul Davis 7a0da94ba3 fix RangeTest to account for Range now using exclusive ends, not inclusive 2022-10-05 17:30:45 -06:00
Robin Gareus 04647d5ae5 More unit-tests updates
* move RangeTest to libtemporal tests
* remove BeatsTest,  already converted from
  Evoral to temporal/BeatTest.cc
2022-10-01 16:57:12 +02:00
Paul Davis 696e05c3e5 convert internal implementation of Temporal::Beats to just use a 64 bit tick value
This expands significantly the maximum number of Beats that can be represented, which is a good
thing in itself. It slightly speeds up some Beats::operator methods, and slightly slows down
::get_beats() and ::get_ticks().

One minor change in an API user was required, and several tweaks to the unit tests due to the
macros being used by cppunit creating possible type confusion.

Units test pass
2022-06-21 12:26:54 -06:00
Paul Davis 1d10408bd1 temporal: add some relatively useless code to one of the timeline test functions 2022-04-05 20:52:10 -06:00
Paul Davis 92d82866e0 temporal: add some basic BBT time tests
Some of the subtraction tests may need revising because it is not immediately clear that the
current answers are correct.
2022-02-21 11:55:44 -07:00
Paul Davis c5d7883538 temporal: add skeleton for Timeline (timepos_t/timecnt_t) tests 2022-02-12 22:25:17 -07:00
Paul Davis baaf332a94 temporal: add skeleton for TempoMap tests 2022-02-12 22:25:17 -07:00
Paul Davis 14ac8fd36b skeleton for temporal/BBT testing (empty for now) 2022-02-12 17:51:30 -07:00
Paul Davis f641a0559f temporal: missing test source 2022-02-12 15:18:19 -07:00
Paul Davis 04bd9187e4 temporal: add (back) first set of unit tests
This just uses the old Evoral BeatTest. Some of the tests needed amending
because temporal uses rint() to convert between float and int, not just
a cast.
2022-02-12 15:12:35 -07:00