]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-heads-engraver.cc
(DECLARE_BASE_SMOBS): add methods
[lilypond.git] / lily / note-heads-engraver.cc
index 4d4ddd8010b77fd316c00f5bdabf9af8c1668637..02dc7d02923c68e58aecc8879db2543018f9703f 100644 (file)
@@ -4,6 +4,8 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "engraver.hh"
+
 #include <cctype>
 
 #include "rhythmic-head.hh"
@@ -12,8 +14,8 @@
 #include "dot-column.hh"
 #include "staff-symbol-referencer.hh"
 #include "item.hh"
-#include "engraver.hh"
 #include "warn.hh"
+#include "duration.hh"
 
 class Note_heads_engraver : public Engraver
 {
@@ -26,9 +28,8 @@ public:
 
 protected:
   virtual bool try_music (Music *ev);
-  virtual void process_music ();
-
-  virtual void stop_translation_timestep ();
+  PRECOMPUTED_VIRTUAL void process_music ();
+  PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
 };
 
 Note_heads_engraver::Note_heads_engraver ()
@@ -54,7 +55,6 @@ Note_heads_engraver::process_music ()
 {
   for (int i = 0; i < note_evs_.size (); i++)
     {
-
       Music *ev = note_evs_[i];
       Item *note = make_item ("NoteHead", ev->self_scm ());
 
@@ -77,6 +77,16 @@ Note_heads_engraver::process_music ()
 
       Pitch *pit = unsmob_pitch (ev->get_property ("pitch"));
 
+#if 0
+      /*
+       TODO: should have a mechanism to switch off these warnings.
+       */
+      if (!pit)
+       {
+         ev->origin ()->warning (_ ("NoteEvent without pitch"));
+       }
+#endif
+      
       int pos = pit ? pit->steps () : 0;
       SCM c0 = get_property ("middleCPosition");
       if (scm_is_number (c0))
@@ -121,10 +131,11 @@ Note_heads_engraver::stop_translation_timestep ()
   note_evs_.clear ();
 }
 
+#include "translator.icc"
+
 ADD_TRANSLATOR (Note_heads_engraver,
                /* descr */ "Generate noteheads.",
                /* creats*/ "NoteHead Dots",
                /* accepts */ "note-event busy-playing-event",
-               /* acks  */ "",
                /* reads */ "middleCPosition",
                /* write */ "");