diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-28 21:36:40 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-28 21:36:40 +0000 |
commit | c4ac43749048c4c0e0ab3656d39384112a628742 (patch) | |
tree | 72d3452034c1a0a661587611a63d00509684ca27 /gtk2_ardour/mixer_ui.cc | |
parent | ee4493301a8247fb8032dd949f4c44cd4c641221 (diff) |
* libardour uses ARDOUR::nframes_t and ARDOUR::nframes64_t explicitly in headers
* use explicit operator<< and operator>> that in turn use PBD::EnumWriter when serializing and deserializing to/from rc files
* adds scrolling in mixer window (from 2.X)
* BBT math stuff - untested, but basically operational
* move LocaleGuard into its own file(s) in libs/pbd
* Tempo now uses nframes64_t everywhere (except for sample rate values)
* as in 2.X, use mkstemp and hack to avoid temp file nonsense, and remove erroneous free() from disk stats output
git-svn-id: svn://localhost/ardour2/branches/3.0@5961 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index dbc61f4308..0d3f42c1d5 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1459,10 +1459,38 @@ Mixer_UI::pane_allocation_handler (Allocation&, Gtk::Paned* which) } } } +void +Mixer_UI::scroll_left () +{ + Adjustment* adj = scroller.get_hscrollbar()->get_adjustment(); + /* stupid GTK: can't rely on clamping across versions */ + scroller.get_hscrollbar()->set_value (max (adj->get_lower(), adj->get_value() - adj->get_step_increment())); +} + +void +Mixer_UI::scroll_right () +{ + Adjustment* adj = scroller.get_hscrollbar()->get_adjustment(); + /* stupid GTK: can't rely on clamping across versions */ + scroller.get_hscrollbar()->set_value (min (adj->get_upper(), adj->get_value() + adj->get_step_increment())); +} bool Mixer_UI::on_key_press_event (GdkEventKey* ev) { + switch (ev->keyval) { + case GDK_Left: + scroll_left (); + return true; + + case GDK_Right: + scroll_right (); + return true; + + default: + break; + } + return key_press_focus_accelerator_handler (*this, ev); } @@ -1473,6 +1501,37 @@ Mixer_UI::on_key_release_event (GdkEventKey* ev) // return key_press_focus_accelerator_handler (*this, ev); } + +bool +Mixer_UI::on_scroll_event (GdkEventScroll* ev) +{ + switch (ev->direction) { + case GDK_SCROLL_LEFT: + scroll_left (); + return true; + case GDK_SCROLL_UP: + if (ev->state & Keyboard::TertiaryModifier) { + scroll_left (); + return true; + } + return false; + + case GDK_SCROLL_RIGHT: + scroll_right (); + return true; + + case GDK_SCROLL_DOWN: + if (ev->state & Keyboard::TertiaryModifier) { + scroll_right (); + return true; + } + return false; + } + + return false; +} + + void Mixer_UI::parameter_changed (string const & p) { |