13
0

fix Region::set_position_internal() to use TempoMap provided conversions

rolling our own beat<->audio conversion code here was doomed to fail.

this fixes the absurd length of a consolidated region.
This commit is contained in:
Paul Davis 2023-09-18 19:56:06 -06:00
parent 5122036054
commit 1344851912

View File

@ -764,15 +764,11 @@ Region::set_position_internal (timepos_t const & pos)
*/ */
if (td != _length.val().position().time_domain()) { if (td != _length.val().position().time_domain()) {
switch (td) { timecnt_t l = _length.val();
case Temporal::AudioTime: l.set_position (pos);
_length = timecnt_t::from_superclock (superclock_t (_length.val().distance()), timepos_t::from_superclock (pos.superclocks())); l.set_time_domain (td);
break; _length = l;
default: } else {
_length = timecnt_t::from_ticks (int64_t (_length.val().distance()), timepos_t::from_ticks (pos.ticks()));
break;
}
} else {
/* time domain of position not changing */ /* time domain of position not changing */
_length = timecnt_t (_length.val().distance(), pos); _length = timecnt_t (_length.val().distance(), pos);
} }