add a hack to deal with device discovery race, in which the devices were not actually...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 19 Feb 2014 18:15:33 +0000 (13:15 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 19 Feb 2014 18:22:52 +0000 (13:22 -0500)
gtk2_ardour/editor_drag.cc

index a7060dd433836c90adc13f710f2cbcedf92912e8..efa98997b04d19244069b7200d03500bf1de1dce 100644 (file)
@@ -3275,10 +3275,25 @@ 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);
+                       std::cerr << "Add new point @ " << where << ", " << _drags->current_pointer_y() << std::endl;
+                       atv->add_automation_event (event, where, _drags->current_pointer_y(), false);
+               }
+       }
+
        _editor->session()->commit_reversible_command ();
 }