2 arpeggio-engraver.cc -- implement Arpeggio_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "group-interface.hh"
12 #include "musical-request.hh"
13 #include "arpeggio.hh"
15 #include "rhythmic-head.hh"
16 #include "side-position-interface.hh"
17 #include "note-column.hh"
19 class Arpeggio_engraver : public Engraver
22 TRANSLATOR_DECLARATIONS(Arpeggio_engraver);
24 virtual void acknowledge_grob (Grob_info);
25 virtual void process_music ();
27 virtual void stop_translation_timestep ();
28 virtual bool try_music (Music *);
32 Arpeggio_req *arpeggio_req_;
35 Arpeggio_engraver::Arpeggio_engraver ()
42 Arpeggio_engraver::try_music (Music* m)
46 if (Arpeggio_req *a = dynamic_cast<Arpeggio_req*> (m))
56 Arpeggio_engraver::acknowledge_grob (Grob_info info)
60 if (Stem::has_interface (info.grob_l_))
62 if (!arpeggio_->get_parent (Y_AXIS))
63 arpeggio_->set_parent (info.grob_l_, Y_AXIS);
65 Pointer_group_interface::add_grob (arpeggio_, ly_symbol2scm ("stems"), info.grob_l_);
69 We can't catch local key items (accidentals) from Voice context,
70 see Local_key_engraver
72 else if (Rhythmic_head::has_interface (info.grob_l_))
74 Side_position_interface::add_support (arpeggio_, info.grob_l_);
76 else if (Note_column::has_interface (info.grob_l_ ))
78 info.grob_l_->set_grob_property ("arpeggio", arpeggio_->self_scm ());
84 Arpeggio_engraver::process_music ()
88 arpeggio_ = new Item (get_property ("Arpeggio"));
89 announce_grob(arpeggio_, arpeggio_req_->self_scm());
94 Arpeggio_engraver::stop_translation_timestep ()
98 typeset_grob (arpeggio_);
107 ENTER_DESCRIPTION(Arpeggio_engraver,
108 /* descr */ "Generate an Arpeggio from a Arpeggio_req",
109 /* creats*/ "Arpeggio",
110 /* acks */ "stem-interface rhythmic-head-interface note-column-interface",