13
0
Commit Graph

239 Commits

Author SHA1 Message Date
1288262ca7
Fix div/zero, allow switching backends
When switching backends, the effective sample-rate is zero.
This only affects the butler thread (the only active thread when
stopped). The actual issue here is the butler calling
"non-realtime-stop" without a backend. However fixing 0/0
generally seems appropriate.
```
#0 in int_div_round<long>(long, long) (x=0, y=0) at ../libs/pbd/pbd/integer_division.h:36
#1 in Temporal::samples_to_superclock(int64_t, int) (samples=0, sr=0) at ../libs/temporal/temporal/superclock.h:39
#2 in Temporal::timepos_t::timepos_t(long) (this=0x7f94bc0a5890, s=0) at ../libs/temporal/temporal/timeline.h:55
#3 in ARDOUR::Automatable::non_realtime_locate(long) (this=0x55a12a980cc8, now=0) at ../libs/ardour/automatable.cc:421
#4 in ARDOUR::Route::non_realtime_locate(long) (this=0x55a12a980ae0, pos=0) at ../libs/ardour/route.cc:5462
#5 in ARDOUR::Session::non_realtime_stop(bool, int, bool&) (this=0x55a12e0cd000, abort=false, on_entry=1, finished=@0x7f94bc0a5e0f: true) at ../libs/ardour/session_transport.cc:1487
#6 in ARDOUR::Session::butler_transport_work(bool) (this=0x55a12e0cd000, have_process_lock=false) at ../libs/ardour/session_transport.cc:1153
#7 in ARDOUR::Butler::thread_work() (this=0x55a12f3b7000) at ../libs/ardour/butler.cc:222
#8 in ARDOUR::Butler::_thread_work(void*) (arg=0x55a12f3b7000) at ../libs/ardour/butler.cc:16
```
2021-09-11 04:54:40 +02:00
1904c4aa29 temporal: fix operator>> for Beats when handling pre-nutempo formats (double) 2021-09-10 12:15:24 -06:00
John Emmas
f6ed73986b A few visibility changes needed for linking to libtemporal (when building with MSVC) 2021-09-04 12:28:15 +01:00
John Emmas
d7d966e02b Adapt 'Temporal::TempoMap::tempo_map_p' to be buildable with MSVC
Whenever a variable gets declared using 'thread_local' MSVC requires that it should not be compiled with DLL linkage (i.e. it mustn't be exportable). So for Temporal::TempoMap we'll need to export the required members individually, rather than exporting the entire class.
2021-09-03 10:02:41 +01:00
7dba843cb4 temporal: fix error in operator>> for BBT_offset 2021-08-31 22:33:33 -06:00
4eda53c8c9 temporal: add to_string() converters for BBT_Offset 2021-08-31 16:45:44 -06:00
Nil Geisweiller
21c94b23f3 Make BBT_Time::print_padded const
As this method does not modify BBT_Time it can be const.  This allows such
method to be called over a const BBT_Time instance.
2021-08-30 02:24:38 +03:00
John Emmas
d3cd621f7a Initial changes needed for building libtemporal with MSVC
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.
2021-08-29 11:03:58 +01:00
fee4292bde allow negative superclock -> negative beats computation 2021-08-23 11:36:54 -06:00
2f4a623c56 remove unnecessary headers 2021-08-13 15:31:43 -06:00
9c2e4ec6d2 libtemporal: fix timepos_t::set_time_domain()
For legacy reasons, this was going via a sample intermediate representation
2021-08-13 12:51:36 -06:00
1927e4673b remove StepSequencer, BeatBox and BeatBoxGUI from wscripts and #ifdef code occurences. Files remain 2021-08-13 12:51:36 -06:00
e7cdca1ea2 remove some debug output 2021-08-13 12:51:36 -06:00
caba355012 Add required copy constructor for Temporal::Meter 2021-08-13 12:51:35 -06:00
38aa2560f3 libtemporal: remove unnecessary initialization 2021-08-13 12:51:35 -06:00
f61adcd738 temporal: knarly template code to consolidate and rationalize duplicated methods 2021-08-13 12:51:35 -06:00
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
3256350ef8 libtemporal: needs "OSX" pseudo-lib to pick up required macOS flags 2021-08-13 12:51:35 -06:00
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
3170f880c2 stop clang from complaining about a missing return after a guaranteed assert() failure 2021-08-13 12:51:35 -06:00
f721655916 libtemporal: to quote the matrix, there is no lock 2021-08-13 12:51:35 -06:00
bccdc95f32 libtemporal: fix logic for ::get_tempo_and_meter() if starting point is the timeline start 2021-08-13 12:51:35 -06:00
1f8290f154 generalize repeated code into a template method, add lots of const-ness to facilitate this 2021-08-13 12:51:35 -06:00
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
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
53e411c011 fix logic error in conditional 2021-08-13 12:51:35 -06:00
6f2fdc2695 functioning loading of older tempo map XML data 2021-08-13 12:51:35 -06:00
092a454648 fix timepos_t::string_to (wrong argument to samples_to_superclock() 2021-08-13 12:51:35 -06:00
445ad2e383 rearrange if/else logic to avoid NOTREACHED condition 2021-08-13 12:51:35 -06:00
b84402f4f8 intial steps for adding legacy (v0-5) tempo map deserialization support 2021-08-13 12:51:35 -06:00
344dd26788 improved DEBUG_TRACE statements for tempo map 2021-08-13 12:51:35 -06:00
cd34695944 fix TempoMap::quarters_at_superclock (superclock_t) 2021-08-13 12:51:35 -06:00
74ff3b22b8 fix TempoPoint::superclock_at(Beats) 2021-08-13 12:51:35 -06:00
216945a89c move TempoMap::write_copy() into .cc file instead of .h 2021-08-13 12:51:35 -06:00
ce3fb0507c change return type of Tempo::set_{ramped,clamped} and fix call sites 2021-08-13 12:51:35 -06:00
99c8c0b658 initial, tentative, untested implementation of TempoMap::remove_time() 2021-08-13 12:51:35 -06:00
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
0ab2308523 reimplement TempoMap::midi_clock_beat_at_or_after() 2021-08-13 12:51:35 -06:00
0b1d44f422 temporal: fix timepos_t::decrement() to not switch domains 2021-08-13 12:51:35 -06:00
daad7b74ae libtemporal: rename TempoMap::full_duration_at() to ::convert_duration() and reorder parameters 2021-08-13 12:51:34 -06:00
7773fc5b64 libtemporal: TempoMap::full_duration_at() returns correct value for unchanged time domain call 2021-08-13 12:51:34 -06:00
b7bc3b1947 libtemporal: expand comment to explain more about what TempoMap::full_duration_at() does 2021-08-13 12:51:34 -06:00
c0c3fd07c9 libtemporal: add timecnt_t::end() and timecnt_t::set_time_domain() 2021-08-13 12:51:34 -06:00
beaa1b3fcb be sure to check the return from the RCU mgr ::update method() inside TempoMap::update() 2021-08-13 12:51:34 -06:00
0877500437 libtemporal: don't compile file removed (too early) in a55df1ad6 2021-08-13 12:51:34 -06:00
5b3c5d3782 libtemporal: fix implementation of timepos_t::max() to avoid overflow for Beats time 2021-08-13 12:51:34 -06:00
b2510c0da2 libardour: use appropriate method to set AutomationList time domain from ::set_state() 2021-08-13 12:51:34 -06:00
2049cc44b2 libtemporal: tweak: don't both with local tempo map ptr 2021-08-13 12:51:34 -06:00
433a9ebe48 libtemporal: catch attempts to convert max audio time values into beats, early 2021-08-13 12:51:34 -06:00
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