fix scrolling on clocks, and prevent attempts to edit the wrong fields
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jun 2011 18:29:36 +0000 (18:29 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 Jun 2011 18:29:36 +0000 (18:29 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9690 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_clock.cc

index 42e7aa3bcd6b7db7f0ddf843d924fa56c381d81b..4b70f420ab38d5e1f1a9976b1ecc5c2f934ae1da 100644 (file)
@@ -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) {