From 4b9863119bb26495f2934e71ef5ae5c48ab5bb60 Mon Sep 17 00:00:00 2001 From: hanwen Date: Sat, 18 Sep 2004 08:36:31 +0000 Subject: [PATCH] (recent_enough): interpret laziness = #t. This fixes no-reset accidental-style. --- lily/accidental-engraver.cc | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 3380a6ee0d..e6197418c5 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -165,6 +165,13 @@ extract_alteration (SCM alteration_def) return 0; } +bool +is_tied (SCM alteration_def) +{ + return (alteration_def == SCM_BOOL_T) + || (ly_c_pair_p (alteration_def) && ly_car (alteration_def) == SCM_BOOL_T); +} + static int number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch, int bar_number, SCM laziness, bool ignore_octave) @@ -204,17 +211,23 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch, previous_alteration = from_key_signature; } - /* UGH. prev_acc can be #t in case of ties. What is this for? */ - - int prev = extract_alteration (previous_alteration); - int alter = pitch->get_alteration (); int num = 1; - if (alter == prev) - num = 0; - else if ((abs (alter) < abs (prev) || prev*alter < 0) && alter != 0) - num = 2; - - *different = (alter != prev); + if (is_tied (previous_alteration)) + { + num = 1; + *different = true; + } + else + { + int prev = extract_alteration (previous_alteration); + int alter = pitch->get_alteration (); + + if (alter == prev) + num = 0; + else if ((abs (alter) < abs (prev) || prev*alter < 0) && alter != 0) + num = 2; + *different = (alter != prev); + } return num; } -- 2.39.5