Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / lily / pitch-squash-engraver.cc
blob1ad824ee079d24f5e17d1b9f4cb53699f758d426
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
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"
22 #include "staff-symbol-referencer.hh"
23 #include "note-head.hh"
24 #include "rhythmic-head.hh"
25 #include "grob.hh"
27 class Pitch_squash_engraver : public Engraver
29 public:
30 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
31 DECLARE_ACKNOWLEDGER (note_head);
34 void
35 Pitch_squash_engraver::acknowledge_note_head (Grob_info i)
37 SCM newpos = get_property ("squashedPosition");
38 if (scm_is_number (newpos))
39 i.grob ()->set_property ("staff-position", newpos);
42 Pitch_squash_engraver::Pitch_squash_engraver ()
46 #include "translator.icc"
47 ADD_ACKNOWLEDGER (Pitch_squash_engraver, note_head);
48 ADD_TRANSLATOR (Pitch_squash_engraver,
49 /* doc */
50 "Set the vertical position of note heads to"
51 " @code{squashedPosition}, if that property is set. This can"
52 " be used to make a single-line staff demonstrating the"
53 " rhythm of a melody.",
55 /* create */
56 "",
58 /* read */
59 "squashedPosition ",
61 /* write */