summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-06-08 18:29:36 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-06-08 18:29:36 +0000
commit7c6b33e7994741173d095c163832a8b8266a8728 (patch)
tree15686c7b05bc65d807ab21fa8c51c5fcfacf3bc6
parentb6b24d353b4486a5951ee5df60db1de11a559b9a (diff)
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
-rw-r--r--gtk2_ardour/audio_clock.cc43
1 files 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) {