Commit graph

634 commits

Author SHA1 Message Date
Paul Davis
9f3a41b96b manually revert fa376b709d and debef6ab
Quantizing superclocks to samples in libtemporal negates the whole purpose of superclocks,
and breaks a variety of things, not limited to moving forward to markers and the grid
2025-02-28 13:39:45 -07:00
Paul Davis
debef6ab25 lighter, simpler math for sample-aligned superclocks 2025-01-30 11:26:41 -07:00
Paul Davis
fa376b709d add new sample_aligned_superclock() method and use it when converting Beats to superclock
There can never be fractional audio time, and since superclock_t is used to represent audio time, when we
convert from Beat time, we should never, ever return a superclock value that does not correspond to
an integer number of samples.

This fixes a number of bugs, including any use of ARDOUR::Filter which writes a new (audio) file
to disk that must be an integer number of samples long, but may be derived from and later used
by a region that had an audio-time duration that is slightly longer (less than one sample)
than the audio file
2025-01-29 17:40:57 -07:00
Paul Davis
baef68b1e6 clean up/improve API used in 5ebf8152e 2025-01-10 09:25:03 -07:00
Paul Davis
5ebf8152ec temporal: tempo changes must be on meter-provided grid, not quarter notes 2025-01-09 22:30:17 -07:00
Paul Davis
207cd9ae5f fix temporal test runner
must abort all write_copy() map operations
2025-01-09 22:30:17 -07:00
Paul Davis
5f943295fc copying a tempo map should not bail out just because there is only 1 tempo & meter 2024-12-18 16:46:07 -07:00
Paul Davis
364598e94f temporal: add round_up_to_bar() methods to Meter, Metric and TempoMap 2024-10-31 12:22:35 -06:00
Paul Davis
f8ddc827c7 NO-OP: tweak comemnt that still referenced frames instead of samples 2024-10-31 12:22:35 -06:00
Mads Kiilerich
955e634371 Make header files more self-contained - add missing std includes 2024-10-20 03:11:53 +02:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Paul Davis
75f56cd3e1 the great onceification (libs)
Replace use of #ifndef header guards with #pragma once

Modern C++, baby!
2024-10-17 07:44:31 -06:00
Paul Davis
e3e014bfe6 NO-OP: comment work 2024-10-02 11:03:08 -06:00
Robin Gareus
e75ad3399e
Fix BBT marker calculation when removing time 2024-05-14 03:20:04 +02:00
Paul Davis
da175cc2e8 temporal: remove TempoMap::insert_time() and use shift() instead
The former was incorrectly implemented, and the latter has already been tested more
in real life.

We should likely remove ::remove_time also and use shift() there too, but that
requires testing negative shifts more broadly.
2023-11-19 12:14:10 -07:00
Paul Davis
5723c9bf9c temporal: slightly more debug info when computing quarters from superclock 2023-11-13 22:32:15 -07:00
Paul Davis
04523dee97 temporal: NOOP reindent #ifdef'ed out code 2023-11-13 22:32:15 -07:00
Paul Davis
ce4d1ffe51 temporal: after loading an old tempo map, reset it to compute omega etc. 2023-11-13 22:32:15 -07:00
Paul Davis
fbc578fdb6 temporal: use "pulses" info from old tempo maps
Note: pulses are whole notes
2023-11-13 22:32:15 -07:00
Paul Davis
f8d86c8d19 temporal: add a new ::set_tempo() method for use when loading older tempo maps 2023-11-13 22:32:15 -07:00
Paul Davis
9e4a695689 temporal: fix error in computation of timecnt_t::end() for specific conditions
parens were in the wrong place - we need to add the ::magnitude() of
the tick-based duration AFTER conversion of audio-time position to beats, not
before.
2023-11-06 20:38:08 -07:00
Paul Davis
ea02c49856 a better solution for the problem being addressed in b40513ff7 2023-10-22 17:31:29 -06:00
Paul Davis
b40513ff7d temporal: workaround (perhaps temporary) for rounding issues in ::midi_clock_beat_at_or_after() 2023-10-22 17:15:20 -06:00
Paul Davis
4228fce86b temporal: minor optimization for TempoMap::{tempo,meter}_at() to cover common case 2023-10-22 17:15:20 -06:00
Mads Kiilerich
6b61b03434 wscript: drop traces of shutdown() handling
autowaf has no real shutdown functionality anyway. The automatic
shutdown function that could have been called wouldn't work anyway, as
it takes an argument.

