2 sustain-pedal.cc -- implement Sustain_pedal
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "sustain-pedal.hh"
11 #include "side-position-interface.hh"
12 #include "molecule.hh"
14 #include "staff-symbol-referencer.hh"
17 Sustain_pedal::after_line_breaking ()
21 UGH. Should work automatically via offset callback.
23 Side_position_interface i (this);
24 Direction d = i.get_direction ();
28 MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_CALLBACKS(Sustain_pedal);
32 Sustain_pedal::scheme_molecule (SCM smob)
34 Score_element * e = unsmob_element (smob);
37 SCM glyph = e->get_elt_property ("text");
38 if (!gh_string_p (glyph))
39 return mol.create_scheme();
40 String text = ly_scm2string (glyph);
42 for (int i = 0; i < text.length_i (); i++)
44 String idx ("pedal-");
45 if (text.cut_str (i, 3) == "Ped")
51 idx += String (&text.byte_C ()[i], 1);
52 Molecule m = e->lookup_l ()->afm_find (idx);
54 mol.add_at_edge (X_AXIS, RIGHT, m, 0);
57 return mol.create_scheme ();
60 Sustain_pedal ::Sustain_pedal(SCM s )