X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fcustos-engraver.cc;h=8709c87f0ae9ebe710a30678e4349c95c8530ec3;hb=a8c9e8a7ca320ab0df5fd32e717fd62cd7635ce6;hp=eb292f86e5aa2a1c910bacda7f6ac863bba299c7;hpb=75eebcb49e52d296b1da3e1074e0825d2c780db4;p=lilypond.git diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index eb292f86e5..8709c87f0a 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2000--2006 Juergen Reuter , + (c) 2000--2009 Juergen Reuter , Han-Wen Nienhuys */ @@ -11,9 +11,10 @@ #include "bar-line.hh" #include "item.hh" #include "note-head.hh" +#include "pitch.hh" #include "staff-symbol-referencer.hh" +#include "stream-event.hh" #include "warn.hh" -#include "pitch.hh" #include "translator.icc" @@ -37,8 +38,8 @@ public: private: Item *create_custos (); bool custos_permitted_; - Link_array custodes_; - Array pitches_; + vector custodes_; + vector pitches_; }; Custos_engraver::Custos_engraver () @@ -64,17 +65,16 @@ Custos_engraver::start_translation_timestep () } void -Custos_engraver::acknowledge_bar (Grob_info info) +Custos_engraver::acknowledge_bar (Grob_info /* info */) { - (void) info; custos_permitted_ = true; } void Custos_engraver::acknowledge_note_head (Grob_info info) { - Music *m = info.music_cause (); - if (m && m->is_mus_type ("note-event")) + Stream_event *ev = info.event_cause (); + if (ev && ev->in_event_class ("note-event")) { /* @@ -85,7 +85,7 @@ Custos_engraver::acknowledge_note_head (Grob_info info) don't look at the staff-position, since we can't be sure whether Clef_engraver already applied a vertical shift. */ - pitches_.push (*unsmob_pitch (m->get_property ("pitch"))); + pitches_.push_back (*unsmob_pitch (ev->get_property ("pitch"))); } } @@ -97,7 +97,7 @@ Custos_engraver::process_acknowledged () if (custos_permitted_) { - for (int i = pitches_.size (); i--;) + for (vsize i = pitches_.size (); i--;) { Item *c = create_custos (); @@ -119,7 +119,7 @@ Custos_engraver::create_custos () { Item *custos = make_item ("Custos", SCM_EOL); - custodes_.push (custos); + custodes_.push_back (custos); return custos; } @@ -127,7 +127,7 @@ Custos_engraver::create_custos () void Custos_engraver::finalize () { - for (int i = custodes_.size (); i--;) + for (vsize i = custodes_.size (); i--;) custodes_[i]->suicide (); custodes_.clear (); } @@ -136,8 +136,15 @@ ADD_ACKNOWLEDGER (Custos_engraver, bar); ADD_ACKNOWLEDGER (Custos_engraver, note_head); ADD_TRANSLATOR (Custos_engraver, - /* doc */ "", - /* create */ "Custos", - /* accept */ "", - /* read */ "", - /* write */ ""); + /* doc */ + "Engrave custodes.", + + /* create */ + "Custos ", + + /* read */ + "", + + /* write */ + "" + );