temporal: fix totally broken implementation of TempoMap::shift (timepos...)
This commit is contained in:
parent
c778a6df67
commit
cda0d6ce9f
@ -1099,20 +1099,40 @@ TempoMap::paste (TempoMapCutBuffer const & cb, timepos_t const & position, bool
|
|||||||
void
|
void
|
||||||
TempoMap::shift (timepos_t const & at, timecnt_t const & by)
|
TempoMap::shift (timepos_t const & at, timecnt_t const & by)
|
||||||
{
|
{
|
||||||
superclock_t distance = by.superclocks ();
|
timecnt_t abs_by (by.abs());
|
||||||
superclock_t at_superclocks = by.superclocks ();
|
superclock_t distance = abs_by.superclocks ();
|
||||||
Points::iterator p = _points.begin();
|
superclock_t at_superclocks = abs_by.superclocks ();
|
||||||
|
|
||||||
while (p->sclock() < at_superclocks) {
|
if (distance == 0) {
|
||||||
++p;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p == _points.end()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->set (at_superclocks + distance, p->beats(), p->bbt());
|
std::cerr << "tm ripple @ " << at.str() << " by " << by.str() << std::endl;
|
||||||
reset_starting_at (at_superclocks);
|
|
||||||
|
for (auto & p : _points) {
|
||||||
|
|
||||||
|
if (p.sclock() >= at_superclocks) {
|
||||||
|
|
||||||
|
if (distance >= 0 || p.sclock() > distance) {
|
||||||
|
|
||||||
|
if (dynamic_cast<MusicTimePoint*> (&p)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
superclock_t s = p.sclock() + distance;
|
||||||
|
BBT_Time bb = bbt_at (s);
|
||||||
|
Beats b = quarters_at_superclock (s);
|
||||||
|
std::cerr << "Move " << p << std::endl;
|
||||||
|
p.set (s, b, bb);
|
||||||
|
std::cerr << "\tto " << p << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cerr << "post-ripple, before reset\n";
|
||||||
|
dump (std::cerr);
|
||||||
|
reset_starting_at (at_superclocks + distance);
|
||||||
|
dump (std::cerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user