note->octave == challenge->note->octave)
{
challenge->satisfied = 1;
+ score_set_note_color_rgb (note, 18/256., 130/256., 28/256.); /* green */
}
else
{
challenge->mistaken = 1;
+ score_set_note_color_rgb (note, 184/256., 4/256., 22/256.); /* red */
}
}
scherzo.ctx = talloc_new (NULL);
scherzo.score = score_create (scherzo.ctx);
- scherzo.staff_height = 48;
+ scherzo.staff_height = 100;
score_set_staff_height (scherzo.score, scherzo.staff_height);
score_add_brace (scherzo.score, 2);
scherzo.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_default_size (GTK_WINDOW (scherzo.window), 600, 400);
+ gtk_window_set_default_size (GTK_WINDOW (scherzo.window), 1000, 600);
g_signal_connect (scherzo.window, "delete-event",
G_CALLBACK (on_delete_event_quit), NULL);
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;
}
}
- 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);
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);
}
}
+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,
score_pitch_t pitch;
int octave;
score_duration_t duration;
+
+ struct {
+ double r;
+ double g;
+ double b;
+ } color;
} score_note_t;
typedef enum score_clef
void
score_remove_note (score_note_t *note);
+void
+score_set_note_color_rgb (score_note_t *note,
+ double r,
+ double g,
+ double b);
+
/* Return the first note on the given staff with the given pitch,
* octave, and durations. Returns NULL if no match is found. */
score_note_t *