2 arpegggio.cc -- implement Arpeggio
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "paper-def.hh"
12 #include "arpeggio.hh"
13 #include "score-element.hh"
15 #include "staff-symbol-referencer.hh"
18 Arpeggio::has_interface (Score_element* me)
20 return me && me->has_interface (ly_symbol2scm ("arpeggio-interface"));
23 MAKE_SCHEME_CALLBACK (Arpeggio, brew_molecule, 1);
25 Arpeggio::brew_molecule (SCM smob)
27 Score_element *me = unsmob_element (smob);
30 for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
32 Score_element *stem = unsmob_element (gh_car (s));
33 iv.unite (Stem::head_positions (stem));
37 Molecule dot = me->paper_l ()->lookup_l (0)->afm_find ("dots-dot");
38 Real half_space = Staff_symbol_referencer::staff_space (me) / 2;
39 for (Real i = iv[MIN]; i <= iv[MAX]; i++)
42 d.translate_axis (i * half_space, Y_AXIS);
45 mol.translate (Offset (-3, 0));
47 return mol.create_scheme ();