ardour/libs/pbd
Robin Gareus 14da117bc8 Add explicit round/floor integer multiply/divide
This fixes various rounding issues. Notably superclock to sample
conversion must always round down when playing forward.

`::process (start, end, speed = 1)` uses exclusive end.
Processing begins at `start` and end ends just before `end`.
Next cycle will begin with the current end.

One example where this failed:
 - New session at 48kHz
 - Change tempo to 130 BPM
 - Enable snap to 1/8 note
 - Snap playhead to 1|3|0
 - Enable Metronome
 - Play

`assert (superclock_to_samples ((*i).sclock(), sample_rate()) < end);`

end = 177231 samples == superclock 1042118280
A grid point is found at superclock 1042116920 (that is < 1042118280).
However converting it back to samples rounded it to sample 177231 == end,
while actual location is 1360 super-clock ticks before end.

The metronome click has to be started this cycle, since the same
position will not be found at the beginning of the next cycle, with
start = 177232.

Similarly a samplecnt_t t, converted to music-time and back must not be
later than the given sample.

```
timepos_t tsc (t);
assert (timepos_t::from_ticks (tsc.ticks ()).samples () <= t);
```

IOW. When playing forward, all super-clock time between 1|1|0 and 1|1|1
should round down to 1|1|0. "We have not yet reached the first tick".
2022-10-22 02:10:05 +02:00
..
boost-debug
msvc
MSVCpbd
pbd Add explicit round/floor integer multiply/divide 2022-10-22 02:10:05 +02:00
test
base_ui.cc libpbd: do not use debug transmitter inside BaseUI::signal_new_request() to avoid recursion 2022-06-13 13:43:31 -06:00
basename.cc
boost_debug.cc
cartesian.cc
ChangeLog
cocoa_open_uri.mm
command.cc Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
configuration_variable.cc Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
controllable.cc Move ControllableSet up in PBD's namespace 2022-10-18 00:08:21 +02:00
convert.cc
COPYING
cpus.cc
crossthread.cc Potential fix for M1 x-thread events 2022-05-02 00:02:33 +02:00
crossthread.posix.cc NO-OP: clang-format 2022-04-23 23:12:13 +02:00
crossthread.win.cc
debug_rt_alloc.c
debug.cc
demangle.cc
downloader.cc downloader: create destdir if it does not already exist, throw exception if this fails 2022-09-26 01:10:20 -06:00
enums.cc
enumwriter.cc
epa.cc
error.cc
event_loop.cc
ffs.cc
file_archive.cc threaded archive inflation for library mgmt 2022-09-13 13:53:45 -06:00
file_utils.cc
fpu.cc
glib_event_source.cc libpbd: change GlibEventLoopCallback to use C API not C++ 2022-05-19 22:24:43 -06:00
id.cc
inflater.cc libpbd: new threader Inflater and Downlaoder classes 2022-09-13 13:53:45 -06:00
libpbd.pc.in
libpbd.spec.in
locale_guard.cc
localtime_r.cc
malign.cc
md5.cc
microseconds.cc
mountpoint.cc
openuri.cc
pathexpand.cc
pbd.cc
pcg_rand.cc
pool.cc Only dump SessionEvent pool in debug builds 2022-07-07 22:34:11 +02:00
property_list.cc
pthread_utils.cc Amend previous commit, fix debug print format 2022-06-03 05:32:19 +02:00
reallocpool.cc
receiver.cc
resource.cc
run-tests.sh
search_path.cc
semutils.cc Use SYS_futex instead of __NR_futex 2022-05-30 21:56:49 +02:00
shortpath.cc
signals.cc
spinlock.cc
stacktrace.cc miscellaneous fixes for warnings from -Wconversion 2022-07-04 22:01:48 -06:00
stateful_diff_command.cc Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
stateful.cc Remove unused imports and modernize stateful.cc 2022-05-13 23:07:49 +02:00
string_convert.cc
strreplace.cc Fix poor_mans_glob, ~' for $HOME' is only valid at the start of a path 2022-02-01 15:47:54 +01:00
strsplit.cc
system_exec.cc SystemExec try SIGINT before SIGKILL 2022-09-12 16:17:55 +02:00
textreceiver.cc
timer.cc
timing.cc
tlsf.cc use C style cast in C code, rather than C++ constructor 2022-06-22 13:31:08 -06:00
transmitter.cc Fix source typos (heirarchy->hierarchy) 2022-04-08 21:38:00 +02:00
undo.cc Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
uuid.cc
whitespace.cc Add a missing #include 2022-09-10 10:20:37 +01:00
windows_mmcss.cc
windows_special_dirs.cc
windows_timer_utils.cc
wscript libpbd: new threader Inflater and Downlaoder classes 2022-09-13 13:53:45 -06:00
xml++.cc Fix typos 2022-09-21 19:09:55 -06:00