]> git.cworth.org Git - scherzo/blobdiff - score.c
Fix bug with stuck notes when challenge would switch staves.
[scherzo] / score.c
diff --git a/score.c b/score.c
index 965d127b2b645d89d08ca1d6b51831c68f9117d3..0c9d5f37cb37e20d9913e0601ef4b66246ccf777 100644 (file)
--- a/score.c
+++ b/score.c
@@ -366,10 +366,10 @@ score_add_staff (score_t *score, score_clef_t clef)
 }
 
 score_note_t *
-score_staff_add_note (score_staff_t *staff,
-                     score_pitch_t pitch,
-                     int octave,
-                     score_duration_t duration)
+score_add_note (score_staff_t *staff,
+               score_pitch_t pitch,
+               int octave,
+               score_duration_t duration)
 {
     score_note_t *note;
 
@@ -377,6 +377,7 @@ score_staff_add_note (score_staff_t *staff,
     if (note == NULL)
        return NULL;
 
+    note->staff = staff;
     note->pitch = pitch;
     note->octave = octave;
     note->duration = duration;
@@ -397,8 +398,9 @@ score_staff_add_note (score_staff_t *staff,
 }
 
 void
-score_staff_remove_note (score_staff_t *staff, score_note_t *note)
+score_remove_note (score_note_t *note)
 {
+    score_staff_t *staff = note->staff;
     int i;
 
     for (i = 0; i < staff->num_notes; i++)