2 note-name-engraver.cc -- implement Note_name_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
11 #include "musical-request.hh"
12 #include "text-item.hh"
14 class Note_name_engraver
: public Engraver
17 VIRTUAL_COPY_CONS(Translator
);
18 Link_array
<Note_req
> req_l_arr_
;
19 Link_array
<Text_item
> texts_
;
20 virtual bool do_try_music (Music
*m
);
21 virtual void do_process_requests ();
22 virtual void do_pre_move_processing ();
26 Note_name_engraver::do_try_music (Music
*m
)
28 if (Note_req
*r
= dynamic_cast<Note_req
* > (m
))
38 Note_name_engraver::do_process_requests ()
41 for (int i
=0; i
< req_l_arr_
.size (); i
++)
45 s
+= req_l_arr_
[i
]->pitch_
.str ();
49 Text_item
* t
= new Text_item
;
50 t
->set_elt_property ("text", ly_str02scm ( s
.ch_C()));
51 announce_element (Score_element_info (t
, req_l_arr_
[0]));
57 Note_name_engraver::do_pre_move_processing ()
59 for (int i
=0; i
< texts_
.size (); i
++)
61 typeset_element (texts_
[i
]);
67 ADD_THIS_TRANSLATOR(Note_name_engraver
);