summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas_events.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-05-19 20:10:35 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-05-19 20:10:35 +0000
commit9c6984dbbb5583147788876dba80e203c2d38d1a (patch)
tree4db0a08b1049f8ddd8f237c85474568e8a62e099 /gtk2_ardour/editor_canvas_events.cc
parent50ee09e80ff91bf0146e89728578d5e31aba23b7 (diff)
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
Diffstat (limited to 'gtk2_ardour/editor_canvas_events.cc')
-rw-r--r--gtk2_ardour/editor_canvas_events.cc131
1 files changed, 69 insertions, 62 deletions
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<AudioTimeAxisView*> (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<AudioTimeAxisView*> (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<AudioTimeAxisView*> (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<AudioTimeAxisView*> (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;
}