]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/span-dynamic-performer.cc
2003 -> 2004
[lilypond.git] / lily / span-dynamic-performer.cc
index 8f6cfc95e00db8799167306355e8de15b8caa5d5..f5d24e01be44399791e30d5279bd478276cb49c8 100644 (file)
@@ -3,12 +3,12 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  2000 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "event.hh"
 #include "audio-item.hh"
 
 struct Audio_dynamic_tuple
@@ -30,13 +30,12 @@ protected:
   virtual void acknowledge_audio_element (Audio_element_info);
   virtual void process_music ();
   virtual void stop_translation_timestep ();
-  virtual void start_translation_timestep ();
 
 private:
   Audio_dynamic* audio_;
   Real last_volume_;
-  Span_req* span_start_req_;
-  Drul_array<Span_req*> span_req_l_drul_;
+  Music* span_start_req_;
+  Drul_array<Music*> span_req_l_drul_;
   Array<Audio_dynamic_tuple> dynamic_tuples_;
   Array<Audio_dynamic_tuple> finished_dynamic_tuples_;
   Direction dir_;
@@ -161,27 +160,25 @@ Span_dynamic_performer::stop_translation_timestep ()
       play_element (audio_);
       audio_ = 0;
     }
-}
 
-void
-Span_dynamic_performer::start_translation_timestep ()
-{
   span_req_l_drul_[STOP] = 0;
   span_req_l_drul_[START] = 0;
+
 }
 
 bool
 Span_dynamic_performer::try_music (Music* r)
 {
-  if (Span_req * s = dynamic_cast<Span_req*> (r))
+  if (r->is_mus_type ("crescendo-event")
+      || r->is_mus_type ("decrescendo-event"))
     {
-      String t =  ly_scm2string (s->get_mus_property ("span-type"));      
-      if (t == "crescendo" || t == "decrescendo")
-       {
-         span_req_l_drul_[s->get_span_dir ()] = s;
-         return true;
-       }
+      Direction d = to_dir (r->get_mus_property ("span-direction"));
+      span_req_l_drul_[d] = r;
+      return true;
     }
   return false;
 }
-ENTER_DESCRIPTION (Span_dynamic_performer, "","","","","" );
+ENTER_DESCRIPTION (Span_dynamic_performer,
+                  "", "",
+                  "crescendo-event decrescendo-event", 
+                  "", "", "");