summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_selection.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-11 01:23:03 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-11 01:23:03 +0000
commitefe60474d6447fa710db5dd863f3058e3ab2e511 (patch)
tree91084a3378904dcfadacd94507d2035e49973277 /gtk2_ardour/editor_selection.cc
parent33e58df92c0b6731bdabe96f67bebad665c5d8da (diff)
Hopefully fix up automation control point selection (finally).
git-svn-id: svn://localhost/ardour2/branches/3.0@7592 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r--gtk2_ardour/editor_selection.cc39
1 files changed, 16 insertions, 23 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index a72d595b2f..7569c3e0a7 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -240,30 +240,23 @@ Editor::set_selected_control_point_from_click (Selection::Operation op, bool /*n
if (!clicked_control_point) {
return false;
}
-
- /* We know the ControlPoint that was clicked, but (as discussed in automation_selectable.h)
- * selected automation data are described by areas on the AutomationLine. A ControlPoint
- * represents any model points in the space that it takes up, so the AutomationSelectable
- * needs to be the size of the ControlPoint.
- */
-
- double const size = clicked_control_point->size ();
- AutomationLine& line = clicked_control_point->line ();
- nframes64_t const x1 = pixel_to_frame (clicked_control_point->get_x() - size / 2) + line.time_converter().origin_b ();
- nframes64_t const x2 = pixel_to_frame (clicked_control_point->get_x() + size / 2) + line.time_converter().origin_b ();
- double y1 = clicked_control_point->get_y() - size / 2;
- double y2 = clicked_control_point->get_y() + size / 2;
-
- /* convert the y values to trackview space */
- double dummy = 0;
- clicked_control_point->line().parent_group().i2w (dummy, y1);
- clicked_control_point->line().parent_group().i2w (dummy, y2);
- _trackview_group->w2i (dummy, y1);
- _trackview_group->w2i (dummy, y2);
-
- /* and set up the selection */
- return select_all_within (x1, x2, y1, y2, selection->tracks, op, true);
+ switch (op) {
+ case Selection::Set:
+ selection->set (clicked_control_point);
+ break;
+ case Selection::Add:
+ selection->add (clicked_control_point);
+ break;
+ case Selection::Toggle:
+ selection->toggle (clicked_control_point);
+ break;
+ case Selection::Extend:
+ /* XXX */
+ break;
+ }
+
+ return true;
}
void