diff options
author | Ben Loftis <ben@glw.com> | 2009-02-17 23:08:59 +0000 |
---|---|---|
committer | Ben Loftis <ben@glw.com> | 2009-02-17 23:08:59 +0000 |
commit | 45302a85874693e6844a690bb4404994ddefc181 (patch) | |
tree | 6dad4da9a7671ad0f12b6bb232e5d3bea93956dd /gtk2_ardour | |
parent | 1df29ef6d7db17355e63f04714f5a18216528afa (diff) |
allow dragging of automation lines
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4619 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 21a7a2f515..bf9bd159e7 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -846,13 +846,29 @@ 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 (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; } |