Use scalar instead of embedded_scm for context mod overrides.
[lilypond/mpolesky.git] / lily / pitch-squash-engraver.cc
blob764566faab23d9630d4add101d7b3f5f2fa4e658
1 /*
2 pitch-squash-engraver.cc -- implement Pitch_squash_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #include "engraver.hh"
11 #include "staff-symbol-referencer.hh"
12 #include "note-head.hh"
13 #include "rhythmic-head.hh"
14 #include "grob.hh"
16 class Pitch_squash_engraver : public Engraver
18 public:
19 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
20 DECLARE_ACKNOWLEDGER (note_head);
23 void
24 Pitch_squash_engraver::acknowledge_note_head (Grob_info i)
26 SCM newpos = get_property ("squashedPosition");
27 if (scm_is_number (newpos))
28 i.grob ()->set_property ("staff-position", newpos);
31 Pitch_squash_engraver::Pitch_squash_engraver ()
35 #include "translator.icc"
36 ADD_ACKNOWLEDGER (Pitch_squash_engraver, note_head);
37 ADD_TRANSLATOR (Pitch_squash_engraver,
38 /* doc */
39 "Set the vertical position of note heads to"
40 " @code{squashedPosition}, if that property is set. This can"
41 " be used to make a single-line staff demonstrating the"
42 " rhythm of a melody.",
44 /* create */
45 "",
47 /* read */
48 "squashedPosition ",
50 /* write */