X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=score.c;fp=score.c;h=db07d5e9d57f33436688db8741d2a4442d519760;hb=6d1dd804ce022f0fbc3cebc853edcab5c81d5abc;hp=26c5a02818e6ba60ad6f77c7e00141719ff16ddb;hpb=dd9b9d386cfb63002f3e8d1521b25abfa58b76e5;p=scherzo diff --git a/score.c b/score.c index 26c5a02..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); @@ -496,6 +503,17 @@ score_remove_note (score_note_t *note) } } +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 * score_staff_find_note (score_staff_t *staff, score_pitch_t pitch,