diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-12-07 15:13:04 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-12-07 15:13:04 +0000 |
commit | b83f21c3cf6f9385697ce4b2ca2b0f840a8438aa (patch) | |
tree | 3a7cf66f5af76ccad93863d37eb9b6dfec51ac8b /libs | |
parent | a9275f997b131e96191cdb32542074e655a116cb (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/evoral/evoral/ControlList.hpp | 1 | ||||
-rw-r--r-- | libs/evoral/src/ControlList.cpp | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index e69a756b08..16d0400145 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -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); diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index b41141a61e..b717190768 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -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 (); |