two small fixes from melvin ray herr for the step editor
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 21 Mar 2011 15:07:37 +0000 (15:07 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 21 Mar 2011 15:07:37 +0000 (15:07 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9171 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/gtk_pianokeyboard.c
gtk2_ardour/step_entry.cc

index f9ab9068e45b317564a802a7c8a4129584b0e1a1..361e6685e9e0a708058fff3d44c2b9a6402ffe29 100644 (file)
@@ -102,17 +102,21 @@ draw_note(PianoKeyboard *pk, cairo_t* cr, int note)
        int             h = pk->notes[note].h;
 
        if (pk->notes[note].pressed || pk->notes[note].sustained) {
-               is_white = !is_white;
+               if (is_white) {
+                       cairo_set_source_rgb (cr, 0.60f, 0.60f, 0.60f);
+               } else {
+                       cairo_set_source_rgb (cr, 0.50f, 0.50f, 0.50f);
+               }
+       } else {
+               if (is_white) {
+                       cairo_set_source_rgb (cr, 1.0f, 1.0f, 1.0f);
+               } else {
+                       cairo_set_source_rgb (cr, 0.0f, 0.0f, 0.0f);
+               }
        }
 
        cairo_set_line_width (cr, 1.0);
 
-       if (is_white) {
-               cairo_set_source_rgb (cr, 1.0f, 1.0f, 1.0f);
-       } else {
-               cairo_set_source_rgb (cr, 0.0f, 0.0f, 0.0f);
-       }
-
        cairo_rectangle (cr, x, 0, w, h);
        cairo_fill (cr);
 
@@ -744,4 +748,3 @@ piano_keyboard_set_keyboard_layout(PianoKeyboard *pk, const char *layout)
 
        return FALSE;
 }
-
index af439ea26fd1fb0d2cc2250ef68551048b88866f..0ac281b8779ff4139698999790007f10f87c83bc 100644 (file)
@@ -790,6 +790,10 @@ StepEntry::insert_grid_rest ()
 void
 StepEntry::insert_note (uint8_t note)
 {
+        if (note > 127) {
+                return;
+        }
+
        se->step_add_note (note_channel(), note, note_velocity(), note_length());
 }
 void