From 419a59574eda4140921dbc2018e5e6a8571a9775 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 21 Mar 2011 15:07:37 +0000 Subject: [PATCH] two small fixes from melvin ray herr for the step editor git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/3.0@9171 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/gtk_pianokeyboard.c | 19 +++++++++++-------- gtk2_ardour/step_entry.cc | 4 ++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/gtk_pianokeyboard.c b/gtk2_ardour/gtk_pianokeyboard.c index f9ab9068e..361e6685e 100644 --- a/gtk2_ardour/gtk_pianokeyboard.c +++ b/gtk2_ardour/gtk_pianokeyboard.c @@ -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; } - diff --git a/gtk2_ardour/step_entry.cc b/gtk2_ardour/step_entry.cc index af439ea26..0ac281b87 100644 --- a/gtk2_ardour/step_entry.cc +++ b/gtk2_ardour/step_entry.cc @@ -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 -- 2.11.4.GIT