+void
+AutomationLine::modify_point_y (ControlPoint& cp, double y)
+{
+ /* clamp y-coord appropriately. y is supposed to be a normalized fraction (0.0-1.0),
+ and needs to be converted to a canvas unit distance.
+ */
+
+ y = max (0.0, y);
+ y = min (1.0, y);
+ y = _height - (y * _height);
+
+ double const x = trackview.editor().frame_to_unit ((*cp.model())->when);
+
+ trackview.editor().current_session()->begin_reversible_command (_("automation event move"));
+ trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
+
+ cp.move_to (x, y, ControlPoint::Full);
+ reset_line_coords (cp);
+
+ if (line_points.size() > 1) {
+ line->property_points() = line_points;
+ }
+
+ alist->freeze ();
+ sync_model_with_view_point (cp, false, 0);
+ alist->thaw ();
+
+ update_pending = false;
+
+ trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
+ trackview.editor().current_session()->commit_reversible_command ();
+ trackview.editor().current_session()->set_dirty ();
+}
+
+