]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental-placement.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / accidental-placement.cc
index 2a97f7f38242f2f9a74b6e1d0a89f9fea326f78f..d8702520e1817fc7637bf0a3740597486e022199 100644 (file)
@@ -7,17 +7,16 @@
 */
 
 
-#include "accidental-placement.hh"
 
-#include "accidental-interface.hh"
+#include "accidental-placement.hh"
+#include "skyline.hh"
 #include "music.hh"
-#include "note-collision.hh"
-#include "note-column.hh"
 #include "pitch.hh"
-#include "pointer-group-interface.hh"
-#include "skyline.hh"
-#include "stream-event.hh"
 #include "warn.hh"
+#include "note-column.hh"
+#include "pointer-group-interface.hh"
+#include "note-collision.hh"
+#include "accidental-interface.hh"
 
 
 void
@@ -27,10 +26,10 @@ Accidental_placement::add_accidental (Grob *me, Grob *a)
   a->set_property ("X-offset", Grob::x_parent_positioning_proc);
   SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
 
-  Stream_event *mcause = unsmob_stream_event (cause);
+  Music *mcause = unsmob_music (cause);
   if (!mcause)
     {
-      programming_error ("note head has no event cause");
+      programming_error ("note head has no music cause");
       return;
     }
 
@@ -135,12 +134,6 @@ int ape_compare (Accidental_placement_entry *const &a,
   return sign (ape_priority (a) - ape_priority (b));
 }
 
-bool ape_less (Accidental_placement_entry *const &a,
-              Accidental_placement_entry *const &b)
-{
-  return ape_priority (a) < ape_priority (b);
-}
-
 int ape_rcompare (Accidental_placement_entry *const &a,
                  Accidental_placement_entry *const &b)
 {
@@ -160,7 +153,7 @@ stagger_apes (vector<Accidental_placement_entry*> *apes)
 {
   vector<Accidental_placement_entry*> asc = *apes;
 
-  vector_sort (asc, &ape_less);
+  vector_sort (asc, &ape_compare);
 
   apes->clear ();
 
@@ -299,7 +292,7 @@ Accidental_placement::calc_positioning_done (SCM smob)
   for (vsize i = note_cols.size (); i--;)
     concat (heads, extract_grob_array (note_cols[i], "note-heads"));
 
-  vector_sort (heads, less<Grob*> ());
+  vector_sort (heads, default_compare);
   uniq (heads);
   common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);