2 arpeggio-engraver.cc -- implement Arpeggio_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "group-interface.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
*);
35 Arpeggio_engraver::Arpeggio_engraver ()
42 Arpeggio_engraver::try_music (Music
* m
)
52 Arpeggio_engraver::acknowledge_grob (Grob_info info
)
56 if (Stem::has_interface (info
.grob_
))
58 if (!arpeggio_
->get_parent (Y_AXIS
))
59 arpeggio_
->set_parent (info
.grob_
, Y_AXIS
);
61 Pointer_group_interface::add_grob (arpeggio_
, ly_symbol2scm ("stems"), info
.grob_
);
65 We can't catch local key items (accidentals) from Voice context,
66 see Local_key_engraver
68 else if (Rhythmic_head::has_interface (info
.grob_
))
70 Side_position_interface::add_support (arpeggio_
, info
.grob_
);
72 else if (Note_column::has_interface (info
.grob_
))
74 info
.grob_
->set_grob_property ("arpeggio", arpeggio_
->self_scm ());
80 Arpeggio_engraver::process_music ()
84 arpeggio_
= new Item (get_property ("Arpeggio"));
85 announce_grob(arpeggio_
, arpeggio_req_
->self_scm());
90 Arpeggio_engraver::stop_translation_timestep ()
94 typeset_grob (arpeggio_
);
103 ENTER_DESCRIPTION(Arpeggio_engraver
,
104 /* descr */ "Generate an Arpeggio from a Arpeggio_req",
105 /* creats*/ "Arpeggio",
106 /* accepts */ "arpeggio-event",
107 /* acks */ "stem-interface rhythmic-head-interface note-column-interface",