Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / lily / dots-engraver.cc
blobefe927e0ecdf357b33d6b6dfed95936e5852c4aa
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2006--2011 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"
22 #include "item.hh"
23 #include "rhythmic-head.hh"
24 #include "stream-event.hh"
26 #include "translator.icc"
29 class Dots_engraver : public Engraver
31 DECLARE_ACKNOWLEDGER (rhythmic_head);
32 TRANSLATOR_DECLARATIONS (Dots_engraver);
35 Dots_engraver::Dots_engraver ()
39 void
40 Dots_engraver::acknowledge_rhythmic_head (Grob_info gi)
42 Stream_event *cause = gi.event_cause ();
43 if (!cause)
44 return;
46 Grob *note = gi.grob ();
47 if (unsmob_grob (note->get_object ("dot")))
48 return;
50 Duration *dur = unsmob_duration (cause->get_property ("duration"));
51 if (dur && dur->dot_count ())
53 Item *d = make_item ("Dots", note->self_scm ());
54 Rhythmic_head::set_dots (note, d);
56 d->set_parent (note, Y_AXIS);
61 ADD_ACKNOWLEDGER (Dots_engraver, rhythmic_head);
63 ADD_TRANSLATOR (Dots_engraver,
64 "Create @ref{Dots} objects for"
65 " @ref{rhythmic-head-interface}s.",
67 /* create */
68 "Dots ",
70 /* read */
71 "",
73 /* write */