From 9c6984dbbb5583147788876dba80e203c2d38d1a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 19 May 2006 20:10:35 +0000 Subject: allow for mandatory control protocols, plus some ongoing work on automation control point selection (unfinished) git-svn-id: svn://localhost/trunk/ardour2@516 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_canvas_events.cc | 131 +++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 62 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 256920d32f..29997f5f57 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -52,77 +52,78 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) switch (ev->direction) { case GDK_SCROLL_UP: - if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { - //if (ev->state == GDK_CONTROL_MASK) { - /* XXX - the ev->x will be out of step with the canvas - if we're in mid zoom, so we have to get the damn mouse - pointer again - */ - track_canvas.get_pointer (x, y); - track_canvas.window_to_world (x, y, wx, wy); - wx += horizontal_adjustment.get_value(); - wy += vertical_adjustment.get_value(); - - GdkEvent event; - event.type = GDK_BUTTON_RELEASE; - event.button.x = wx; - event.button.y = wy; - - 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; + if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { + //if (ev->state == GDK_CONTROL_MASK) { + /* XXX + the ev->x will be out of step with the canvas + if we're in mid zoom, so we have to get the damn mouse + pointer again + */ + track_canvas.get_pointer (x, y); + track_canvas.window_to_world (x, y, wx, wy); + wx += horizontal_adjustment.get_value(); + wy += vertical_adjustment.get_value(); + + GdkEvent event; + event.type = GDK_BUTTON_RELEASE; + event.button.x = wx; + event.button.y = wy; + + 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; } - gettimeofday (&last_track_height_step_timestamp, 0); - current_stepping_trackview->step_height (true); - return true; - } else { - scroll_tracks_up_line (); - return true; - } - break; + break; case GDK_SCROLL_DOWN: - if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { - //if (ev->state == GDK_CONTROL_MASK) { - track_canvas.get_pointer (x, y); - track_canvas.window_to_world (x, y, wx, wy); - wx += horizontal_adjustment.get_value(); - wy += vertical_adjustment.get_value(); - - GdkEvent event; - event.type = GDK_BUTTON_RELEASE; - event.button.x = wx; - event.button.y = wy; - - jack_nframes_t where = event_frame (&event, 0, 0); - temporal_zoom_to_frame (false, 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; + if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) { + //if (ev->state == GDK_CONTROL_MASK) { + track_canvas.get_pointer (x, y); + track_canvas.window_to_world (x, y, wx, wy); + wx += horizontal_adjustment.get_value(); + wy += vertical_adjustment.get_value(); + + GdkEvent event; + event.type = GDK_BUTTON_RELEASE; + event.button.x = wx; + event.button.y = wy; + + jack_nframes_t where = event_frame (&event, 0, 0); + temporal_zoom_to_frame (false, 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 (false); + return true; + } else { + scroll_tracks_down_line (); + return true; } - gettimeofday (&last_track_height_step_timestamp, 0); - current_stepping_trackview->step_height (false); - return true; - } else { - scroll_tracks_down_line (); - return true; - } - break; + break; + default: /* no left/right handling yet */ break; } - + return false; } @@ -547,6 +548,12 @@ Editor::canvas_control_point_event (GdkEvent *event, ArdourCanvas::Item* item, C clicked_regionview = 0; break; + case GDK_SCROLL_UP: + break; + + case GDK_SCROLL_DOWN: + break; + default: break; } -- cgit v1.2.3