2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2010 Carl D. Sorensen
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
23 #include "engraver.hh"
30 #include "translator.icc"
33 Change tab-note-head properties for a note_head at the right end of a tie
35 class Tab_tie_follow_engraver : public Engraver
38 vector<Grob*> note_heads_;
41 TRANSLATOR_DECLARATIONS (Tab_tie_follow_engraver);
44 DECLARE_ACKNOWLEDGER (tie);
45 DECLARE_ACKNOWLEDGER (tab_note_head);
46 void process_acknowledged ();
48 void stop_translation_timestep ();
51 Tab_tie_follow_engraver::Tab_tie_follow_engraver ()
56 Tab_tie_follow_engraver::acknowledge_tie (Grob_info info)
58 ties_.push_back (info.grob ());
62 Tab_tie_follow_engraver::acknowledge_tab_note_head (Grob_info info)
64 note_heads_.push_back (info.grob ());
68 Tab_tie_follow_engraver::process_acknowledged ()
70 if (ties_.size () && note_heads_.size ())
72 SCM proc = ly_lily_module_constant ("ly:spanner-bound");
73 for (vsize i = 0; i < ties_.size (); i++)
75 SCM right_bound = scm_call_2 (proc,
76 ties_[i]->self_scm (),
77 scm_from_int (RIGHT));
79 for (vsize k = 0; k < note_heads_.size (); k++)
80 if (right_bound == note_heads_[k]->self_scm ())
81 note_heads_[k]->set_property ("tie-follow", SCM_BOOL_T);
87 Tab_tie_follow_engraver::stop_translation_timestep ()
93 ADD_ACKNOWLEDGER (Tab_tie_follow_engraver, tie);
94 ADD_ACKNOWLEDGER (Tab_tie_follow_engraver, tab_note_head);
96 ADD_TRANSLATOR (Tab_tie_follow_engraver,
98 "Adjust TabNoteHead properties when a tie is followed"
99 " by a slur or glissando.",