2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2006--2015 Han-Wen Nienhuys <hanwen@lilypond.org>
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/>.
20 #include "engraver.hh"
21 #include "duration.hh"
23 #include "rhythmic-head.hh"
24 #include "stream-event.hh"
26 #include "translator.icc"
28 class Dots_engraver : public Engraver
30 DECLARE_ACKNOWLEDGER (rhythmic_head);
31 TRANSLATOR_DECLARATIONS (Dots_engraver);
34 Dots_engraver::Dots_engraver ()
39 Dots_engraver::acknowledge_rhythmic_head (Grob_info gi)
41 Stream_event *cause = gi.event_cause ();
45 Grob *note = gi.grob ();
46 if (unsmob<Grob> (note->get_object ("dot")))
49 Duration *dur = unsmob<Duration> (cause->get_property ("duration"));
50 if (dur && dur->dot_count ())
52 Item *d = make_item ("Dots", note->self_scm ());
53 Rhythmic_head::set_dots (note, d);
55 d->set_parent (note, Y_AXIS);
59 ADD_ACKNOWLEDGER (Dots_engraver, rhythmic_head);
61 ADD_TRANSLATOR (Dots_engraver,
62 "Create @ref{Dots} objects for"
63 " @ref{rhythmic-head-interface}s.",