+ uint32_t before_p, after_p;
+ double mx = ev->button.x;
+ double my = ev->button.y;
+
+ item->canvas_to_item (mx, my);
+
+ framecnt_t const frame_within_region = (framecnt_t) floor (mx * samples_per_pixel);
+
+ if (!gain_line->control_points_adjacent (frame_within_region, before_p, after_p)) {
+ /* no adjacent points */
+ return;
+ }
+
+ /*y is in item frame */
+ double const bx = gain_line->nth (before_p)->get_x();
+ double const ax = gain_line->nth (after_p)->get_x();
+ double const click_ratio = (ax - mx) / (ax - bx);
+
+ double y = ((gain_line->nth (before_p)->get_y() * click_ratio) + (gain_line->nth (after_p)->get_y() * (1 - click_ratio)));