diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-02-19 13:22:41 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-02-19 13:22:52 -0500 |
commit | 39859e47c72ecc91e68d84d6f2d87ce6abf7e06c (patch) | |
tree | 467879e655cb27f90db7b9ada861ea0e09a4307b /gtk2_ardour | |
parent | efc3c8be42d4f55fe9b2f7104ee6c49207f58b2b (diff) |
click (no drag) on automation line now adds a new control point on the line (not fully checked for precision)
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index a7060dd433..8118aa3dbc 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3275,10 +3275,24 @@ LineDrag::motion (GdkEvent* event, bool) } void -LineDrag::finished (GdkEvent* event, bool) +LineDrag::finished (GdkEvent* event, bool movement_occured) { - motion (event, false); - _line->end_drag (false, 0); + if (movement_occured) { + motion (event, false); + _line->end_drag (false, 0); + } else { + /* add a new control point on the line */ + + AutomationTimeAxisView* atv; + + _line->end_drag (false, 0); + + if ((atv = dynamic_cast<AutomationTimeAxisView*>(_editor->clicked_axisview)) != 0) { + framepos_t where = _editor->event_frame (event, 0, 0); + atv->add_automation_event (event, where, event->button.y, false); + } + } + _editor->session()->commit_reversible_command (); } |