2 arpeggio-engraver.cc -- implement Arpeggio_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
11 #include "pointer-group-interface.hh"
12 #include "arpeggio.hh"
14 #include "rhythmic-head.hh"
15 #include "side-position-interface.hh"
16 #include "stream-event.hh"
17 #include "note-column.hh"
19 #include "translator.icc"
21 class Arpeggio_engraver : public Engraver
24 TRANSLATOR_DECLARATIONS (Arpeggio_engraver);
26 void acknowledge_stem (Grob_info);
27 void acknowledge_rhythmic_head (Grob_info);
28 void acknowledge_note_column (Grob_info);
30 void process_music ();
31 void stop_translation_timestep ();
32 DECLARE_TRANSLATOR_LISTENER (arpeggio);
35 Stream_event *arpeggio_event_;
38 Arpeggio_engraver::Arpeggio_engraver ()
44 IMPLEMENT_TRANSLATOR_LISTENER (Arpeggio_engraver, arpeggio);
45 void Arpeggio_engraver::listen_arpeggio (Stream_event *ev)
51 Arpeggio_engraver::acknowledge_stem (Grob_info info)
55 if (!arpeggio_->get_parent (Y_AXIS))
56 arpeggio_->set_parent (info.grob (), Y_AXIS);
58 Pointer_group_interface::add_grob (arpeggio_,
59 ly_symbol2scm ("stems"),
64 Arpeggio_engraver::acknowledge_rhythmic_head (Grob_info info)
69 We can't catch local key items (accidentals) from Voice context,
70 see Local_key_engraver
72 Side_position_interface::add_support (arpeggio_, info.grob ());
76 Arpeggio_engraver::acknowledge_note_column (Grob_info info)
79 info.grob ()->set_object ("arpeggio", arpeggio_->self_scm ());
83 Arpeggio_engraver::process_music ()
87 arpeggio_ = make_item ("Arpeggio", arpeggio_event_->self_scm ());
92 Arpeggio_engraver::stop_translation_timestep ()
98 ADD_ACKNOWLEDGER (Arpeggio_engraver, stem);
99 ADD_ACKNOWLEDGER (Arpeggio_engraver, rhythmic_head);
100 ADD_ACKNOWLEDGER (Arpeggio_engraver, note_column);
102 ADD_TRANSLATOR (Arpeggio_engraver,
103 /* doc */ "Generate an Arpeggio symbol",
104 /* create */ "Arpeggio",
105 /* accept */ "arpeggio-event",