From 7c6b33e7994741173d095c163832a8b8266a8728 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 8 Jun 2011 18:29:36 +0000 Subject: [PATCH] fix scrolling on clocks, and prevent attempts to edit the wrong fields git-svn-id: svn://localhost/ardour2/branches/3.0@9690 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_clock.cc | 43 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 42e7aa3bcd..4b70f420ab 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -967,8 +967,26 @@ AudioClock::button_press (GdkEventButton *ev, CairoCell* cell) case 1: if (editable) { if (cell) { - editing_field = (Field) cell->id (); - display->start_editing (cell); + Field f = (Field) cell->id (); + switch (f) { + case Timecode_Hours: + case Timecode_Minutes: + case Timecode_Seconds: + case Timecode_Frames: + case MS_Hours: + case MS_Minutes: + case MS_Seconds: + case MS_Milliseconds: + case Bars: + case Beats: + case Ticks: + case AudioFrames: + editing_field = f; + display->start_editing (cell); + break; + default: + return false; + } } Keyboard::magic_widget_grab_focus (); @@ -1024,6 +1042,27 @@ AudioClock::scroll (GdkEventScroll *ev, CairoCell* cell) return false; } + if (cell) { + Field f = (Field) cell->id (); + switch (f) { + case Timecode_Hours: + case Timecode_Minutes: + case Timecode_Seconds: + case Timecode_Frames: + case MS_Hours: + case MS_Minutes: + case MS_Seconds: + case MS_Milliseconds: + case Bars: + case Beats: + case Ticks: + case AudioFrames: + break; + default: + return false; + } + } + framepos_t frames = 0; switch (ev->direction) {