2 note-name-engraver.cc -- implement Note_name_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
11 #include "musical-request.hh"
14 class Note_name_engraver
: public Engraver
17 TRANSLATOR_DECLARATIONS(Note_name_engraver
);
19 Link_array
<Note_req
> reqs_
;
20 Link_array
<Item
> texts_
;
21 virtual bool try_music (Music
*m
);
22 virtual void process_acknowledged_grobs ();
23 virtual void stop_translation_timestep ();
27 Note_name_engraver::try_music (Music
*m
)
29 if (Note_req
*r
= dynamic_cast<Note_req
* > (m
))
38 Note_name_engraver::process_acknowledged_grobs ()
43 for (int i
=0; i
< reqs_
.size (); i
++)
47 s
+= unsmob_pitch (reqs_
[i
]->get_mus_property ("pitch"))->string ();
51 Item
* t
= new Item (get_property ("NoteName"));
52 t
->set_grob_property ("text", scm_makfrom0str (s
.to_str0 ()));
53 announce_grob(t
, reqs_
[0]->self_scm());
59 Note_name_engraver::stop_translation_timestep ()
61 for (int i
=0; i
< texts_
.size (); i
++)
63 typeset_grob (texts_
[i
]);
70 Note_name_engraver::Note_name_engraver()
74 ENTER_DESCRIPTION(Note_name_engraver
,
76 /* creats*/ "NoteName",