]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/time-signature-engraver.cc
*** empty log message ***
[lilypond.git] / lily / time-signature-engraver.cc
index 60c9a63411d1671618ce9be588a97ff06ae62f4b..77fd444f129f399ab70f0277491f6811668341e8 100644 (file)
@@ -3,19 +3,17 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "time-signature.hh"
 #include "warn.hh"
-
-#include "engraver.hh"
 #include "engraver-group-engraver.hh"
 #include "misc.hh"
 
 /**
-  generate time_signatures. 
-  */
+   generate time_signatures.
+*/
 class Time_signature_engraver : public Engraver
 {
   Item *time_signature_;
@@ -28,9 +26,8 @@ public:
   TRANSLATOR_DECLARATIONS (Time_signature_engraver);
 };
 
-
 Time_signature_engraver::Time_signature_engraver ()
-{ 
+{
   time_signature_ = 0;
   last_time_fraction_ = SCM_BOOL_F;
 }
@@ -44,26 +41,24 @@ Time_signature_engraver::process_music ()
   SCM fr = get_property ("timeSignatureFraction");
   if (!time_signature_
       && last_time_fraction_ != fr
-      && ly_c_pair_p (fr))
+      && scm_is_pair (fr))
     {
-      int den = ly_scm2int (ly_cdr (fr));
+      int den = scm_to_int (scm_cdr (fr));
       if (den != (1 << intlog2 (den)))
        {
          /*
            Todo: should make typecheck?
 
            OTOH, Tristan Keuris writes 8/20 in his Intermezzi.
-          */
-         warning (_f ("Found strange time signature %d/%d.",
-                     den,
-                     ly_scm2int (ly_car (fr))
-                     ));
+         */
+         warning (_f ("strange time signature found: %d/%d",
+                      den,
+                      scm_to_int (scm_car (fr))));
        }
-  
-      
-      last_time_fraction_ = fr; 
-      time_signature_ = make_item ("TimeSignature",SCM_EOL);
-      time_signature_->set_property ("fraction",fr);
+
+      last_time_fraction_ = fr;
+      time_signature_ = make_item ("TimeSignature", SCM_EOL);
+      time_signature_->set_property ("fraction", fr);
     }
 }
 
@@ -72,12 +67,11 @@ Time_signature_engraver::stop_translation_timestep ()
 {
   time_signature_ = 0;
 }
 
-ENTER_DESCRIPTION (Time_signature_engraver,
-/* descr */       "Create a TimeSignature whenever @code{timeSignatureFraction} changes",
-/* creats*/       "TimeSignature",
-/* accepts */     "",
-/* acks  */      "",
-/* reads */       "",
-/* write */       "");
+ADD_TRANSLATOR (Time_signature_engraver,
+               /* descr */ "Create a TimeSignature whenever @code{timeSignatureFraction} changes",
+               /* creats*/ "TimeSignature",
+               /* accepts */ "",
+               /* acks  */ "",
+               /* reads */ "",
+               /* write */ "");