2 note-head-line-engraver.cc -- implement Note_head_line_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2007 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "pointer-group-interface.hh"
12 #include "rhythmic-head.hh"
13 #include "side-position-interface.hh"
14 #include "staff-symbol-referencer.hh"
21 Create line-spanner grobs for lines that connect note heads.
23 TODO: have the line commit suicide if the notes are connected with
26 class Note_head_line_engraver : public Engraver
29 TRANSLATOR_DECLARATIONS (Note_head_line_engraver);
32 DECLARE_ACKNOWLEDGER (rhythmic_head);
33 void process_acknowledged ();
34 void stop_translation_timestep ();
44 Note_head_line_engraver::Note_head_line_engraver ()
54 Note_head_line_engraver::acknowledge_rhythmic_head (Grob_info info)
57 Context *tr = context ();
59 while (tr && !tr->is_alias (ly_symbol2scm ("Staff")))
60 tr = tr->get_parent_context ();
63 && tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_
64 && to_boolean (get_property ("followVoice")))
73 Note_head_line_engraver::process_acknowledged ()
75 if (!line_ && follow_ && last_head_ && head_)
77 /* TODO: Don't follow if there's a beam.
79 We can't do beam-stuff here, since beam doesn't exist yet.
80 Should probably store follow_ in line_, and suicide at some
83 line_ = make_spanner ("VoiceFollower", head_->self_scm ());
85 line_->set_bound (LEFT, last_head_);
86 line_->set_bound (RIGHT, head_);
93 Note_head_line_engraver::stop_translation_timestep ()
101 #include "translator.icc"
103 ADD_ACKNOWLEDGER (Note_head_line_engraver, rhythmic_head);
104 ADD_TRANSLATOR (Note_head_line_engraver,
106 "Engrave a line between two note heads, for example a"
107 " glissando. If @code{followVoice} is set, staff switches"
108 " also generate a line.",