From 92ae3c64da38e2136f9d146429ca8c1b04c1ab91 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 5 Aug 2005 11:28:29 +0000 Subject: [PATCH] * lily/key-signature-interface.cc: change property name to alteration-alist * lily/key-engraver.cc (read_event): read keyAlterationOrder, not keyAccidentalOrder * python/convertrules.py (conv): keyAccidentalOrder -> keyAlterationOrder * lily/key-engraver.cc (create_key): always print a cancellation for going to C-major/A-minor, regardless of printKeyCancellation. (create_key): remove typecheck for visibility. This fixes key signature not being printed. --- ChangeLog | 9 +++++++++ lily/key-engraver.cc | 8 ++++---- lily/key-signature-interface.cc | 4 ++-- python/convertrules.py | 7 +++++++ scm/define-grob-properties.scm | 9 +++------ 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac885b1399..b9b5f86a01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2005-08-05 Han-Wen Nienhuys + * lily/key-signature-interface.cc: change property name to + alteration-alist + + * lily/key-engraver.cc (read_event): read keyAlterationOrder, not + keyAccidentalOrder + + * python/convertrules.py (conv): keyAccidentalOrder -> + keyAlterationOrder + * lily/key-engraver.cc (create_key): always print a cancellation for going to C-major/A-minor, regardless of printKeyCancellation. (create_key): remove typecheck for visibility. This fixes key diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index af402a8307..17735e0d2b 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -92,11 +92,11 @@ Key_engraver::create_key (bool is_default) } } - cancellation_->set_property ("accidentals", restore); + cancellation_->set_property ("alteration-alist", restore); cancellation_->set_property ("c0-position", get_property ("middleCPosition")); } - item_->set_property ("accidentals", key); + item_->set_property ("alteration-alist", key); } if (!is_default) @@ -169,7 +169,7 @@ Key_engraver::read_event (Music const *r) SCM n = scm_list_copy (p); SCM accs = SCM_EOL; - for (SCM s = get_property ("keyAccidentalOrder"); + for (SCM s = get_property ("keyAlterationOrder"); scm_is_pair (s); s = scm_cdr (s)) { if (scm_is_pair (scm_member (scm_car (s), n))) @@ -208,5 +208,5 @@ ADD_TRANSLATOR (Key_engraver, /* accepts */ "key-change-event", /* reads */ "keySignature printKeyCancellation lastKeySignature " "explicitKeySignatureVisibility createKeyOnClefChange " - "keyAccidentalOrder keySignature", + "keyAlterationOrder keySignature", /* write */ "lastKeySignature tonic keySignature"); diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 6215e03fef..bcaa2594e7 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -101,7 +101,7 @@ Key_signature_interface::print (SCM smob) style = ""; } - SCM newas = me->get_property ("accidentals"); + SCM newas = me->get_property ("alteration-alist"); Stencil mol; SCM c0s = me->get_property ("c0-position"); @@ -157,4 +157,4 @@ Key_signature_interface::print (SCM smob) ADD_INTERFACE (Key_signature_interface, "key-signature-interface", "A group of accidentals, to be printed as signature sign.", - "style c0-position accidentals"); + "style c0-position alteration-alist"); diff --git a/python/convertrules.py b/python/convertrules.py index 746559d26a..796cd0068c 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -2534,6 +2534,13 @@ conversions.append (((2, 7, 2), conv, '''ly:X-moment -> ly:moment-X''')) +def conv (str): + str = re.sub('keyAccidentalOrder', 'keyAlterationOrder', str) + return str + +conversions.append (((2, 7, 4), conv, + '''keyAccidentalOrder->keyAlterationOrder''')) + ################################################################ diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 2ca7f0007a..5a285980b6 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -35,7 +35,9 @@ called first. The functions take a grob and axis argument. ") (Y-extent-callback ,procedure? "see @code{X-extent-callback}.") (Y-offset-callbacks ,list? "see @code{X-offset-callbacks}.") - (accidentals ,list? "List of alteration numbers.") + (accidentals ,list? "List of alteration numbers") + (alteration-alist ,list? "List of @code{(@var{pitch} +. @var{accidental})} pairs for key signature.") (add-stem-support ,boolean? "If set, the Stem object is included in this script's support") (align-dir ,ly:dir? "Which side to align? @code{-1}: left side, @@ -336,8 +338,6 @@ center of the staff.") (neutral-position ,number? "Position (in half staff spaces) where to flip the direction of custos stem.") - (new-accidentals ,list? "List of @code{(@var{pitch} -. @var{accidental})} pairs.") (next ,ly:grob? "Object that is next relation (eg. the lyric syllable following an extender.") (note-names ,vector? "Vector of strings containing names for easy-notation note heads.") @@ -349,9 +349,6 @@ get stems extending to the middle staff line.") (number-type ,symbol? "Type of numbers to use in label. Choices include @code{roman-lower}, @code{roman-upper}, and @code{arabic}.") - (old-accidentals ,list? "List of @code{(@var{pitch} . @var{accidental}) -pairs.}") - (padding ,ly:dimension? "Add this much extra space between objects that are next to each other.") (page-penalty ,number? "Penalty for page break at -- 2.39.2