2 grace-spacing-engraver.cc -- implement Grace_spacing_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2006 Han-Wen <hanwen@lilypond.org>
10 #include "engraver.hh"
12 #include "pointer-group-interface.hh"
14 #include "translator.icc"
16 class Grace_spacing_engraver : public Engraver
18 TRANSLATOR_DECLARATIONS (Grace_spacing_engraver);
23 Spanner *grace_spacing_;
25 void process_music ();
26 void stop_translation_timestep ();
30 Grace_spacing_engraver::Grace_spacing_engraver ()
36 Grace_spacing_engraver::process_music ()
38 Moment now = now_mom ();
39 if (!last_moment_.grace_part_ and now.grace_part_)
41 grace_spacing_ = make_spanner ("GraceSpacing", SCM_EOL);
45 if (grace_spacing_ && (now.grace_part_ || last_moment_.grace_part_))
47 Grob *column = unsmob_grob (get_property ("currentMusicalColumn"));
48 Pointer_group_interface::add_grob (grace_spacing_,
49 ly_symbol2scm ("columns"),
52 column->set_object ("grace-spacing", grace_spacing_->self_scm ());
57 Grace_spacing_engraver::stop_translation_timestep ()
59 last_moment_ = now_mom ();
61 if (!last_moment_.grace_part_)
66 ADD_TRANSLATOR (Grace_spacing_engraver,
67 "Bookkeeping of shortest starting and playing notes in grace note runs.",
76 "currentMusicalColumn ",