From: Han-Wen Nienhuys Date: Sat, 11 Oct 2003 15:11:51 +0000 (+0000) Subject: * lily/note-performer.cc (try_music): accept busy-playing-event. X-Git-Tag: release/2.1.0~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7ddea59edacbfab0885147c675ac354f31aededb;p=lilypond.git * lily/note-performer.cc (try_music): accept busy-playing-event. * lily/swallow-perf.cc (try_music): return false for busy-playing-event and melisma-playing-event. --- diff --git a/ChangeLog b/ChangeLog index 4d590b4dd3..632cf45964 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-10-11 Han-Wen Nienhuys + + * lily/note-performer.cc (try_music): accept busy-playing-event. + + * lily/swallow-perf.cc (try_music): return false for + busy-playing-event and melisma-playing-event. + 2003-10-09 Han-Wen Nienhuys * scripts/etf2ly.py: Patch by Arvid Grotting for minor keys and << diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 99d172f8ea..eb950c42c7 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -14,21 +14,21 @@ #include "warn.hh" /** -Convert reqs to audio notes. +Convert evs to audio notes. */ class Note_performer : public Performer { public: TRANSLATOR_DECLARATIONS(Note_performer); protected: - virtual bool try_music (Music *req) ; + virtual bool try_music (Music *ev) ; virtual void stop_translation_timestep (); virtual void create_audio_elements (); Global_translator* get_global_translator (); private: - Link_array note_reqs_; + Link_array note_evs_; Link_array notes_; Link_array delayeds_; }; @@ -36,7 +36,7 @@ private: void Note_performer::create_audio_elements () { - if (note_reqs_.size ()) + if (note_evs_.size ()) { int transposing_i = 0; //urg @@ -44,16 +44,16 @@ Note_performer::create_audio_elements () if (gh_number_p (prop)) transposing_i = gh_scm2int (prop); - while (note_reqs_.size ()) + while (note_evs_.size ()) { - Music* n = note_reqs_.pop (); + Music* n = note_evs_.pop (); Pitch pit = * unsmob_pitch (n->get_mus_property ("pitch")); Audio_note* p = new Audio_note (pit, n->get_length (), transposing_i); Audio_element_info info (p, n); announce_element (info); notes_.push (p); } - note_reqs_.clear (); + note_evs_.clear (); } } @@ -100,7 +100,7 @@ Note_performer::stop_translation_timestep () play_element (notes_[i]); } notes_.clear (); - note_reqs_.clear (); + note_evs_.clear (); for (int i=0; i < delayeds_.size (); i++) { Audio_note* n = delayeds_[i]; @@ -115,17 +115,21 @@ Note_performer::stop_translation_timestep () } bool -Note_performer::try_music (Music* req) +Note_performer::try_music (Music* ev) { - if (req->is_mus_type ("note-event")) + if (ev->is_mus_type ("note-event")) { - note_reqs_.push (req); + note_evs_.push (ev); return true; } + else if (ev->is_mus_type ("busy-playing-event")) + return note_evs_.size (); + return false; } -ENTER_DESCRIPTION(Note_performer,"","","note-event","","",""); +ENTER_DESCRIPTION(Note_performer,"","", + "note-event busy-playing-event","","",""); Note_performer::Note_performer() { diff --git a/lily/swallow-perf.cc b/lily/swallow-perf.cc index f30476092a..21078a0da4 100644 --- a/lily/swallow-perf.cc +++ b/lily/swallow-perf.cc @@ -13,9 +13,19 @@ class Swallow_performer : public Performer public: TRANSLATOR_DECLARATIONS(Swallow_performer); protected: - virtual bool try_music (Music*) { return true; } + virtual bool try_music (Music*); }; +bool +Swallow_performer::try_music (Music *m) +{ + if (m->is_mus_type ("busy-playing-event") + || m->is_mus_type ("melisma-playing-event")) + return false; + else + return true; +} + Swallow_performer::Swallow_performer() {}