summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-12-22 01:09:24 +0100
committerRobin Gareus <robin@gareus.org>2018-12-22 01:09:24 +0100
commit616f7f40b6db150c18aa29f132bf13d1db8c5e49 (patch)
tree08ef77f017042876e59bf0cf2289dce3b0bd0f42 /libs
parent4b9d96ff8eb8f33e9476b80ac6fc57d2dfdcf812 (diff)
Properly remove-time automation
Previously "remove time" was able to produce overlapping, not ordered automation.
Diffstat (limited to 'libs')
-rw-r--r--libs/evoral/src/ControlList.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index 8d0ac688e9..e1729483cc 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -990,6 +990,14 @@ ControlList::shift (double pos, double frames)
{
{
Glib::Threads::RWLock::WriterLock lm (_lock);
+ if (frames < 0) {
+ /* Route::shift () with negative shift is used
+ * for "remove time". The time [pos.. pos-frames] is removed.
+ * and everyhing after, moved backwards.
+ * TODO: consider adding guard-points (need special-casing)
+ */
+ erase_range_internal (pos, pos - frames, _events);
+ }
for (iterator i = _events.begin(); i != _events.end(); ++i) {
if ((*i)->when >= pos) {