2 pitch-squash-grav.cc -- implement Pitch_squash_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "staff-symbol-referencer.hh"
10 #include "note-head.hh"
11 #include "rhythmic-head.hh"
12 #include "engraver.hh"
14 class Pitch_squash_engraver
: public Engraver
{
16 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver
);
17 virtual void acknowledge_grob (Grob_info
);
22 Pitch_squash_engraver::acknowledge_grob (Grob_info i
)
24 SCM newpos
= get_property ("squashedPosition");
25 if (ly_c_number_p (newpos
)
26 && Note_head::has_interface (i
.grob_
))
28 i
.grob_
->set_property ("staff-position", newpos
);
34 Pitch_squash_engraver::Pitch_squash_engraver ()
38 ENTER_DESCRIPTION (Pitch_squash_engraver
,
40 "Set the vertical position of noteheads to "
41 "@code{squashedPosition}, if that "
43 "This can be used to make a single line staff "
44 "demonstrating the rhythm of a melody.",
48 /* acks */ "note-head-interface",
49 /* reads */ "squashedPosition",