2 span-arpeggio.cc -- implement Span_arpeggio
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "axis-group-interface.hh"
10 #include "molecule.hh"
11 #include "paper-def.hh"
13 #include "arpeggio.hh"
14 #include "span-arpeggio.hh"
15 #include "score-element.hh"
17 #include "staff-symbol-referencer.hh"
20 Span_arpeggio::has_interface (Score_element* me)
22 return me && me->has_interface (ly_symbol2scm ("span-arpeggio-interface"));
26 We could collapse this with Arpeggio::brew_molecule, but that requires
27 hairy scm callback hacking.
29 MAKE_SCHEME_CALLBACK (Span_arpeggio, brew_molecule, 1);
31 Span_arpeggio::brew_molecule (SCM smob)
33 Score_element *me = unsmob_element (smob);
36 Score_element *common = me;
37 for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s))
39 Score_element *arpeggio = unsmob_element (gh_car (s));
40 common = arpeggio->common_refpoint (common, Y_AXIS);
42 // Hmm, nothing in common?
44 for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s))
46 Score_element *arpeggio = unsmob_element (gh_car (s));
47 Real c = common->relative_coordinate (arpeggio, Y_AXIS);
48 //iv.unite (Arpeggio::head_positions (stem));
49 iv.unite (Interval (c, c));
52 iv = Interval (-23, 5);
55 Molecule dot = me->paper_l ()->lookup_l (0)->afm_find ("dots-dot");
56 Real half_space = Staff_symbol_referencer::staff_space (me) / 2;
57 for (Real i = iv[MIN]; i < iv[MAX]; i++)
60 d.translate_axis (i * half_space, Y_AXIS);
63 mol.translate (Offset (-6, 0));
65 return mol.create_scheme ();