]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-pq-engraver.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / grob-pq-engraver.cc
index 6f6ee8faabd901ba2b851af7d52c6e5cf79c4cc5..e4e8b944f968aefd5647185bc9f2ef21c87a560f 100644 (file)
@@ -15,14 +15,13 @@ struct Grob_pq_entry
 {
   Grob *grob_;
   Moment end_;
+  static int compare (Grob_pq_entry const &a,
+                     Grob_pq_entry const &b)
+  {
+    return Moment::compare (a.end_, b.end_);
+  }
 };
 
-bool
-operator< (Grob_pq_entry const &a, Grob_pq_entry const &b)
-{
-  return a.end_ < b.end_;
-}
-
 class Grob_pq_engraver : public Engraver
 {
 public:
@@ -60,13 +59,13 @@ LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
 void
 Grob_pq_engraver::acknowledge_grob (Grob_info gi)
 {
-  Stream_event *ev = gi.event_cause ();
+  Music *m = gi.music_cause ();
 
-  if (ev
+  if (m
       && !gi.grob ()->internal_has_interface (ly_symbol2scm ("multi-measure-interface")))
     {
       Moment n = now_mom ();
-      Moment l = get_event_length (ev);
+      Moment l = m->get_length ();
 
       if (!l.to_bool ())
        return;
@@ -96,7 +95,7 @@ Grob_pq_engraver::stop_translation_timestep ()
   while (scm_is_pair (busy) && *unsmob_moment (scm_caar (busy)) == now)
     busy = scm_cdr (busy);
 
-  vector_sort (started_now_, less<Grob_pq_entry> ());
+  vector_sort (started_now_, Grob_pq_entry::compare);
   SCM lst = SCM_EOL;
   SCM *tail = &lst;
   for (vsize i = 0; i < started_now_.size (); i++)