]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-performer.cc
*** empty log message ***
[lilypond.git] / lily / piano-pedal-performer.cc
index 59ed0a4469bc130154b227ce972d8278ade908d4..66ff9516716714cd0e396717f10c29dae0042f6d 100644 (file)
@@ -3,12 +3,10 @@
 
   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 "audio-item.hh"
 
 /**
@@ -19,12 +17,12 @@ class Piano_pedal_performer : public Performer
   struct Pedal_info
   {
     char const *name_;
-    Span_req* start_req_;
-    Drul_array<Span_req*> req_l_drul_;
+    Music* start_req_;
+    Drul_array<Music*> req_l_drul_;
   };
 
 public:
-  TRANSLATOR_DECLARATIONS(Piano_pedal_performer);
+  TRANSLATOR_DECLARATIONS (Piano_pedal_performer);
   ~Piano_pedal_performer ();
   
 protected:
@@ -107,7 +105,7 @@ Piano_pedal_performer::create_audio_elements ()
 void
 Piano_pedal_performer::stop_translation_timestep ()
 {
-  for (int i=0; i< audios_.size (); i++)
+  for (int i = 0; i< audios_.size (); i++)
     play_element (audios_[i]);
   audios_.clear ();
 }
@@ -125,18 +123,23 @@ Piano_pedal_performer::start_translation_timestep ()
 bool
 Piano_pedal_performer::try_music (Music* r)
 {
 if (Span_req * s = dynamic_cast<Span_req*> (r))
if  (r->is_mus_type ("pedal-event"))
     {
       for (Pedal_info*p = info_alist_; p->name_; p ++)
        {
-         if (scm_equal_p (s->get_mus_property ("span-type"),
-                          scm_makfrom0str (p->name_)) == SCM_BOOL_T)
+         String nm = p->name_ + String ("Event");
+         if (ly_c_equal_p (r->get_property ("name") ,
+                         scm_str2symbol (nm.to_str0())))
            {
-             p->req_l_drul_[s->get_span_dir ()] = s;
+             Direction d = to_dir (r->get_property ("span-direction"));
+             p->req_l_drul_[d] = r;
              return true;
            }
        }
     }
   return false;
 }
-ENTER_DESCRIPTION (Piano_pedal_performer, "","","","","" );
+
+ADD_TRANSLATOR (Piano_pedal_performer, "","",
+                  "pedal-event",
+                  "","","" );