X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftie-performer.cc;h=0519fcb930488afe9d61b96a044890f629524df9;hb=b7bda3ecd08b19f4b598f40ca8940e183083fd4f;hp=5e1256453e5efc6474586e4a83a3dc37fad9b20f;hpb=b6a8afbd0a9a0b36b07c114503d81a7c420e09e7;p=lilypond.git diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index 5e1256453e..0519fcb930 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -3,22 +3,21 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2006 Han-Wen Nienhuys + (c) 1998--2007 Han-Wen Nienhuys */ #include "performer.hh" #include "audio-item.hh" #include "context.hh" -#include "pqueue.hh" #include "stream-event.hh" #include "translator.icc" class Tie_performer : public Performer { Stream_event *event_; - Stream_event *last_event_; vector now_heads_; + vector now_tied_heads_; vector heads_to_tie_; bool ties_created_; @@ -36,7 +35,6 @@ public: Tie_performer::Tie_performer () { event_ = 0; - last_event_ = 0; ties_created_ = false; } @@ -59,7 +57,11 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf) { if (Audio_note *an = dynamic_cast (inf.elem_)) { - now_heads_.push_back (inf); + if (an->tie_event_) + now_tied_heads_.push_back (inf); + else + now_heads_.push_back (inf); + for (vsize i = heads_to_tie_.size (); i--;) { Stream_event *right_mus = inf.event_; @@ -91,22 +93,24 @@ Tie_performer::stop_translation_timestep () if (ties_created_) { heads_to_tie_.clear (); - last_event_ = 0; ties_created_ = false; } if (event_) { heads_to_tie_ = now_heads_; - last_event_ = event_; } + + for (vsize i = now_tied_heads_.size(); i--;) + heads_to_tie_.push_back (now_tied_heads_[i]); + event_ = 0; now_heads_.clear (); + now_tied_heads_.clear (); } ADD_TRANSLATOR (Tie_performer, /* doc */ "Generate ties between noteheads of equal pitch.", /* create */ "", - /* accept */ "tie-event", /* read */ "tieMelismaBusy", /* write */ "");