X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=score.c;h=db07d5e9d57f33436688db8741d2a4442d519760;hb=8d6e370cf8a188f7174a4a66ddf382e0f744dfa0;hp=6530a503c7731fe43508dacf0b2fc2d9db543628;hpb=0d91a08ddeea3e07edb853e01f3b3dfde18ea7d7;p=scherzo diff --git a/score.c b/score.c index 6530a50..db07d5e 100644 --- a/score.c +++ b/score.c @@ -75,10 +75,10 @@ score_create (void *ctx) return NULL; /* Also sets space_height and line_width */ - score_set_staff_height (score, 24); + score_set_staff_height (score, 76); /* Just to have some nominal width. */ - score->width = 800; + score->width = 1000; score->braces = NULL; score->num_braces = 0; @@ -243,7 +243,10 @@ _draw_note (score_t *score, cairo_t *cr, } } - cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */ + cairo_set_source_rgb (cr, + note->color.r, + note->color.g, + note->color.b); cairo_show_glyphs (cr, ¬e_glyph, 1); cairo_restore (cr); @@ -442,6 +445,10 @@ score_add_note (score_staff_t *staff, note->octave = octave; note->duration = duration; + note->color.r = 0.0; + note->color.g = 0.0; + note->color.b = 0.0; + line = _score_note_to_line (staff, note); if (line < 0) { int lines = (int) (- line); @@ -489,6 +496,22 @@ score_remove_note (score_note_t *note) } staff->num_notes -= 1; + + if (staff->num_notes == 0) { + staff->upper_ledger_lines = 0; + staff->lower_ledger_lines = 0; + } +} + +void +score_set_note_color_rgb (score_note_t *note, + double r, + double g, + double b) +{ + note->color.r = r; + note->color.g = g; + note->color.b = b; } score_note_t *