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", events_[0]->self_scm () );
55 t->set_property ("text", scm_makfrom0str (s.to_str0 ()));
61 Note_name_engraver::stop_translation_timestep ()
68 Note_name_engraver::Note_name_engraver ()
72 ENTER_DESCRIPTION (Note_name_engraver,
74 /* creats*/ "NoteName",
75 /* accepts */ "note-event",
77 /* reads */ "printOctaveNames",