Commit Graph

48 Commits

Author SHA1 Message Date
Robin Gareus f79f3ee301
Remove unused API 2022-09-27 00:40:35 +02:00
luz paz 47c525315d Fix various typos
Found via `codespell -q 3 -S *.po,./.git,./share/patchfiles,./libs,./msvc_extra_headers,./share/web_surfaces,*.patch  -L ba,buss,busses,discreet,doubleclick,hsi,ontop,ro,scrollin,seh,siz,sord,sur,te,trough,ue`
2022-08-03 12:10:01 -06:00
Robin Gareus 1f6abbb756
Comment-out unused timepos_t modulo operator which is not implemented 2022-06-30 01:47:42 +02:00
Paul Davis 48f4f9bf9c temporal: remove some arithmetic operators and rewrite others to use muldiv() 2022-05-27 12:47:44 -06:00
Paul Davis c6a31250ba alter Source::_length from timecnt_t to timepos_t
THe length of a Source(File) is always measured from its start. In this sense,
the length is like a position on the timeline, which is a duration with an
implicit origin, or a Region start, also a duration with an implicit origin (in
that case the start of the Source). There is no good reason for using
a timecnt_t for this value, because the position component of a timecnt_t
(the origin for the duration) is implicit and always zero. So we make
this property into a timepos_t, and include a number of asserts() to check
for common possible coding errors related to the time domain
2022-01-28 15:52:27 -07:00
Robin Gareus 506bc3a6f6
Disambiguate `zero(bool)` constructor and `is_zero()` comparison
This is mainly for the benefit of Lua bindings, but also increases
overall API naming consistency with functions and methods
`is_XYZ()` being used elsewhere.

This API change breaks builds!
2021-12-11 14:33:45 +01:00
Paul Davis 878393e68b temporal: fix construction of timepos_t and timecnt_t with max_sample{pos,cnt}
max_samplepos and max_samplecnt and both INT64_MAX which is (a) too large to fit into a signed 62 bit
integer and (b) definitely too large to be represented in a signed 62 bit superclock value.

