Mini-timeline: Any click not on a marker should trigger a locate
[ardour.git] / gtk2_ardour / editor_mouse.cc
index 01cb2175c16a056d0840048729f66b9a664f7bbf..578595ff2a5fc496f06664141e77edda499fe811 100644 (file)
@@ -47,6 +47,7 @@
 #include "ardour/types.h"
 
 #include "actions.h"
+#include "ardour_ui.h"
 #include "editor.h"
 #include "time_axis_view.h"
 #include "audio_time_axis.h"
@@ -574,8 +575,13 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
                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;
-                       framecnt_t const  where = (framecnt_t) floor (event->button.x * samples_per_pixel);
+                       framecnt_t const  where = (framecnt_t) floor (mx * samples_per_pixel);
 
                        if (!al || !al->control_points_adjacent (where, before, after)) {
                                break;
@@ -2136,6 +2142,16 @@ Editor::note_edit_done (int r, EditNoteDialog* d)
        commit_reversible_command();
 }
 
+void
+Editor::edit_region (RegionView* rv)
+{
+       if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) {
+               temporal_zoom_selection (Both);
+       } else {
+               rv->show_region_editor ();
+       }
+}
+
 void
 Editor::visible_order_range (int* low, int* high) const
 {
@@ -2510,7 +2526,7 @@ Editor::escape ()
                selection->clear ();
        }
 
-       reset_focus (&contents());
+       ARDOUR_UI::instance()->reset_focus (&contents());
 }
 
 /** Update _join_object_range_state which indicate whether we are over the top