13
0

two small fixes from melvin ray herr for the step editor

git-svn-id: svn://localhost/ardour2/branches/3.0@9171 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-03-21 15:07:37 +00:00
parent 3a1349bf60
commit 7874dd2b07
2 changed files with 15 additions and 8 deletions

View 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;
}

View 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