2 arpeggio-engraver.cc -- implement Arpeggio_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2009 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"
20 #include "translator.icc"
22 class Arpeggio_engraver
: public Engraver
25 TRANSLATOR_DECLARATIONS (Arpeggio_engraver
);
27 void acknowledge_stem (Grob_info
);
28 void acknowledge_rhythmic_head (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
)
47 ASSIGN_EVENT_ONCE (arpeggio_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::process_music ()
80 arpeggio_
= make_item ("Arpeggio", arpeggio_event_
->self_scm ());
85 Arpeggio_engraver::stop_translation_timestep ()
91 ADD_ACKNOWLEDGER (Arpeggio_engraver
, stem
);
92 ADD_ACKNOWLEDGER (Arpeggio_engraver
, rhythmic_head
);
94 ADD_TRANSLATOR (Arpeggio_engraver
,
96 "Generate an Arpeggio symbol.",