]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/key-engraver.cc
(internal_print): only call
[lilypond.git] / lily / key-engraver.cc
index 3f5d722c0ba0282222a4b3e6646bdc8456ffe60f..c1a973f4a0eb7d6e2eb66cdc572c6370c10c044f 100644 (file)
@@ -13,6 +13,7 @@
 #include "engraver.hh"
 #include "protected-scm.hh"
 #include "clef.hh"
+#include "pitch.hh"
 
 /*
   TODO: The representation  of key sigs is all fucked.
@@ -36,9 +37,8 @@ protected:
   virtual void initialize ();
   virtual void finalize ();
   virtual bool try_music (Music *ev);
-  virtual void stop_translation_timestep ();
-  virtual void start_translation_timestep ();
-  virtual void process_music ();
+  PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
+  PRECOMPUTED_VIRTUAL void process_music ();
   virtual void acknowledge_grob (Grob_info);
 };
 
@@ -73,7 +73,6 @@ Key_engraver::create_key (bool def)
          cancellation_->set_property ("old-accidentals", last);
          cancellation_->set_property ("c0-position",
                                       get_property ("middleCPosition"));
-
        }
       item_->set_property ("new-accidentals", key);
     }
@@ -81,7 +80,7 @@ Key_engraver::create_key (bool def)
   if (!def)
     {
       SCM vis = get_property ("explicitKeySignatureVisibility");
-      if (ly_c_procedure_p (vis))
+      if (ly_is_procedure (vis))
        item_->set_property ("break-visibility", vis);
     }
 }
@@ -105,7 +104,7 @@ Key_engraver::try_music (Music *ev)
 void
 Key_engraver::acknowledge_grob (Grob_info info)
 {
-  if (Clef::has_interface (info.grob_))
+  if (Clef::has_interface (info.grob ()))
     {
       SCM c = get_property ("createKeyOnClefChange");
       if (to_boolean (c))
@@ -113,7 +112,7 @@ Key_engraver::acknowledge_grob (Grob_info info)
          create_key (false);
        }
     }
-  else if (Bar_line::has_interface (info.grob_)
+  else if (Bar_line::has_interface (info.grob ())
           && scm_is_pair (get_property ("keySignature")))
     {
       create_key (true);
@@ -134,6 +133,7 @@ Key_engraver::stop_translation_timestep ()
   item_ = 0;
   context ()->set_property ("lastKeySignature", get_property ("keySignature"));
   cancellation_ = 0;
+  key_ev_ = 0;
 }
 
 void
@@ -164,12 +164,6 @@ Key_engraver::read_ev (Music const *r)
                            r->get_property ("tonic"));
 }
 
-void
-Key_engraver::start_translation_timestep ()
-{
-  key_ev_ = 0;
-}
-
 void
 Key_engraver::initialize ()
 {
@@ -178,9 +172,10 @@ Key_engraver::initialize ()
 
   Pitch p (0, 0, 0);
   context ()->set_property ("tonic", p.smobbed_copy ());
-
 }
 
+#include "translator.icc"
+
 ADD_TRANSLATOR (Key_engraver,
                /* descr */ "",
                /* creats*/ "KeySignature",