(c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
-#include "tie.hh"
+#include "engraver.hh"
+
#include "context.hh"
+#include "grob-pitch-tuple.hh"
+#include "international.hh"
+#include "item.hh"
+#include "note-head.hh"
#include "protected-scm.hh"
#include "spanner.hh"
+#include "staff-symbol-referencer.hh"
#include "tie-column.hh"
-#include "engraver.hh"
-#include "item.hh"
-#include "grob-pitch-tuple.hh"
+#include "tie.hh"
#include "warn.hh"
-#include "note-head.hh"
-#include "staff-symbol-referencer.hh"
/**
Manufacture ties. Acknowledge noteheads, and put them into a
class Tie_engraver : public Engraver
{
Music *event_;
- Link_array<Grob> now_heads_;
- Array<Head_event_tuple> heads_to_tie_;
- Link_array<Grob> ties_;
+ vector<Grob*> now_heads_;
+ vector<Head_event_tuple> heads_to_tie_;
+ vector<Grob*> ties_;
Spanner *tie_column_;
Tie_engraver::derived_mark () const
{
Engraver::derived_mark ();
- for (int i = 0; i < heads_to_tie_.size (); i++)
+ for (vsize i = 0; i < heads_to_tie_.size (); i++)
scm_gc_mark (heads_to_tie_[i].tie_definition_);
}
Tie_engraver::acknowledge_note_head (Grob_info i)
{
Grob *h = i.grob ();
- now_heads_.push (h);
- for (int i = heads_to_tie_.size (); i--;)
+ now_heads_.push_back (h);
+ for (vsize i = heads_to_tie_.size (); i--;)
{
Grob *th = heads_to_tie_[i].head_;
Music *right_mus = unsmob_music (h->get_property ("cause"));
Tie::set_head (p, LEFT, th);
Tie::set_head (p, RIGHT, h);
- ties_.push (p);
- heads_to_tie_.del (i);
+ ties_.push_back (p);
+ heads_to_tie_.erase (heads_to_tie_.begin () + i);
}
}
tie_column_ = make_spanner ("TieColumn", ties_[0]->self_scm ());
if (tie_column_)
- for (int i = ties_.size (); i--;)
+ for (vsize i = ties_.size (); i--;)
Tie_column::add_tie (tie_column_, ties_[i]);
}
if (!to_boolean (get_property ("tieWaitForNote")))
heads_to_tie_.clear ();
- for (int i = 0; i < ties_.size (); i++)
+ for (vsize i = 0; i < ties_.size (); i++)
typeset_tie (ties_[i]);
ties_.clear ();
if (!to_boolean (get_property ("tieWaitForNote")))
heads_to_tie_.clear ();
- for (int i = 0; i < now_heads_.size (); i++)
+ for (vsize i = 0; i < now_heads_.size (); i++)
{
- heads_to_tie_.push (Head_event_tuple (now_heads_[i], event_,
+ heads_to_tie_.push_back (Head_event_tuple (now_heads_[i], event_,
start_definition));
}
}