From 7e8a98224578e03e17fbf5e656241ff5ef1a0bc1 Mon Sep 17 00:00:00 2001 From: Nick Mainsbridge Date: Mon, 10 Apr 2006 02:14:05 +0000 Subject: Reinstate mouse scroll actions (audio clocks, shuttle wheel, faders), clearing selection is undoable, fix compiler warning, add modified patch by Jon Michael Smith for mouse wheel track height adjustment and vertical canvas scrolling (thanks Jon) git-svn-id: svn://localhost/trunk/ardour2@449 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_canvas_events.cc | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'gtk2_ardour/editor_canvas_events.cc') diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 824b547938..256920d32f 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -49,7 +49,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) { int x, y; double wx, wy; - + switch (ev->direction) { case GDK_SCROLL_UP: if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { @@ -72,6 +72,16 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) jack_nframes_t where = event_frame (&event, 0, 0); temporal_zoom_to_frame (true, where); return true; + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) { + if (!current_stepping_trackview) { + step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500); + if (!(current_stepping_trackview = dynamic_cast (trackview_by_y_position (ev->y)))) { + return false; + } + } + gettimeofday (&last_track_height_step_timestamp, 0); + current_stepping_trackview->step_height (true); + return true; } else { scroll_tracks_up_line (); return true; @@ -94,15 +104,15 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) temporal_zoom_to_frame (false, where); return true; } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) { - if (clicked_trackview) { - if (!current_stepping_trackview) { - step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500); - current_stepping_trackview = clicked_trackview; - } - gettimeofday (&last_track_height_step_timestamp, 0); - current_stepping_trackview->step_height (true); + if (!current_stepping_trackview) { + step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500); + if (!(current_stepping_trackview = dynamic_cast (trackview_by_y_position (ev->y)))) { + return false; + } } - return true; + gettimeofday (&last_track_height_step_timestamp, 0); + current_stepping_trackview->step_height (false); + return true; } else { scroll_tracks_down_line (); return true; -- cgit v1.2.3