]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.35
authorfred <fred>
Sun, 24 Mar 2002 19:33:32 +0000 (19:33 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:33:32 +0000 (19:33 +0000)
input/wohltemperirt.ly
src/localkeyreg.cc

index b5ea0f66542ab07a0ac2764359e8f9f8ee0d5a0e..7d615a4d1bfdeae4f2515eb01d1f5a9f83bf6d98 100644 (file)
@@ -47,7 +47,7 @@ bassdux = music { $
        [G c16 B] [c8 d] [F16 G] As4 [G16 F] | 
 $}
 
-trebstaf =     staff { melodic
+trebstaf = staff { melodic
                % every "music {} " in a staff has its own "voicegroup"
                music { dux }
                music { comes }
@@ -59,8 +59,8 @@ basstaf = staff { melodic
 }
 
 score {
-       staff { basstaf }
        staff { trebstaf }
+       staff { basstaf }
        
        commands {
                meter {4*4}
index 56691097862134684307e99afcf138bead95b24f..3817a36ba21be6d4a66d04dd5a59179b2005f642 100644 (file)
@@ -4,14 +4,18 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "musicalrequest.hh"
+#include "commandrequest.hh"
 #include "localkeyreg.hh"
 #include "localkeyitem.hh"
 #include "complexwalker.hh"
+#include "keyreg.hh"
+#include "debug.hh"
 
 Local_key_register::Local_key_register(Complex_walker*w)
     : Request_register(w)
 {
-    key_item_p_ = 0;    
+    key_item_p_ = 0;
+    key_c_l_ = 0;
 }
 
 void
@@ -43,5 +47,21 @@ Local_key_register::acknowledge_element(Staff_elem_info info)
            local_key_.oct(melodic_l_->octave_i_)
                .set(melodic_l_->notename_i_, melodic_l_->accidental_i_);
        }
+    } else if (info.req_l_->command() &&
+              info.req_l_->command()->keychange()) {
+       Key_register * key_reg_l = (Key_register*)info.origin_reg_l_;
+       key_c_l_ = &key_reg_l->key_;
+       local_key_.reset(*key_c_l_);
+    }  
+}
+
+void
+Local_key_register::process_request()
+{
+    if (!walk_l_->time_.whole_in_measure_) {
+       if (key_c_l_)  
+           local_key_.reset(*key_c_l_);
+       else if( walk_l_->when() >0)
+           warning ("Help me! can't figure  current key", 0);
     }
 }