2 arpeggio-engraver.cc -- implement Arpeggio_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "group-interface.hh"
11 #include "arpeggio.hh"
13 #include "rhythmic-head.hh"
14 #include "side-position-interface.hh"
15 #include "note-column.hh"
17 class Arpeggio_engraver : public Engraver
20 TRANSLATOR_DECLARATIONS (Arpeggio_engraver);
22 virtual void acknowledge_grob (Grob_info);
23 virtual void process_music ();
25 virtual void stop_translation_timestep ();
26 virtual bool try_music (Music *);
33 Arpeggio_engraver::Arpeggio_engraver ()
40 Arpeggio_engraver::try_music (Music* m)
50 Arpeggio_engraver::acknowledge_grob (Grob_info info)
54 if (Stem::has_interface (info.grob_))
56 if (!arpeggio_->get_parent (Y_AXIS))
57 arpeggio_->set_parent (info.grob_, Y_AXIS);
59 Pointer_group_interface::add_grob (arpeggio_, ly_symbol2scm ("stems"), info.grob_);
63 We can't catch local key items (accidentals) from Voice context,
64 see Local_key_engraver
66 else if (Rhythmic_head::has_interface (info.grob_))
68 Side_position_interface::add_support (arpeggio_, info.grob_);
70 else if (Note_column::has_interface (info.grob_ ))
72 info.grob_->set_property ("arpeggio", arpeggio_->self_scm ());
78 Arpeggio_engraver::process_music ()
82 arpeggio_ = make_item ("Arpeggio",arpeggio_req_->self_scm ());
87 Arpeggio_engraver::stop_translation_timestep ()
96 ADD_TRANSLATOR (Arpeggio_engraver,
97 /* descr */ "Generate an Arpeggio from a Arpeggio_req",
98 /* creats*/ "Arpeggio",
99 /* accepts */ "arpeggio-event",
100 /* acks */ "stem-interface rhythmic-head-interface note-column-interface",