]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/note-performer.cc (try_music): accept busy-playing-event.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 11 Oct 2003 15:11:51 +0000 (15:11 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 11 Oct 2003 15:11:51 +0000 (15:11 +0000)
* lily/swallow-perf.cc (try_music): return false for
busy-playing-event and melisma-playing-event.

ChangeLog
lily/note-performer.cc
lily/swallow-perf.cc

index 4d590b4dd34cf2c57e53e7a4e16ca09eabd29e95..632cf4596469e7db20cb721b039c1757f6a458e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-10-11  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * 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  <hanwen@cs.uu.nl>
 
        * scripts/etf2ly.py: Patch by Arvid Grotting for minor keys and <<
index 99d172f8eaf32ecc2b02b00333860d2d396af75a..eb950c42c7d525c6f6cfc50cff89d13af71a7a88 100644 (file)
 #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<Music> note_reqs_;
+  Link_array<Music> note_evs_;
   Link_array<Audio_note> notes_;
   Link_array<Audio_note> 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()
 {
index f30476092a0a25237fbfe04c9b240ca993b28b36..21078a0da4b3933e3d2724d28950152065eb3cd5 100644 (file)
@@ -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()
 {}