diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index f6e0dd9215..374b4bb663 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -945,8 +945,7 @@ void TempoMap::paste (TempoMapCutBuffer const & cb, timepos_t const & position, bool ripple) { if (ripple) { - - + shift (position, cb.duration()); } bool replaced_ignored; @@ -1010,30 +1009,24 @@ TempoMap::paste (TempoMapCutBuffer const & cb, timepos_t const & position, bool } -#if 0 void TempoMap::shift (timepos_t const & at, timecnt_t const & by) { - if (by.time_domain() == BeatTime) { + superclock_t distance = by.superclocks (); + superclock_t at_superclocks = by.superclocks (); + Points::iterator p = _points.begin(); - } else { - superclock_t distance = by.superclocks (); - superclock_t at_superclocks = by.superclocks (); - Points::iterator p = _points.begin(); - - while (p.sclock() < at_superclocks) { - ++p; - } - - if (p == _points.end()) { - return; - } - - p->set (at_superclocks + distance, p->beats(), p->bbt()); - reset_starting_at (at_superclocks); + while (p->sclock() < at_superclocks) { + ++p; } + + if (p == _points.end()) { + return; + } + + p->set (at_superclocks + distance, p->beats(), p->bbt()); + reset_starting_at (at_superclocks); } -#endif void TempoMap::shift (timepos_t const & at, BBT_Offset const & offset) diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index e548fc7fdd..ee3f0e47cb 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -822,7 +822,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible LIBTEMPORAL_API TempoMapCutBuffer* copy (timepos_t const & start, timepos_t const & end); LIBTEMPORAL_API void paste (TempoMapCutBuffer const &, timepos_t const & position, bool ripple); - LIBTEMPORAL_API void shift (timepos_t const & at, BBT_Offset const &); + LIBTEMPORAL_API void shift (timepos_t const & at, BBT_Offset const & by); + LIBTEMPORAL_API void shift (timepos_t const & at, timecnt_t const & by); private: template TempoPoint const & _tempo_at (TimeType when, Comparator cmp) const {