#include "note-column.hh"
#include "slur.hh"
#include "spanner.hh"
+#include "stream-event.hh"
#include "warn.hh"
+#include "translator.icc"
+
/*
It is possible that a slur starts and ends on the same note. At
least, it is for phrasing slurs: a note can be both beginning and
*/
class Slur_engraver : public Engraver
{
- Drul_array<Music *> events_;
- Music *running_slur_start_;
+ Drul_array<Stream_event *> events_;
+ Stream_event *running_slur_start_;
vector<Grob*> slurs_;
vector<Grob*> end_slurs_;
void set_melisma (bool);
protected:
- virtual bool try_music (Music *);
-
+ DECLARE_TRANSLATOR_LISTENER (slur);
DECLARE_ACKNOWLEDGER (accidental);
DECLARE_ACKNOWLEDGER (dynamic_line_spanner);
DECLARE_ACKNOWLEDGER (fingering);
events_[START] = events_[STOP] = 0;
}
-bool
-Slur_engraver::try_music (Music *m)
+IMPLEMENT_TRANSLATOR_LISTENER (Slur_engraver, slur);
+void
+Slur_engraver::listen_slur (Stream_event *ev)
{
- if (m->is_mus_type ("slur-event"))
- {
- Direction d = to_dir (m->get_property ("span-direction"));
- if (d == START)
- {
- events_[START] = m;
- return true;
- }
- else if (d == STOP)
- {
- events_[STOP] = m;
- return true;
- }
- }
- return false;
+ Direction d = to_dir (ev->get_property ("span-direction"));
+ if (d == START)
+ events_[START] = ev;
+ else if (d == STOP)
+ events_[STOP] = ev;
}
void
if (events_[START] && slurs_.empty ())
{
- Music *ev = events_[START];
+ Stream_event *ev = events_[START];
bool double_slurs = to_boolean (get_property ("doubleSlurs"));
events_[START] = events_[STOP] = 0;
}
-#include "translator.icc"
-
ADD_ACKNOWLEDGER (Slur_engraver, accidental);
ADD_ACKNOWLEDGER (Slur_engraver, dynamic_line_spanner);
ADD_ACKNOWLEDGER (Slur_engraver, fingering);