]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/porrectus-engraver.cc
release commit
[lilypond.git] / lily / porrectus-engraver.cc
index cf1b8962f5309ba03a51cb2ad852b23440fe4f40..094ea40f80761bb3b65954ac280b10bdd6993e6b 100644 (file)
@@ -22,7 +22,7 @@
  * ligature context that encloses use of this engraver, using syntax
  * like: \ligature { e \~ c }.
  *
- * TODO: Do not allow a series of adjacent porrectus requests, as in:
+ * TODO: Do not allow a series of adjacent porrectus events, as in:
  * e \~ d \~ c.
  *
  * TODO: Junk duplicate (or rather triple) implementation of
@@ -31,8 +31,8 @@
 
 #include "staff-symbol-referencer.hh"
 #include "porrectus.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "event.hh"
+
 #include "rhythmic-head.hh"
 #include "item.hh"
 #include "engraver.hh"
@@ -55,7 +55,7 @@ protected:
 
 private:
   PQueue<Grob_pitch_tuple> past_notes_pq_;
-  Porrectus_req *porrectus_req_;
+  Music *porrectus_req_;
   Array<Grob_pitch_tuple> left_heads_;
   Array<Grob_pitch_tuple> right_heads_;
   Link_array<Grob> porrectuses_;
@@ -69,9 +69,9 @@ Porrectus_engraver::Porrectus_engraver ()
 bool
 Porrectus_engraver::try_music (Music *m)
 {
-  if (Porrectus_req *req_ = dynamic_cast <Porrectus_req *> (m))
+  if (m->is_mus_type ("porrectus-event"))
     {
-      porrectus_req_ = req_;
+      porrectus_req_ = m;
       return true;
     }
   else
@@ -92,12 +92,11 @@ Porrectus_engraver::acknowledge_grob (Grob_info info_)
 {
   if (Rhythmic_head::has_interface (info_.grob_))
     {
-      Note_req *note_req_ = dynamic_cast <Note_req *> (info_.music_cause ());
-      if (!note_req_)
-       return;
-      right_heads_.push (Grob_pitch_tuple (info_.grob_, note_req_,
-                                             now_mom () +
-                                             note_req_->length_mom ()));
+      Music * m = info_.music_cause ();
+      if (m->is_mus_type ("note-event"))
+       right_heads_.push (Grob_pitch_tuple (info_.grob_, m,
+                                            now_mom () +
+                                            m->get_length ()));
     }
 }
 
@@ -168,6 +167,7 @@ Porrectus_engraver::start_translation_timestep ()
 ENTER_DESCRIPTION(Porrectus_engraver,
 /* descr */       "Join adjacent notes to a porrectus ligature.",
 /* creats*/       "Porrectus",
-/* acks  */       "rhythmic-head-interface",
+/* accepts */     "porrectus-event",
+/* acks  */      "rhythmic-head-interface",
 /* reads */       "",
 /* write */       "");