]> git.donarmstrong.com Git - lilypond.git/commitdiff
(recent_enough): interpret laziness
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 18 Sep 2004 08:36:31 +0000 (08:36 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 18 Sep 2004 08:36:31 +0000 (08:36 +0000)
= #t. This fixes no-reset accidental-style.

lily/accidental-engraver.cc

index 3380a6ee0d2e89e81e48dfe17765e5ce89a6b831..e6197418c5d1c016d49c4130314198d8e260bd27 100644 (file)
@@ -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;
 }