Commit graph

131 commits

Author SHA1 Message Date
Paul Davis
caba355012 Add required copy constructor for Temporal::Meter 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
5895909188 libtemporal: remove unnecessary inclusion of pbd/compose.h from beats.h
this causes breakage in clangs ADL lookup of various operator<<() overloads
2021-08-13 12:51:35 -06:00
Paul Davis
3170f880c2 stop clang from complaining about a missing return after a guaranteed assert() failure 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
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
b84402f4f8 intial steps for adding legacy (v0-5) tempo map deserialization support 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
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
0b1d44f422 temporal: fix timepos_t::decrement() to not switch domains 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
c0c3fd07c9 libtemporal: add timecnt_t::end() and timecnt_t::set_time_domain() 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
5b3c5d3782 libtemporal: fix implementation of timepos_t::max() to avoid overflow for Beats time 2021-08-13 12:51:34 -06:00
Paul Davis
b2510c0da2 libardour: use appropriate method to set AutomationList time domain from ::set_state() 2021-08-13 12:51:34 -06:00
Paul Davis
d576fc8ca9 libtemporal: when computing Beats from a ticks value, do not try to pass potentially overflowing ticks value 2021-08-13 12:51:34 -06:00
Paul Davis
1af74f7398 libtemporal: correct the definition of std::numeric_limits<Beats>::max(). Comment in code contains details. 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
877e896caf libtemporal: TempoMap::apply_with_metrics() needs to use *all* metrics (inc. MusicTimePoints) 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
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
cc0d065443 libtemporal: preparations to solve upcoming diamond inheritance problem 2021-08-13 12:51:34 -06:00
Paul Davis
4e6c06bc95 libtemporal: add maybe-not-required operator>> for timeline types 2021-08-13 12:51:34 -06:00
Paul Davis
ce82efafcf libtemporal: slightly improve output from conversion statistics 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
c8175b7c49 libtemporal: add new constructors for MusicTimePoint and MeterPoint 2021-08-13 12:51:33 -06:00
Paul Davis
b8a7de43b6 libtemporal: change Tempo API to ensure that the correct construtor is called
This could be probably be improved with an even more distinct ramped/non-ramped API
2021-08-13 12:51:33 -06:00
Paul Davis
25375ee6f4 add timepos_t::set_time_domain() to potentially change time domains 2021-08-13 12:51:33 -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
8f147f273a add new debug bit for Temporal grid stuff 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
8737603d93 libtemporal: add abort_update() API to header 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
6a9330b2b0 libtemporal: fix TempoMap::fetch_writable() so that it actually does what its name describes 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
d165c492af temporal: fix/simplify/improve parsing of time values from strings 2021-08-13 12:51:32 -06:00
Paul Davis
e590598dcf libtemporal: move DEBUG::Beats into correct location 2021-08-13 12:51:32 -06:00
Paul Davis
f015c08dd9 libtemporal: move Beats operator<< and operator>> to .cc and add exceptions for input 2021-08-13 12:51:32 -06:00
Paul Davis
78233b343f libtemporal: add operator<<() for ratio_t 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
3eac6ac7dc Temporal: remove last (?) double-based method 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