+ if (event->button.button != 3) {
+ _mouse_changed_selection |= set_selected_control_point_from_click (press, op);
+ } else {
+ _mouse_changed_selection |= set_selected_control_point_from_click (press, Selection::Set);
+ }
+ }
+ break;
+
+ case GainLineItem:
+ if (eff_mouse_mode != MouseRange) {
+ AutomationLine* argl = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
+
+ std::list<Selectable*> selectables;
+ uint32_t before, after;
+ samplecnt_t const where = (samplecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position ();
+
+ if (!argl || !argl->control_points_adjacent (where, before, after)) {
+ break;
+ }
+
+ selectables.push_back (argl->nth (before));
+ selectables.push_back (argl->nth (after));
+
+ switch (op) {
+ case Selection::Set:
+ if (press) {
+ selection->set (selectables);
+ _mouse_changed_selection = true;
+ }
+ break;
+ case Selection::Add:
+ if (press) {
+ selection->add (selectables);
+ _mouse_changed_selection = true;
+ }
+ break;
+ case Selection::Toggle:
+ if (press) {
+ selection->toggle (selectables);
+ _mouse_changed_selection = true;
+ }
+ break;
+
+ case Selection::Extend:
+ /* XXX */
+ break;
+ }
+ }
+ break;
+
+ case AutomationLineItem:
+ if (eff_mouse_mode != MouseRange) {
+ AutomationLine* al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
+ std::list<Selectable*> selectables;
+ double mx = event->button.x;
+ double my = event->button.y;
+
+ al->grab_item().canvas_to_item (mx, my);
+
+ uint32_t before, after;
+ samplecnt_t const where = (samplecnt_t) floor (mx * samples_per_pixel);
+
+ if (!al || !al->control_points_adjacent (where, before, after)) {
+ break;
+ }
+
+ selectables.push_back (al->nth (before));
+ selectables.push_back (al->nth (after));
+
+ switch (op) {
+ case Selection::Set:
+ if (press) {
+ selection->set (selectables);
+ _mouse_changed_selection = true;
+ }
+ break;
+ case Selection::Add:
+ if (press) {
+ selection->add (selectables);
+ _mouse_changed_selection = true;
+ }
+ break;
+ case Selection::Toggle:
+ if (press) {
+ selection->toggle (selectables);
+ _mouse_changed_selection = true;
+ }
+ break;
+
+ case Selection::Extend:
+ /* XXX */
+ break;
+ }