13
0

add "shift" method used in 2.X and now a3 to move data starting at a position, not an iterator

git-svn-id: svn://localhost/ardour2/branches/3.0@8208 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-12-07 15:13:04 +00:00
parent a9275f997b
commit b83f21c3cf
2 changed files with 21 additions and 0 deletions

View File

@ -113,6 +113,7 @@ public:
void x_scale (double factor);
bool extend_to (double);
void slide (iterator before, double distance);
void shift (double before, double distance);
void rt_add (double when, double value);
void add (double when, double value);

View File

@ -534,6 +534,26 @@ ControlList::slide (iterator before, double distance)
(*before)->when += distance;
++before;
}
mark_dirty ();
}
maybe_signal_changed ();
}
void
ControlList::shift (double pos, double frames)
{
{
Glib::Mutex::Lock lm (_lock);
for (iterator i = _events.begin(); i != _events.end(); ++i) {
if ((*i)->when >= pos) {
(*i)->when += frames;
}
}
mark_dirty ();
}
maybe_signal_changed ();