(c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "engraver.hh"
+
#include <cctype>
#include "rhythmic-head.hh"
#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
{
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 ()
{
for (int i = 0; i < note_evs_.size (); i++)
{
-
Music *ev = note_evs_[i];
Item *note = make_item ("NoteHead", ev->self_scm ());
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))
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 */ "");