]> git.cworth.org Git - scherzo/blobdiff - score.h
Don't queue up as many widget redraws.
[scherzo] / score.h
diff --git a/score.h b/score.h
index a07b9266d4aa5725f0221200c791165e407d81dd..531710348a6a2caad7b1222e622fc8b8d8146cb6 100644 (file)
--- a/score.h
+++ b/score.h
@@ -26,7 +26,6 @@
 
 typedef struct score score_t;
 typedef struct score_staff score_staff_t;
-typedef struct score_note score_note_t;
 
 #define SCORE_PITCH_ACCIDENTAL_MASK 0x07
 #define SCORE_PITCH_ACCIDENTAL_SHIFT 0
@@ -62,18 +61,6 @@ typedef enum score_pitch_name
 
 typedef enum score_pitch
 {
-    SCORE_PITCH_Aff = SCORE_PITCH_VALUE (A, DOUBLE_FLAT), 
-    SCORE_PITCH_Af  = SCORE_PITCH_VALUE (A, FLAT),       
-    SCORE_PITCH_A   = SCORE_PITCH_VALUE (A, NATURAL),    
-    SCORE_PITCH_As  = SCORE_PITCH_VALUE (A, SHARP),      
-    SCORE_PITCH_Ass = SCORE_PITCH_VALUE (A, DOUBLE_SHARP),
-
-    SCORE_PITCH_Bff = SCORE_PITCH_VALUE (B, DOUBLE_FLAT), 
-    SCORE_PITCH_Bf  = SCORE_PITCH_VALUE (B, FLAT),       
-    SCORE_PITCH_B   = SCORE_PITCH_VALUE (B, NATURAL),    
-    SCORE_PITCH_Bs  = SCORE_PITCH_VALUE (B, SHARP),      
-    SCORE_PITCH_Bss = SCORE_PITCH_VALUE (B, DOUBLE_SHARP),
-
     SCORE_PITCH_Cff = SCORE_PITCH_VALUE (C, DOUBLE_FLAT), 
     SCORE_PITCH_Cf  = SCORE_PITCH_VALUE (C, FLAT),       
     SCORE_PITCH_C   = SCORE_PITCH_VALUE (C, NATURAL),    
@@ -103,6 +90,18 @@ typedef enum score_pitch
     SCORE_PITCH_G   = SCORE_PITCH_VALUE (G, NATURAL),    
     SCORE_PITCH_Gs  = SCORE_PITCH_VALUE (G, SHARP),      
     SCORE_PITCH_Gss = SCORE_PITCH_VALUE (G, DOUBLE_SHARP),
+
+    SCORE_PITCH_Aff = SCORE_PITCH_VALUE (A, DOUBLE_FLAT), 
+    SCORE_PITCH_Af  = SCORE_PITCH_VALUE (A, FLAT),       
+    SCORE_PITCH_A   = SCORE_PITCH_VALUE (A, NATURAL),    
+    SCORE_PITCH_As  = SCORE_PITCH_VALUE (A, SHARP),      
+    SCORE_PITCH_Ass = SCORE_PITCH_VALUE (A, DOUBLE_SHARP),
+
+    SCORE_PITCH_Bff = SCORE_PITCH_VALUE (B, DOUBLE_FLAT), 
+    SCORE_PITCH_Bf  = SCORE_PITCH_VALUE (B, FLAT),       
+    SCORE_PITCH_B   = SCORE_PITCH_VALUE (B, NATURAL),    
+    SCORE_PITCH_Bs  = SCORE_PITCH_VALUE (B, SHARP),      
+    SCORE_PITCH_Bss = SCORE_PITCH_VALUE (B, DOUBLE_SHARP)
 } score_pitch_t;
 
 typedef enum score_duration
@@ -127,6 +126,14 @@ typedef enum score_duration
 
 #define SCORE_BUILD_NOTE(pitch, octave, duration) SCORE_PITCH_##pitch, (octave), SCORE_DURATION_##duration
 
+typedef struct score_note
+{
+    score_staff_t *staff;
+    score_pitch_t pitch;
+    int octave;
+    score_duration_t duration;
+} score_note_t;
+
 typedef enum score_clef
 {
     SCORE_CLEF_G,
@@ -173,14 +180,14 @@ score_add_staff (score_t *score, score_clef_t clef);
  * QUARTER=4, EIGHTH=8, etc.)
  */
 score_note_t *
-score_staff_add_note (score_staff_t *staff,
-                     score_pitch_t pitch,
-                     int octave,
-                     score_duration_t);
+score_add_note (score_staff_t *staff,
+               score_pitch_t pitch,
+               int octave,
+               score_duration_t);
 
 /* Remove the given note from the given staff. */
 void
-score_staff_remove_note (score_staff_t *staff, score_note_t *note);
+score_remove_note (score_note_t *note);
 
 /* Return the first note on the given staff with the given pitch,
  * octave, and durations. Returns NULL if no match is found. */