2 note-name-engraver.cc -- implement Note_name_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
11 #include "musical-request.hh"
14 class Note_name_engraver
: public Engraver
17 VIRTUAL_COPY_CONS (Translator
);
18 Link_array
<Note_req
> req_l_arr_
;
19 Link_array
<Item
> texts_
;
20 virtual bool try_music (Music
*m
);
21 virtual void create_grobs ();
22 virtual void stop_translation_timestep ();
26 Note_name_engraver::try_music (Music
*m
)
28 if (Note_req
*r
= dynamic_cast<Note_req
* > (m
))
37 Note_name_engraver::create_grobs ()
42 for (int i
=0; i
< req_l_arr_
.size (); i
++)
46 s
+= unsmob_pitch (req_l_arr_
[i
]->get_mus_property ("pitch"))->str ();
50 Item
* t
= new Item (get_property ("NoteName"));
51 t
->set_grob_property ("text", ly_str02scm (s
.ch_C ()));
52 announce_grob (t
, req_l_arr_
[0]);
58 Note_name_engraver::stop_translation_timestep ()
60 for (int i
=0; i
< texts_
.size (); i
++)
62 typeset_grob (texts_
[i
]);
68 ADD_THIS_TRANSLATOR (Note_name_engraver
);