Paul Davis
34a3db7eaa
use existing (inline) method for updating thread local tempo map after update (avoid code duplication)
2021-08-13 12:51:34 -06:00
Paul Davis
901f593af5
avoid unnecessary extra fetch of thread-local tempo map after undo/redo
2021-08-13 12:51:34 -06:00
Paul Davis
cffc25a11c
libtemporal: make TempoMap::metric_at() variants use all Points, to account for music time points as well as explicit tempo/meter points
2021-08-13 12:51:34 -06:00
Paul Davis
c2401c3097
libtemporal: redesign TempoMap::get_grid() to iterate over _points rather than separated _tempos and _meters
2021-08-13 12:51:34 -06:00
Paul Davis
8124bec5a1
libtemporal: fix XML node structure for MusicTimePoint
2021-08-13 12:51:34 -06:00
Paul Davis
1035f9bd62
libtemporal: fix crash caused by thinko
2021-08-13 12:51:34 -06:00
Paul Davis
388fa1b894
libtemporal: when removing tempos/meters/musictime points, remove them from TempoMap::_points also
2021-08-13 12:51:34 -06:00
Paul Davis
982ccec7ab
libtemporal: when adding tempos/meters/musictime points, add them to TempoMap::_points also
2021-08-13 12:51:34 -06:00
Paul Davis
b43eca15b0
Revert "libtemporal: the TempoMap::_points list serves no purpose, so remove it"
...
This reverts commit edc93fc62b6a36949b3cc37aee333904bc6b97f0.
2021-08-13 12:51:34 -06:00
Paul Davis
d6d0eb0d9e
libtemporal: MusicTimePoint now IS-A Point,Tempo and Meter, all at once
2021-08-13 12:51:34 -06:00
Paul Davis
ffc9ab66b5
libtemporal: remove TempoMap::metric_at_locked() methods
...
There is no lock anymore, all modifications are done via RCU
2021-08-13 12:51:33 -06:00
Paul Davis
c9d3381935
libtemporal: increase DEBUG_TRACE utility for ::get_grid() and related matters
2021-08-13 12:51:33 -06:00
Paul Davis
bd1b6dcda3
libtemporal: start making tempo map work with non-monotonic BBT "bar times" present
2021-08-13 12:51:33 -06:00
Paul Davis
97a3469972
use new Tempo API in two places where Tempo is explicitly constructed
2021-08-13 12:51:33 -06:00
Paul Davis
c32de2355e
extra DEBUG_TRACE statement in tempo map grid computation
2021-08-13 12:51:33 -06:00
Paul Davis
eccfc1db10
libtemporal: fix grid generation if we pass additional markers before reaching the end
2021-08-13 12:51:32 -06:00
Paul Davis
3017cd0c1f
libtemporal: remove unnecessary debug output
2021-08-13 12:51:32 -06:00
Paul Davis
a9bf1cff81
libtemporal: add and use TempoMap::superclocks_per_grid_at() to return superclock duration of a measure/bar division. This corrects the results of ::get_grid()
2021-08-13 12:51:32 -06:00
Paul Davis
7f19f13ea9
libtemporal: superclocks_per_bar/grid() do not need a sample rate argument, so remove it
2021-08-13 12:51:32 -06:00
Paul Davis
e187752771
libtemporal: use DEBUG::Grid inside TempoMap::get_grid() for slightly easier debugging
2021-08-13 12:51:32 -06:00
Paul Davis
7ec5af0b60
libtemporal: fix/improve TempoMap::move_meter() for audio-time case
2021-08-13 12:51:32 -06:00
Paul Davis
84f53e3dc9
libtemporal: return value from function
2021-08-13 12:51:32 -06:00
Paul Davis
fbb8a562fd
libtemporal: fix implementation of TempoMetric::bbt_at() to deal with cases where the beats value is not in quarter notes e.g. 7/8 time
2021-08-13 12:51:32 -06:00
Paul Davis
68f6bff258
libtemporal: improve implementation/accuracy of Meter::round_to_bar()
2021-08-13 12:51:32 -06:00
Paul Davis
be0a68c610
libtemporal: the TempoMap::_points list serves no purpose, so remove it
2021-08-13 12:51:32 -06:00
Paul Davis
261c46e0f7
libtemporal: fix meter/tempo API so that we always put a heap-allocated object in the tempos/meters lists
2021-08-13 12:51:32 -06:00
Paul Davis
9a2ec93a74
libtemporal: fix bug with placement of new MeterPoint
2021-08-13 12:51:32 -06:00
Paul Davis
d5bfbe1cf4
libtemporal: provide API to abort TempoMap RCU update step
2021-08-13 12:51:32 -06:00
Paul Davis
2c80aab912
libtemporal: do not emit MapChanged from methods that change TempoMap, only when we use RCU to switch ptrs
2021-08-13 12:51:32 -06:00
Paul Davis
37399f7d50
libtemporal: move TempoMap::update() into .cc, add debug output and emit relevant signal at end
2021-08-13 12:51:32 -06:00
Paul Davis
364fffd458
temporal: TempoMap::Changed is now a static member named TempoMap::MapChanged
2021-08-13 12:51:32 -06:00
Paul Davis
657350455e
temporal: implement copy operator and operator= for TempoMap
2021-08-13 12:51:32 -06:00
Paul Davis
146b432c51
temporal: extend debug output
2021-08-13 12:51:32 -06:00
Paul Davis
4b52e1bf23
temporal: slightly reduce overflow risk (see comment)
2021-08-13 12:51:32 -06:00
Paul Davis
279d1aa5dc
temporal: catch a special case when converting between superclock and beats
2021-08-13 12:51:32 -06:00
Paul Davis
13f4ee2c1e
temporal: remove unnecessary TempoMap::dump_locked() method
2021-08-13 12:51:32 -06:00
Paul Davis
47aa232f60
temporal: fix up creating/resetting tempo map state via XML
2021-08-13 12:51:32 -06:00
Paul Davis
fa67e07d87
temporal: remove debug output
2021-08-13 12:51:32 -06:00
Paul Davis
1e9e02e42f
temporal: fix setting tempos and meters from XML state
2021-08-13 12:51:32 -06:00
Paul Davis
3e8f4d80fb
remove (almost) all floating point operations from Beats, add DoubleableBeats
...
The latter is a "wrapper" around Beats that provides ::to_double() for those times when we
absolutely need a floating point representation
2021-08-13 12:51:32 -06:00
Paul Davis
5bef968069
Temporal: replace thread_local sample rate with callback to get sample rate
2021-08-13 12:51:31 -06:00
Paul Davis
6e9f57d2ad
Temporal: remove scope braces left over from when we used a lock to protect the tempo map
2021-08-13 12:51:31 -06:00
Paul Davis
b6f2e39ed4
Temporal: remove BarTime
2021-08-13 12:51:31 -06:00
Paul Davis
5987376afc
Temporal: avoid recursive descent in TempoMap::quarters_at (timepos_t)
2021-08-13 12:51:31 -06:00
Paul Davis
43d84620e0
Temporal: clean up API to remove ambiguity about ::quarter*_at_*
...
superclock_t and samplepos_t have the same underlying C++ type, so methods that accept one or the
other as an argument need to be named to make it clear which type they accept. We do not need
the superclock_t variant publically, but it turns out to be useful within TempoMap.
2021-08-13 12:51:31 -06:00
Paul Davis
9402548677
Temporal: add lots more DEBUG::TemporalMap output to tempo.cc
2021-08-13 12:51:31 -06:00
Paul Davis
793579cf3f
Temporal: expand displayed info for Tempo's operator<<
2021-08-13 12:51:31 -06:00
Paul Davis
a0b9030e3c
Temporal: fix logic during ::get_grid that ignored if rounding did nothing
2021-08-13 12:51:31 -06:00
Paul Davis
f1bb135013
Temporal: fix computation of ::quarters_at()
2021-08-13 12:51:31 -06:00
Paul Davis
c3d325b56a
Temporal: clean up API for timepos_t to remove unneeded duplicates and remove ambiguity
2021-08-13 12:51:31 -06:00