2 note-name-engraver.cc -- implement Note_name_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
12 class Note_name_engraver : public Engraver
15 TRANSLATOR_DECLARATIONS (Note_name_engraver);
17 Link_array<Music> events_;
18 Link_array<Item> texts_;
19 virtual bool try_music (Music *m);
20 void process_music ();
21 void stop_translation_timestep ();
25 Note_name_engraver::try_music (Music *m)
27 if (m->is_mus_type ("note-event"))
29 events_.push_back (m);
36 Note_name_engraver::process_music ()
39 for (vsize i = 0; i < events_.size (); i++)
43 Pitch p = *unsmob_pitch (events_[i]->get_property ("pitch"));
45 if (!to_boolean (get_property ("printOctaveNames")))
46 p = Pitch (-1, p.get_notename (), p.get_alteration ());
52 Item *t = make_item ("NoteName", events_[0]->self_scm ());
53 t->set_property ("text", scm_makfrom0str (s.c_str ()));
59 Note_name_engraver::stop_translation_timestep ()
65 Note_name_engraver::Note_name_engraver ()
69 #include "translator.icc"
71 ADD_TRANSLATOR (Note_name_engraver,
73 /* create */ "NoteName",
74 /* accept */ "note-event",
75 /* read */ "printOctaveNames",