Commit graph

148 commits

Author SHA1 Message Date
Paul Davis
4376185a6b temporal: fix TempoPoint::superclock_at (Beats)
a negative beat position needs to be legal, so the assert was moved and modified. The only check
for a negative value is that the TempoPoint being used is at absolute zero.

This check might turn out to be wrong in the future, but for now we still require a tempo and
meter point at absolute zero
2021-10-29 12:55:14 -06:00
Paul Davis
89c17dfe7d remove debug output 2021-10-05 14:00:34 -06:00
Paul Davis
dadf530243 temporal: change loading of session format 3x tempo maps
We were attempting to add the initial tempo and meter twice, which was unwise
2021-10-05 13:57:10 -06:00
Robin Gareus
ed3d374f47
Fix --no-nls compilation 1/2 -- #8802
pbd/i18n.h MUST NEVER be included from header files and always be
the last include. This is because `_` is declared other headers
notably boost and some apple headers.

leading to issues like
../libs/pbd/gettext.h:58:27: error: expected unqualified-id before ‘const’
   58 | # define gettext(Msgid) ((const char *) (Msgid))
2021-09-27 16:28:44 +02:00
Paul Davis
fee4292bde allow negative superclock -> negative beats computation 2021-08-23 11:36:54 -06:00
Paul Davis
38aa2560f3 libtemporal: remove unnecessary initialization 2021-08-13 12:51:35 -06:00
Paul Davis
f61adcd738 temporal: knarly template code to consolidate and rationalize duplicated methods 2021-08-13 12:51:35 -06:00
Paul Davis
585346ce56 libtemporal: fix many different issues with tempo ramps
API changes, ensuring omega is computed, saved, and restored, generic methods to get tempo/meter at a position, and lots more
2021-08-13 12:51:35 -06:00
Paul Davis
f721655916 libtemporal: to quote the matrix, there is no lock 2021-08-13 12:51:35 -06:00
Paul Davis
bccdc95f32 libtemporal: fix logic for ::get_tempo_and_meter() if starting point is the timeline start 2021-08-13 12:51:35 -06:00
Paul Davis
1f8290f154 generalize repeated code into a template method, add lots of const-ness to facilitate this 2021-08-13 12:51:35 -06:00
Paul Davis
c5ecd14622 temporal: fix logic errors in setting up TempoMetric objects
will likely revisit this to avoid code-duplication and "optimize" traversal of _points list
2021-08-13 12:51:35 -06:00
Paul Davis
8bada4b5e1 remove public ::bbt_at (INTEGER) methods, because of superclock_t/samplepos_t confusion
libtemporal still needs ::bbt_at (superclock_t) fairly often so retain it as a private method, but public
interfaces take either Beats or timepos_t
2021-08-13 12:51:35 -06:00
Paul Davis
53e411c011 fix logic error in conditional 2021-08-13 12:51:35 -06:00
Paul Davis
6f2fdc2695 functioning loading of older tempo map XML data 2021-08-13 12:51:35 -06:00
Paul Davis
b84402f4f8 intial steps for adding legacy (v0-5) tempo map deserialization support 2021-08-13 12:51:35 -06:00
Paul Davis
344dd26788 improved DEBUG_TRACE statements for tempo map 2021-08-13 12:51:35 -06:00
Paul Davis
cd34695944 fix TempoMap::quarters_at_superclock (superclock_t) 2021-08-13 12:51:35 -06:00
Paul Davis
74ff3b22b8 fix TempoPoint::superclock_at(Beats) 2021-08-13 12:51:35 -06:00
Paul Davis
216945a89c move TempoMap::write_copy() into .cc file instead of .h 2021-08-13 12:51:35 -06:00
Paul Davis
ce3fb0507c change return type of Tempo::set_{ramped,clamped} and fix call sites 2021-08-13 12:51:35 -06:00
Paul Davis
99c8c0b658 initial, tentative, untested implementation of TempoMap::remove_time() 2021-08-13 12:51:35 -06:00
Paul Davis
991a7bf8a7 add TempoMap::count_bars() to allow bar counting even with position (BBT) markers in the tempo map
This just reuses the algorithm in TempoMap::get_grid() by asking for just the bar grid, and counting the
size of the result
2021-08-13 12:51:35 -06:00
Paul Davis
0ab2308523 reimplement TempoMap::midi_clock_beat_at_or_after() 2021-08-13 12:51:35 -06:00
Paul Davis
daad7b74ae libtemporal: rename TempoMap::full_duration_at() to ::convert_duration() and reorder parameters 2021-08-13 12:51:34 -06:00
Paul Davis
7773fc5b64 libtemporal: TempoMap::full_duration_at() returns correct value for unchanged time domain call 2021-08-13 12:51:34 -06:00
Paul Davis
b7bc3b1947 libtemporal: expand comment to explain more about what TempoMap::full_duration_at() does 2021-08-13 12:51:34 -06:00
Paul Davis
beaa1b3fcb be sure to check the return from the RCU mgr ::update method() inside TempoMap::update() 2021-08-13 12:51:34 -06:00
Paul Davis
bbb3ca01fa libtemporal: remove several BBT-related methods that are not used and problematic for BBT/position markers 2021-08-13 12:51:34 -06:00
Paul Davis
0667a50a11 libtemporal: improve TempoMap::get_grid()'s decision making about what bar points to include when bar_mod == 1 2021-08-13 12:51:34 -06:00
Paul Davis
a49ed5505e libtemporal: no need for a default MusicTimePoint in the tempo map (default tempo+meter points serve same role) 2021-08-13 12:51:34 -06:00
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