Move the constructors that use samplepos_t into the .cc file, and treat these two values as special
cases that mean "as large/late/huge/long as possible".
2021-11-22 10:35:52 -07:00
Paul Davis 1532ebb38f temporal: truncate ::to_string() method for timeline types to ::str() for easier use in debugger 2021-11-17 12:16:38 -07:00
Paul Davis 30a00c5e9f Fix implementation of timecnt_t::operator==() to compare both duration and position 2021-09-25 16:49:51 -06: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
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 0b1d44f422 temporal: fix timepos_t::decrement() to not switch domains 2021-08-13 12:51:35 -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 5b3c5d3782 libtemporal: fix implementation of timepos_t::max() to avoid overflow for Beats time 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 25375ee6f4 add timepos_t::set_time_domain() to potentially change time domains 2021-08-13 12:51:33 -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 5e0cf747bb Temporal: removed unused std::numeric_limits<> definitions for timeline types
There can be no single ::max() or ::min() value for these types because the time domain matters. With a given
tempo map, a certain beat value represent a time before or after the maximum possible audio domain value
2021-08-13 12:51:31 -06:00
Paul Davis de3eb54958 Temporal: in an update to the previous commit, actually remove timepos_t::compute_ticks() rather than claim to implement it 2021-08-13 12:51:31 -06:00
Paul Davis 400018e121 Temporal: implement timepos_t::compute_ticks() 2021-08-13 12:51:31 -06:00
Paul Davis 0ce40fc648 Temporal: fix timepos_t (Beats) constructor
flag bit was set incorrectly
2021-08-13 12:51:31 -06:00
Paul Davis 747281a244 Temporal: fix implementation of timecnt_t::operator= (timecnt_t const &)
It is OK now to have inconsistent time domains inside a timecnt_t
2021-08-13 12:51:31 -06:00
Paul Davis 5bef968069 Temporal: replace thread_local sample rate with callback to get sample rate 2021-08-13 12:51:31 -06:00
Paul Davis afea443419 remove API from Temporal:timecnt_t that used superclock_t
Not possible for a compiler to differentiate superclock_t and sample(pos|cnt)_t, which can lead to
subtle but major errors
2021-08-13 12:51:31 -06:00
Paul Davis c3d325b56a Temporal: clean up API for timepos_t to remove unneeded duplicates and remove ambiguity 2021-08-13 12:51:31 -06:00
Paul Davis 52ddf91e5b Temporal: explain with timepos_t::_{ticks,beats} are for 2021-08-13 12:51:31 -06:00
Paul Davis 15b28b103a NOOP: whitespace changes 2021-08-13 12:51:30 -06:00
Paul Davis b876baa757 Temporal: various changes to arithmetic/logic methods to avoid assert() on domain mismatches where none is really needed 2021-08-13 12:51:30 -06:00
Paul Davis baaa8f36ca fix timepos_t::max and timecnt_t::max to avoid int62_t flag bit
Both should likely just re-use int62_t::max
2021-08-13 12:51:30 -06:00
Paul Davis b5c945e211 Temporal: another useful static method 2021-08-13 12:51:29 -06:00
Paul Davis 8fb70885ec changes needed to get audio_clock.cc to work 2021-08-13 12:51:29 -06:00
Paul Davis 169bbf3b08 temporal: more API tweaks as conversions continue in libardour 2021-08-13 12:51:29 -06:00
Paul Davis bca8e2e8cc libtemporal: changes derived from converting libardour 2021-08-13 12:51:28 -06:00
Paul Davis ddac0f7651 Temporal: what was that comment about not being able to disambiguate samples and superclocks? 2021-08-13 12:51:28 -06:00
Paul Davis f06e2dd6d1 Temporal: remove constructors accepting scalar values from timepos_t/timecnt_t and force use of factory methods
This allows us to differentiate between superclock_t and samplepos_t (and related types) which are all typedef'ed to the
same underlying primitive C++ type. Without this, it would be impossible for the compiler or someone reading the code
to know whether a scalar passed to a constructor for a timeline type is in units of samples or superclocks
2021-08-13 12:51:28 -06:00
Paul Davis c75fc64306 Temporal: various changes to int62_t and timeline types based on code review 2021-08-13 12:51:28 -06:00
Paul Davis c192c49b65 Temporal: add std::numeric_limits<> for timecnt_t and comment on these in general 2021-08-13 12:51:28 -06:00
Paul Davis b5bf518a0a Temporal: fixes, changes, redesigns, extensions to be able to compile ARDOUR::Region with timepos_t/timecnt_t members 2021-08-13 12:51:28 -06:00
Paul Davis 56795a97a3 changes required to get ardour to start up (missing vars, incorrect values) 2021-08-13 12:51:28 -06:00
Paul Davis b0a732e636 Temporal: extend timecnt_t API to provide samples() method, using thread-local sample rate 2021-08-13 12:51:28 -06:00
Paul Davis 791e76290d Temporal: extend timepos_t API to provide samples() method, using thread-local sample rate 2021-08-13 12:51:28 -06:00
Paul Davis 8ec81c2308 Temporal: correctly construct return timepos_t for * and / 2021-08-13 12:51:28 -06:00
Paul Davis 5a0969a5c2 Temporal: remove last bit of floating point API from timepos_t 2021-08-13 12:51:28 -06:00
Paul Davis 9fe9658e8a Temporal: add clarifying comment 2021-08-13 12:51:28 -06:00
Paul Davis 7446de72b1 Temporal: improve timepos_t::distance() implementations 2021-08-13 12:51:28 -06:00
Paul Davis 2c69a1425f Temporal: fundamental changes to get timeline.cc to compile 2021-08-13 12:51:28 -06:00
Paul Davis 9abf90c9d5 add the new timepos_t/timecnt_t header 2021-08-13 12:51:28 -06:00