]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie-performer.cc
* lily/musical-request.cc (music-duration-length,
[lilypond.git] / lily / tie-performer.cc
index b721cc963c21892a644933d503aee857c7dd7008..d76b71c4d8ebb06c0368943540e6ee7131b9a586 100644 (file)
 #include "performer.hh"
 
 struct CNote_melodic_tuple {
-  Melodic_req *req_ ;
+  Music *req_ ;
   Audio_note *note_;
   Moment end_;
   CNote_melodic_tuple ();
-  CNote_melodic_tuple (Audio_note*, Melodic_req*, Moment);
+  CNote_melodic_tuple (Audio_note*, Music*, Moment);
   static int pitch_compare (CNote_melodic_tuple const &, CNote_melodic_tuple const &);
   static int time_compare (CNote_melodic_tuple const &, CNote_melodic_tuple const &);  
 };
@@ -31,7 +31,7 @@ inline int compare (CNote_melodic_tuple const &a, CNote_melodic_tuple const &b)
 
 /**
    Manufacture ties.  Acknowledge notes, and put them into a
-   priority queue. If we have a Tie_req, connect the notes that finish
+   priority queue. If we have a Music, connect the notes that finish
    just at this time, and note that start at this time.
 
    TODO: should share code with Tie_engraver ?
@@ -43,7 +43,7 @@ public:
 private:
   bool done_;
   PQueue<CNote_melodic_tuple> past_notes_pq_;
-  Tie_req *req_;
+  Music *req_;
   Array<CNote_melodic_tuple> now_notes_;
   Array<CNote_melodic_tuple> stopped_notes_;
   Link_array<Audio_tie> ties_;
@@ -64,7 +64,9 @@ Tie_performer::Tie_performer ()
   done_ = false;
 }
 
-ENTER_DESCRIPTION (Tie_performer, "", "", "", "", "");
+ENTER_DESCRIPTION (Tie_performer, "", "",
+                  "tie-event",
+                  "", "", "");
 
 
 void
@@ -79,11 +81,8 @@ Tie_performer::try_music (Music *m)
 {
   if (!req_)
     {
-      if (Tie_req * c = dynamic_cast<Tie_req*> (m))
-       {
-         req_ = c;
-         return true;
-       }
+      req_ = m;
+      return true;
     }
   return false;
 }
@@ -93,10 +92,9 @@ Tie_performer::acknowledge_audio_element (Audio_element_info i)
 {
   if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_))
     {
-      Note_req * m = dynamic_cast<Note_req *> (i.req_);
-      if (!m)
-       return;
-      now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->length_mom ()));
+      Music *m = i.req_;
+      if (m->is_mus_type ("note-event"))
+       now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->length_mom ()));
     }
 }
 
@@ -199,7 +197,7 @@ CNote_melodic_tuple::CNote_melodic_tuple ()
   end_ = 0;
 }
 
-CNote_melodic_tuple::CNote_melodic_tuple (Audio_note *h, Melodic_req*m, Moment mom)
+CNote_melodic_tuple::CNote_melodic_tuple (Audio_note *h, Music*m, Moment mom)
 {
   note_ = h;
   req_ = m;