#include "international.hh"
#include "note-column.hh"
#include "side-position-interface.hh"
-#include "stream-event.hh"
-
-#include "translator.icc"
class Text_spanner_engraver : public Engraver
{
protected:
virtual void finalize ();
DECLARE_ACKNOWLEDGER (note_column);
- DECLARE_TRANSLATOR_LISTENER (text_span);
+ virtual bool try_music (Music *);
void stop_translation_timestep ();
void process_music ();
private:
Spanner *span_;
Spanner *finished_;
- Stream_event *current_event_;
- Drul_array<Stream_event *> event_drul_;
+ Music *current_event_;
+ Drul_array<Music *> event_drul_;
void typeset_all ();
};
event_drul_[STOP] = 0;
}
-IMPLEMENT_TRANSLATOR_LISTENER (Text_spanner_engraver, text_span);
-void
-Text_spanner_engraver::listen_text_span (Stream_event *ev)
+bool
+Text_spanner_engraver::try_music (Music *m)
{
- Direction d = to_dir (ev->get_property ("span-direction"));
- event_drul_[d] = ev;
+ if (m->is_mus_type ("text-span-event"))
+ {
+ Direction d = to_dir (m->get_property ("span-direction"));
+ event_drul_[d] = m;
+ return true;
+ }
+
+ return false;
}
void
}
}
+#include "translator.icc"
ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column);
ADD_TRANSLATOR (Text_spanner_engraver,
/* doc */ "Create text spanner from a Music.",