-/*
- ;; text: list of word
- ;; word: string + optional list of property
- ;; property: align, kern, font (?), size
- */
-Molecule
-Chord_name::ly_text2molecule (Score_element * me, SCM text)
-{
- Molecule mol;
- if (gh_list_p (text))
- {
- while (gh_cdr (text) != SCM_EOL)
- {
- Real x;
- Molecule m = ly_word2molecule (me, gh_car (text), &x);
- if (!m.empty_b ())
- mol.add_at_edge (X_AXIS, RIGHT, m, x);
- text = gh_cdr (text);
- }
- text = gh_car (text);
- }
- Real x;
- Molecule m = ly_word2molecule (me,text, &x);
- if (!m.empty_b ())
- mol.add_at_edge (X_AXIS, RIGHT, m, x);
- return mol;
-}
-
-MAKE_SCHEME_CALLBACK(Chord_name,brew_molecule);
-
-SCM
-Chord_name::brew_molecule (SCM smob)
-{
- Score_element *sc = unsmob_element (smob);
- SCM style = sc->get_elt_property ("style");
-
- if (!gh_string_p (style))
- style = ly_str02scm ("banter");
-
- SCM inversion = sc-> get_elt_property ("inversion");
- if (inversion == SCM_EOL)
- inversion = SCM_BOOL_F;
-
- SCM bass = sc->get_elt_property ("bass");
- if (bass == SCM_EOL)
- bass = SCM_BOOL_F;
-
- SCM pitches = sc->get_elt_property ("pitches");
- SCM text = scm_eval (gh_list (ly_symbol2scm ("chord::user-name"),
- style,
- ly_quote_scm (pitches),
- ly_quote_scm (gh_cons (inversion, bass)),
- SCM_UNDEFINED));
-
- return ly_text2molecule (sc, text).create_scheme ();
-}