summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-04-26 16:03:54 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-04-26 16:03:54 +0000
commit803edaed4955f256f7c23b75973f02b54fb8fac1 (patch)
tree3a2198c01edf46464bb1d55317be63215e837c54
parent0d63cd0108d282aaf5b71e42536c1784a339a45b (diff)
significant fixes for AutomationList::cut_copy_clear() for cut and copy operations
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6994 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/automation_event.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc
index 77c730b201..cd683a2cab 100644
--- a/libs/ardour/automation_event.cc
+++ b/libs/ardour/automation_event.cc
@@ -1069,7 +1069,7 @@ AutomationList::cut_copy_clear (double start, double end, int op)
iterator s, e;
ControlEvent cp (start, 0.0);
TimeComparator cmp;
-
+
{
Glib::Mutex::Lock lm (lock);
@@ -1104,11 +1104,13 @@ AutomationList::cut_copy_clear (double start, double end, int op)
double val = unlocked_eval (start);
- if (start > events.front()->when) {
- events.insert (s, (point_factory (start, val)));
- }
+ if (op == 0) { // cut
+ if (start > events.front()->when) {
+ events.insert (s, (point_factory (start, val)));
+ }
+ }
- if (op != 2) {
+ if (op != 2) { // ! clear
nal->events.push_back (point_factory (0, val));
}
}
@@ -1135,24 +1137,23 @@ AutomationList::cut_copy_clear (double start, double end, int op)
/* only add a boundary point if there is a point after "end"
*/
- if (e != events.end() || end < (*e)->when) {
+ if (op == 0 && (e != events.end() || end < (*e)->when)) { // cut
events.insert (e, point_factory (end, end_value));
}
- if (op != 2) {
+ if (op != 2 && (e != events.end() || end < (*e)->when)) { // cut/copy
nal->events.push_back (point_factory (end - start, end_value));
}
}
mark_dirty ();
}
-
+
if (op != 1) {
maybe_signal_changed ();
}
return nal;
-
}
AutomationList*