summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-03-02 18:08:15 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-03-02 18:08:15 +0000
commit7a5adcbe72d9d0762eb42fc897316e7326e273db (patch)
treeecb94f05b1b5f29511dc062eb7f16cefcb4e8908 /gtk2_ardour/automation_line.cc
parent9f4c7a9e9edd260a72f040b036982d4c5da89292 (diff)
allow dragging of automation lines (Ben Loftis, backported from 2.X)
git-svn-id: svn://localhost/ardour2/branches/3.0@4715 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 8156ec2a04..49e583ba36 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -780,15 +780,31 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
line_drag_cp1 = i1;
line_drag_cp2 = i2;
+ //check if one of the control points on the line is in a selected range
+ bool range_found = false;
ControlPoint *cp;
for (uint32_t i = i1 ; i <= i2; i++) {
cp = nth (i);
- modify_view_point (*cp,
- trackview.editor().unit_to_frame (_time_converter.to(cp->get_x())),
- ((_height - cp->get_y()) /_height) + ydelta, with_push);
+ if ( cp->selected ) {
+ range_found = true;
+ }
}
+ if (range_found) {
+ for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
+ if ( (*i)->selected ) {
+ modify_view_point (*(*i), trackview.editor.unit_to_frame ((*i)->get_x()), ((_height - (*i)->get_y()) /_height) + ydelta, with_push);
+ }
+ }
+ } else {
+ ControlPoint *cp;
+ for (uint32_t i = i1 ; i <= i2; i++) {
+ cp = nth (i);
+ modify_view_point (*cp, trackview.editor.unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
+ }
+ }
+
if (line_points.size() > 1) {
line->property_points() = line_points;
}