*** empty log message ***
[lilypond.git] / lily / pitch-squash-engraver.cc
blob870a5a93154ba82ddc0db33b087af1feae9b18a7
1 /*
2 pitch-squash-engraver.cc -- implement Pitch_squash_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8 #include "staff-symbol-referencer.hh"
9 #include "note-head.hh"
10 #include "rhythmic-head.hh"
11 #include "engraver.hh"
13 class Pitch_squash_engraver : public Engraver
15 public:
16 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
17 virtual void acknowledge_grob (Grob_info);
20 void
21 Pitch_squash_engraver::acknowledge_grob (Grob_info i)
23 SCM newpos = get_property ("squashedPosition");
24 if (scm_is_number (newpos)
25 && Note_head::has_interface (i.grob ()))
27 i.grob ()->set_property ("staff-position", newpos);
31 Pitch_squash_engraver::Pitch_squash_engraver ()
35 ADD_TRANSLATOR (Pitch_squash_engraver,
36 /* descr */
37 "Set the vertical position of noteheads to "
38 "@code{squashedPosition}, if that "
39 "property is set. "
40 "This can be used to make a single line staff "
41 "demonstrating the rhythm of a melody.",
43 /* creats*/ "",
44 /* accepts */ "",
45 /* acks */ "note-head-interface",
46 /* reads */ "squashedPosition",
47 /* write */ "");