CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/08/05 11:20:50

Modified files:
        .              : ChangeLog 
        input/regression: key-signature-cancellation.ly 
        lily           : key-engraver.cc 

Log message:
        (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.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3962&tr2=1.3963&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/key-signature-cancellation.ly.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/key-engraver.cc.diff?tr1=1.119&tr2=1.120&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3962 lilypond/ChangeLog:1.3963
--- lilypond/ChangeLog:1.3962   Fri Aug  5 10:42:22 2005
+++ lilypond/ChangeLog  Fri Aug  5 11:20:49 2005
@@ -1,5 +1,10 @@
 2005-08-05  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * 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.
+
        * lily/spacing-determine-loose-columns.cc: new file.
 
        * input/regression/spacing-strict-notespacing.ly: new file.
Index: lilypond/input/regression/key-signature-cancellation.ly
diff -u lilypond/input/regression/key-signature-cancellation.ly:1.8 
lilypond/input/regression/key-signature-cancellation.ly:1.9
--- lilypond/input/regression/key-signature-cancellation.ly:1.8 Sun Jun 26 
22:39:14 2005
+++ lilypond/input/regression/key-signature-cancellation.ly     Fri Aug  5 
11:20:50 2005
@@ -1,19 +1,25 @@
-\header { texidoc = "Cancellation signs are printed by default. The
-   spacing of the natural signs depends on their vertical
-   positions. The stems should not clash graphically."
+\header {
+
+  texidoc = "Key cancellation signs consists of naturals for pitches
+  that are not in the new key signature. Naturals get a little padding
+  so the stems don't collide."
 
 }
 
 \version "2.6.0"
 
 \layout {
-    raggedright = ##t
+  raggedright = ##t
 }
 
 {
 
-    \key a \major
-    g'1
-    \key f \minor
-    g'1
+  \key a \major
+  g'1
+  \key f \minor
+  g'1
+  \key cis \major
+  g'1
+  \key c \major
+  g'1
 }
Index: lilypond/lily/key-engraver.cc
diff -u lilypond/lily/key-engraver.cc:1.119 lilypond/lily/key-engraver.cc:1.120
--- lilypond/lily/key-engraver.cc:1.119 Fri Aug  5 10:59:28 2005
+++ lilypond/lily/key-engraver.cc       Fri Aug  5 11:20:50 2005
@@ -44,7 +44,6 @@
 
   DECLARE_ACKNOWLEDGER (clef);
   DECLARE_ACKNOWLEDGER (bar_line);
-  
 };
 
 void
@@ -64,18 +63,36 @@
 {
   if (!item_)
     {
-      item_ = make_item ("KeySignature", key_event_ ? key_event_->self_scm () 
: SCM_EOL);
+      item_ = make_item ("KeySignature",
+                        key_event_ ? key_event_->self_scm () : SCM_EOL);
 
       item_->set_property ("c0-position",
                           get_property ("middleCPosition"));
 
       SCM last = get_property ("lastKeySignature");
       SCM key = get_property ("keySignature");
-      if (to_boolean (get_property ("printKeyCancellation"))
+
+      if ((to_boolean (get_property ("printKeyCancellation"))
+          || key == SCM_EOL)
          && !scm_is_eq (last, key))
        {
-         cancellation_ = make_item ("KeyCancellation", key_event_ ? 
key_event_->self_scm () : SCM_EOL);
-         cancellation_->set_property ("accidentals", last);
+         cancellation_ = make_item ("KeyCancellation",
+                                    key_event_
+                                    ? key_event_->self_scm () : SCM_EOL);
+
+         SCM restore = SCM_EOL;
+         SCM *tail = &restore;
+         for (SCM s = last; scm_is_pair (s); s = scm_cdr (s))
+           {
+             if (scm_assoc (scm_caar (s), key) == SCM_BOOL_F)
+               {
+                 *tail = scm_acons (scm_caar (s),
+                                    scm_from_int (0), *tail);
+                 tail = SCM_CDRLOC(*tail);
+               }
+           }
+         
+         cancellation_->set_property ("accidentals", restore);
          cancellation_->set_property ("c0-position",
                                       get_property ("middleCPosition"));
        }
@@ -189,5 +206,7 @@
                /* descr */ "",
                /* creats*/ "KeySignature",
                /* accepts */ "key-change-event",
-               /* reads */ "keySignature printKeyCancellation lastKeySignature 
explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder 
keySignature",
+               /* reads */ "keySignature printKeyCancellation lastKeySignature 
"
+               "explicitKeySignatureVisibility createKeyOnClefChange "
+               "keyAccidentalOrder keySignature",
                /* write */ "lastKeySignature tonic keySignature");


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to