- Moment now = now_moment ();
- Link_array<Note_head> nharr;
-
- stopped_heads_.clear ();
- while (past_notes_pq_.size ()
- && past_notes_pq_.front ().end_ == now)
- stopped_heads_.push (past_notes_pq_.get ());
+ Grob * h = i.grob_;
+ now_heads_.push (h);
+ for (int i = heads_to_tie_.size (); i--;)
+ {
+ Grob *th = heads_to_tie_[i];
+ Music * right_mus = unsmob_music (h->get_grob_property ("cause"));
+ Music * left_mus = unsmob_music (th->get_grob_property ("cause"));
+
+ /*
+ maybe should check positions too.
+ */
+ if (right_mus && left_mus
+ && gh_equal_p (right_mus->get_mus_property ("pitch"),
+ left_mus->get_mus_property ("pitch")))
+ {
+ Grob * p = make_spanner ("Tie");
+ Tie::set_interface (p); // cannot remove yet!
+
+ Tie::set_head (p, LEFT, th);
+ Tie::set_head (p, RIGHT, h);
+
+ ties_.push (p);
+ announce_grob(p, last_event_->self_scm());
+ }
+ }