#include "performer.hh"
-#include "audio-item.hh"
+#include "music.hh"
#include "context.hh"
+#include "audio-item.hh"
#include "pqueue.hh"
-#include "stream-event.hh"
-#include "translator.icc"
class Tie_performer : public Performer
{
- Stream_event *event_;
- Stream_event *last_event_;
+ Music *event_;
+ Music *last_event_;
vector<Audio_element_info> now_heads_;
vector<Audio_element_info> heads_to_tie_;
void stop_translation_timestep ();
void start_translation_timestep ();
virtual void acknowledge_audio_element (Audio_element_info);
+ virtual bool try_music (Music *);
void process_music ();
- DECLARE_TRANSLATOR_LISTENER (tie);
public:
TRANSLATOR_DECLARATIONS (Tie_performer);
};
ties_created_ = false;
}
-IMPLEMENT_TRANSLATOR_LISTENER (Tie_performer, tie);
-void
-Tie_performer::listen_tie (Stream_event *ev)
+bool
+Tie_performer::try_music (Music *mus)
{
- event_ = ev;
+ if (mus->is_mus_type ("tie-event"))
+ event_ = mus;
+
+ return true;
}
void
now_heads_.push_back (inf);
for (vsize i = heads_to_tie_.size (); i--;)
{
- Stream_event *right_mus = inf.event_;
+ Music *right_mus = inf.event_;
Audio_note *th = dynamic_cast<Audio_note *> (heads_to_tie_[i].elem_);
- Stream_event *left_mus = heads_to_tie_[i].event_;
+ Music *left_mus = heads_to_tie_[i].event_;
if (right_mus && left_mus
&& ly_is_equal (right_mus->get_property ("pitch"),
now_heads_.clear ();
}
+#include "translator.icc"
+
ADD_TRANSLATOR (Tie_performer,
/* doc */ "Generate ties between noteheads of equal pitch.",
/* create */ "",