The only reason it doesn't fail is that the top level wscript has no
shutdown handling and doesn't recurse to other scripts, so it is all
dead code.
2023-10-15 10:47:16 -06:00
Mads Kiilerich
88cecdfaef wscript: drop repeated autowaf.set_options - it is enough to set at top level 2023-10-15 10:47:16 -06:00
Paul Davis
afe74bb460 use Meter::round_to_bar() rather than BBT_Time::round_(up|down)_to_bar
this gives slightly better behavior when dragging a meter marker
2023-10-07 11:11:31 -06:00
Paul Davis
64458c2430 prevent meter changes being dragged "through" a BBT marker
might want to do this for tempo drags too
2023-10-07 11:11:31 -06:00
Paul Davis
ec34c2137d avoid a crash when dragging a meter change near a BBT marker 2023-10-07 11:11:31 -06:00
Paul Davis
bdd0fda188 remove debug output 2023-10-06 17:08:28 -06:00
Paul Davis
cd1d83f366 reintroduce a fake XML "active" property for Tempo to allow 7.x to load 8.x sessions 2023-10-05 11:22:38 -06:00
John Emmas
14973bd894 Simplify the MSVC / superclock change which should now be compatible with all compilers 2023-10-05 14:01:32 +01:00
Robin Gareus
c3b881327c
Possible fix for MSVC build 2023-10-05 01:50:37 +02:00
Robin Gareus
49cb4a1f33
Revert "Fix superclock init on Windows"
This reverts commit febc345414.
2023-10-05 01:50:36 +02:00
Robin Gareus
febc345414
Fix superclock init on Windows
Static global symbols on windows (even identical symbols) are
not mapped to the same address when mixing .dll + .exe.

see also d3cd621f7a
2023-10-04 23:34:40 +02:00
Paul Davis
0c3791117c remove much debug output associated with tempo map copy/pasta, et al. 2023-10-04 08:37:26 -06:00
Paul Davis
364c892c68 remove debug output 2023-10-03 11:13:57 -06:00
Paul Davis
616273cfab temporal: slightly tweak DEBUG_TRACE output 2023-09-22 22:54:53 -06:00
Paul Davis
14e7f62891 fix BBT_Time::round_up_to_beat_div() (partially)
Math is now correct for cases where "beats" in BBT are quarters.
Incorrect for others
2023-09-22 22:54:37 -06:00
Paul Davis
1c2cd78f41 Revert "temporal: fix superclock time used to find relevant tempo & meter"
This reverts commit b192eea65a.
2023-09-22 15:35:40 -06:00
Paul Davis
e2f6241dd6 temporal: NOOP whitespace 2023-09-22 15:35:39 -06:00
Paul Davis
1cdfe2aa2f temporal: actually iterate 2023-09-22 15:30:31 -06:00
Paul Davis
b192eea65a temporal: fix superclock time used to find relevant tempo & meter 2023-09-22 15:30:20 -06:00
Paul Davis
d6565cce77 temporal: NOOP whitespace 2023-09-22 15:18:27 -06:00
Paul Davis
d282c317d0 temporal: use new BBT variant of get_tempo_and_meter() 2023-09-22 15:18:27 -06:00
Paul Davis
a89108c9af temporal: removed #if 0'ed old code 2023-09-22 15:18:27 -06:00
Paul Davis
374283cc3f temporal: provide a new variant of ::get_tempo_and_meter() for BBT time
This one is more complex than the Beats or superclock variants, because
we cannot just start from the front of the map. Instead, we have to
first iterate through the map so that we start the code in
_get_tempo_and_meter<...> from the TempoPoint and MeterPoint
in effect at the BBT_Argument's reference time.
2023-09-22 15:18:27 -06:00
Paul Davis
3aacbc453e temporal::remove version of get_tempo_and_meter() that was never used 2023-09-22 15:18:27 -06:00
Paul Davis
8e3e78c116 temporal: optimize common case for ::get_tempo_and_meter() 2023-09-22 15:18:27 -06:00