13
0
Commit Graph

44 Commits

Author SHA1 Message Date
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
d71b3100d8 temporal: handle negative positional values that somehow appear in older sessions 2021-11-22 10:28:13 -07:00
1532ebb38f temporal: truncate ::to_string() method for timeline types to ::str() for easier use in debugger 2021-11-17 12:16:38 -07:00
8c632c8446 temporal: allow negative timecnt_t to be used when constructing a timepos_t
Negative positions are legal and should be handled by higher level logic
2021-11-14 15:22:53 -07:00
0acc1a3fec temporal: use correct implementation of timepos_t::operator+ (timecnt_t) (and +=)
If time domains differ, it is necessary to first convert the argument duration into a duration
at the position of "this", in the correct time domain. Then we recursively call the operator
again, but this time we will use the fast path that just adds two timepos_t values.
2021-10-04 17:45:02 -06:00
ed3d374f47
Fix --no-nls compilation 1/2 -- #8802
pbd/i18n.h MUST NEVER be included from header files and always be
the last include. This is because `_` is declared other headers
notably boost and some apple headers.

leading to issues like
../libs/pbd/gettext.h:58:27: error: expected unqualified-id before ‘const’
   58 | # define gettext(Msgid) ((const char *) (Msgid))
2021-09-27 16:28:44 +02: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
e7cdca1ea2 remove some debug output 2021-08-13 12:51:36 -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
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
daad7b74ae libtemporal: rename TempoMap::full_duration_at() to ::convert_duration() and reorder parameters 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
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
4e6c06bc95 libtemporal: add maybe-not-required operator>> for timeline types 2021-08-13 12:51:34 -06:00
ce82efafcf libtemporal: slightly improve output from conversion statistics 2021-08-13 12:51:34 -06:00
25375ee6f4 add timepos_t::set_time_domain() to potentially change time domains 2021-08-13 12:51:33 -06:00
016aada4df libtemporal: fix/improve/correct parsing of timecnt_t from string 2021-08-13 12:51:32 -06:00
d165c492af temporal: fix/simplify/improve parsing of time values from strings 2021-08-13 12:51:32 -06:00
209908f700 libtemporal: improve/fix implementation of timepos_t::operator+=(timepos_t) 2021-08-13 12:51:32 -06:00
9438295607 libtemporal: fix implementation of timecnt_t::operator+ (timecnt_t) 2021-08-13 12:51:32 -06:00
80986b9445 libtemporal: add (commented) debug output for timepos_t::distance() methods 2021-08-13 12:51:31 -06:00
6fe4394c54 fix parameter name in comment 2021-08-13 12:51:31 -06:00
df0ac42f54 Temporal: cleanup for explicit Beats::operator bool() 2021-08-13 12:51:31 -06:00
43d84620e0 Temporal: clean up API to remove ambiguity about ::quarter*_at_*
superclock_t and samplepos_t have the same underlying C++ type, so methods that accept one or the
other as an argument need to be named to make it clear which type they accept. We do not need
the superclock_t variant publically, but it turns out to be useful within TempoMap.
2021-08-13 12:51:31 -06:00
c3d325b56a Temporal: clean up API for timepos_t to remove unneeded duplicates and remove ambiguity 2021-08-13 12:51:31 -06:00
5887ee524e Temporal: further improvements to a timepos_t::distance() method 2021-08-13 12:51:31 -06:00
7c56b9b2fc Temporal: fix insanely incorrect implementation of timepos_t::distance() 2021-08-13 12:51:30 -06:00
def35cf043 mark BBT_Offset (double) constructor explicit to avoid implicit conversion in timeline expressions.
Also clean up the mess this had caused.
2021-08-13 12:51:30 -06:00
f0008898af add operator<<() for timecnt_t() 2021-08-13 12:51:30 -06:00
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
cdab3a5e8f fix a bunch of missing symbols related to temporal 2021-08-13 12:51:29 -06:00
8fb70885ec changes needed to get audio_clock.cc to work 2021-08-13 12:51:29 -06:00
bca8e2e8cc libtemporal: changes derived from converting libardour 2021-08-13 12:51:28 -06:00
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
c75fc64306 Temporal: various changes to int62_t and timeline types based on code review 2021-08-13 12:51:28 -06:00
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
56795a97a3 changes required to get ardour to start up (missing vars, incorrect values) 2021-08-13 12:51:28 -06:00
1f0d9159a7 Temporal: use, don't fetch tempo map pointer 2021-08-13 12:51:28 -06:00
8ec81c2308 Temporal: correctly construct return timepos_t for * and / 2021-08-13 12:51:28 -06:00
e89d727939 Temporal: remove the final #warning from timeline.cc 2021-08-13 12:51:28 -06:00
b87c855240 Temporal: add string_to/to_string methods for timecnt_t 2021-08-13 12:51:28 -06:00
974196b7d2 Temporal: add timeline.cc 2021-08-13 12:51:28 -06:00