13
0

temporal: add a music-time (BBT) point at the cut site

This commit is contained in:
Paul Davis 2023-08-25 17:37:22 -06:00
parent 4d8ba938f1
commit 32ef2d5a0f

View File

@ -881,6 +881,17 @@ TempoMap::cut_copy (timepos_t const & start, timepos_t const & end, bool copy, b
Meter start_meter (meter_at (start)); Meter start_meter (meter_at (start));
Meter end_meter (meter_at (end)); Meter end_meter (meter_at (end));
MusicTimePoint* mtp;
BBT_Time bbt (bbt_at (start));
Beats b (quarters_at (start));
if (!copy) {
mtp = new MusicTimePoint (*this, end_sclock - (end_sclock - start_sclock), b, bbt, em.tempo(), em.meter(), _("cut"));
} else {
mtp = nullptr;
}
for (Points::iterator p = _points.begin(); p != _points.end(); ) { for (Points::iterator p = _points.begin(); p != _points.end(); ) {
@ -956,6 +967,10 @@ TempoMap::cut_copy (timepos_t const & start, timepos_t const & end, bool copy, b
cb->add_end_meter (end_meter); cb->add_end_meter (end_meter);
} }
if (mtp) {
add_or_replace_bartime (mtp);
}
return cb; return cb;
} }