2 note-name-engraver.cc -- implement Note_name_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
14 class Note_name_engraver : public Engraver
17 TRANSLATOR_DECLARATIONS (Note_name_engraver);
19 Link_array<Music> events_;
20 Link_array<Item> texts_;
21 virtual bool try_music (Music*m);
22 virtual void process_music ();
23 virtual void stop_translation_timestep ();
27 Note_name_engraver::try_music (Music *m)
29 if (m->is_mus_type ("note-event"))
38 Note_name_engraver::process_music ()
41 for (int i=0; i < events_.size (); i++)
45 Pitch p = *unsmob_pitch (events_[i]->get_property ("pitch"));
47 if (!to_boolean (get_property ("printOctaveNames")))
48 p = Pitch (-1, p.get_notename (), p.get_alteration ());
54 Item * t = make_item ("NoteName");
55 t->set_property ("text", scm_makfrom0str (s.to_str0 ()));
56 announce_grob (t, events_[0]->self_scm ());
62 Note_name_engraver::stop_translation_timestep ()
64 for (int i=0; i < texts_.size (); i++)
66 typeset_grob (texts_[i]);
73 Note_name_engraver::Note_name_engraver ()
77 ENTER_DESCRIPTION (Note_name_engraver,
79 /* creats*/ "NoteName",
80 /* accepts */ "note-event",
82 /* reads */ "printOctaveNames",