lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bugfix accidental-engraver


From: Rune Zedeler
Subject: Re: Bugfix accidental-engraver
Date: Mon, 18 Dec 2006 15:19:04 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061117)

Han-Wen Nienhuys wrote:

also, maybe you can document the bit going below, and remove the above.

Okie.
Good thing, actually, in the previous patch I made an unneccesary change. Was unaware that the local key sig was default defined at so many places.
--- ../lilypond-2.11.2/lily/accidental-engraver.cc      2006-12-18 
14:51:27.000000000 +0100
+++ lily/accidental-engraver.cc 2006-12-18 15:16:33.000000000 +0100
@@ -66,7 +66,6 @@
   void acknowledge_finger (Grob_info);
 
   void stop_translation_timestep ();
-  virtual void initialize ();
   void process_acknowledged ();
   virtual void finalize ();
   virtual void derived_mark () const;
@@ -120,21 +119,17 @@
 
   Context *trans = context ()->get_parent_context ();
 
-  /* Huh. Don't understand what this is good for. --hwn.  */
+  /* Reset parent contexts so that e.g. piano-accidentals won't remember old
+     cross-staff accidentals after key-sig-changes */
 
   SCM val;
-  while (trans && trans->where_defined (ly_symbol2scm ("localKeySignature"), 
&val))
+  while (trans && trans->where_defined (ly_symbol2scm ("localKeySignature"), 
&val)==trans)
     {
       trans->set_property ("localKeySignature", ly_deep_copy (last_keysig_));
       trans = trans->get_parent_context ();
     }
 }
 
-void
-Accidental_engraver::initialize ()
-{
-  update_local_key_signature ();
-}
 
 /** Calculate the number of accidentals on basis of the current local key
     sig (passed as argument)
@@ -194,10 +189,14 @@
       SCM entry = scm_car (s);
       if (scm_is_pair (scm_car (entry))
          && scm_cdar (entry) == scm_from_int (n))
-       from_other_octaves = scm_cdr (entry);
+       {
+         from_other_octaves = scm_cdr (entry);
+         break;
+       }
     }
 
-  if (from_same_octave != SCM_BOOL_F
+  if (!ignore_octave
+      && from_same_octave != SCM_BOOL_F
       && recent_enough (bar_number, from_same_octave, laziness))
     previous_alteration = from_same_octave;
   else if (ignore_octave

reply via email to

[Prev in Thread] Current Thread [Next in Thread]