source file of the GNU LilyPond music typesetter
- (c) 1996--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
keyplacement by Mats Bengtsson
*/
alteration_pos (SCM what, int alter, int c0p)
{
if (gh_pair_p (what))
- return gh_scm2int (gh_car (what)) * 7 + gh_scm2int (gh_cdr (what)) + c0p;
+ return gh_scm2int (ly_car (what)) * 7 + gh_scm2int (ly_cdr (what)) + c0p;
int p = gh_scm2int (what);
Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
+ SCM scm_style = me->get_grob_property ("style");
+ String style;
+ if (gh_symbol_p (scm_style))
+ {
+ style = ly_scm2string (scm_symbol_to_string (scm_style));
+ }
+ else
+ {
+ style = "";
+ }
+
SCM newas = me->get_grob_property ("new-accidentals");
Molecule mol;
+
+ SCM c0s = me->get_grob_property ("c0-position");
+ int c0p=0;
+ if (gh_number_p (c0s))
+ c0p = gh_scm2int (c0s);
+
/*
SCM lists are stacks, so we work from right to left, ending with
the cancellation signature.
*/
- int c0p = gh_scm2int (me->get_grob_property ("c0-position"));
- for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s))
+
+ for (SCM s = newas; gh_pair_p (s); s = ly_cdr (s))
{
- SCM what = gh_caar (s);
- int alter = gh_scm2int (gh_cdar (s));
+ SCM what = ly_caar (s);
+ int alter = gh_scm2int (ly_cdar (s));
int pos = alteration_pos (what, alter, c0p);
- Molecule m = Font_interface::get_default_font (me)->find_by_name ("accidentals-" + to_str (alter));
+ Molecule m = Font_interface::get_default_font (me)->
+ find_by_name (String ("accidentals-") + style + to_str (alter));
m.translate_axis (pos * inter, Y_AXIS);
mol.add_at_edge (X_AXIS, LEFT, m, 0);
}
Molecule natural;
if (gh_pair_p (old))
- natural=Font_interface::get_default_font (me)->find_by_name ("accidentals-0");
+ natural=Font_interface::get_default_font (me)->
+ find_by_name (String ("accidentals-") + style + String ("0"));
- for (; gh_pair_p (old); old = gh_cdr (old))
+ for (; gh_pair_p (old); old = ly_cdr (old))
{
- SCM found = scm_assoc (gh_caar (old), newas);
+ SCM found = scm_assoc (ly_caar (old), newas);
if (found == SCM_BOOL_F
- || gh_cdr (found) != gh_cdar (old))
+ || ly_cdr (found) != ly_cdar (old))
{
- SCM what = gh_caar (old);
+ SCM what = ly_caar (old);
int alter = 0;
int pos = alteration_pos (what, alter, c0p);
return mol.smobbed_copy ();
}
-
-
-
-
bool
Key_item::has_interface (Grob*m)
{