X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Feditor_summary.cc;h=0dc728d18e26e837e6b3e15ad87c63d63be5c85e;hb=3f56abe099cd6978fbf2e1778debd74e771c95cd;hp=1d7440115e8580c5be2a0955996ff13f4bf95d16;hpb=67e842bf4c5a9bab0ef3532a680c81e826ea4940;p=ardour.git diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 1d7440115e..0dc728d18e 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -316,7 +316,7 @@ EditorSummary::on_key_press_event (GdkEventKey* key) if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) { if (_session) { get_pointer (x, y); - _session->request_locate ((framepos_t) x / _x_scale, _session->transport_rolling()); + _session->request_locate (_start + (framepos_t) x / _x_scale, _session->transport_rolling()); return true; } } @@ -623,45 +623,55 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev) double x = xr.first; double y = yr.first; - double amount = 8; - - if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { - amount = 64; - } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) { - amount = 1; - } - - if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { - - /* secondary-wheel == left-right scrolling */ - - if (ev->direction == GDK_SCROLL_UP) { - x -= amount; - } else if (ev->direction == GDK_SCROLL_DOWN) { - x += amount; - } - - } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - - /* primary-wheel == zoom */ - - if (ev->direction == GDK_SCROLL_UP) { - _editor->temporal_zoom_step (false); - } else { - _editor->temporal_zoom_step (true); - } - - } else { - - if (ev->direction == GDK_SCROLL_DOWN) { - y += amount; - } else if (ev->direction == GDK_SCROLL_UP) { - y -= amount; - } else if (ev->direction == GDK_SCROLL_LEFT) { - x -= amount; - } else if (ev->direction == GDK_SCROLL_RIGHT) { - x += amount; - } + switch (ev->direction) { + case GDK_SCROLL_UP: + if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) { + x -= 64; + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) { + _editor->temporal_zoom_step (false); + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) { + yr.first += 4; + yr.second -= 4; + set_editor (xr, yr); + return true; + } else { + y -= 8; + } + break; + case GDK_SCROLL_DOWN: + if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) { + x += 64; + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) { + _editor->temporal_zoom_step (true); + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) { + yr.first -= 4; + yr.second += 4; + set_editor (xr, yr); + return true; + } else { + y += 8; + } + break; + case GDK_SCROLL_LEFT: + if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { + x -= 64; + } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) { + x -= 1; + } else { + x -= 8; + } + break; + case GDK_SCROLL_RIGHT: + if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { + x += 64; + } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) { + x += 1; + } else { + x += 8; + } + break; + default: + break; } set_editor (x, y); @@ -689,8 +699,6 @@ EditorSummary::set_editor (double const x, double const y) is merely pending but not executing. But c'est la vie. */ - cerr << "Editor pending idle already queued\n"; - return; }