]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie-engraver.cc
patch::: 1.3.108.jcn5
[lilypond.git] / lily / tie-engraver.cc
index 277a4206e29e920956436e3927c9820619819384..d58cc35da697de0d602cec2f2afb7bff06e3469b 100644 (file)
@@ -44,6 +44,7 @@ inline int compare (CHead_melodic_tuple const &a, CHead_melodic_tuple const &b)
  */
 class Tie_engraver : public Engraver
 {
+  bool done_;
   PQueue<CHead_melodic_tuple> past_notes_pq_;
   Moment end_mom_;
   Moment next_end_mom_;
@@ -62,7 +63,6 @@ protected:
   virtual void do_pre_move_processing ();
   virtual void acknowledge_element (Score_element_info);
   virtual bool do_try_music (Music*);
-  virtual void do_process_music ();
   virtual void process_acknowledged ();
   void typeset_tie (Score_element*);
 public:
@@ -118,21 +118,19 @@ Tie_engraver::acknowledge_element (Score_element_info i)
 }
 
 void
-Tie_engraver::do_process_music ()
+Tie_engraver::process_acknowledged ()
 {
-  if (req_l_)
+  if (req_l_ && !done_)
     {
       Moment now = now_mom ();
       stopped_heads_.clear ();
       while (past_notes_pq_.size ()
             && past_notes_pq_.front ().end_ == now)
        stopped_heads_.push (past_notes_pq_.get ());
+      done_ = true;
+      return;
     }
-}
 
-void
-Tie_engraver::process_acknowledged ()
-{
   if (req_l_)
     {
       now_heads_.sort (CHead_melodic_tuple::pitch_compare);
@@ -146,7 +144,7 @@ Tie_engraver::process_acknowledged ()
       while  (i >= 0 && j >=0)
        {
          int comp
-           = Musical_pitch::compare (*unsmob_pitch (now_heads_[i].req_l_->get_mus_property ("pitch") ),
+           = Pitch::compare (*unsmob_pitch (now_heads_[i].req_l_->get_mus_property ("pitch") ),
                                      *unsmob_pitch (stopped_heads_[j].req_l_->get_mus_property ("pitch")));
 
          if (comp)
@@ -265,6 +263,7 @@ Tie_engraver::do_post_move_processing ()
       set_melisma (false);
     }
   req_l_ = 0;
+  done_ = false;
   Moment now = now_mom ();
   while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
     past_notes_pq_.delmin ();
@@ -294,7 +293,7 @@ CHead_melodic_tuple::pitch_compare (CHead_melodic_tuple const&h1,
   SCM p1  = h1.req_l_->get_mus_property ("pitch");
   SCM p2  = h2.req_l_->get_mus_property ("pitch");
   
-  return Musical_pitch::equal_p (p1,p2) == SCM_BOOL_T;
+  return Pitch::equal_p (p1,p2) == SCM_BOOL_T;
 }
 
 int