]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-performer.cc
* lily/horizontal-bracket.cc (make_bracket): new function.
[lilypond.git] / lily / piano-pedal-performer.cc
index 242a181fcd5a24b77978e8b25e3ad90d54b9d992..ea4889f11bbeb1ec3ed6c506d3e407d3a54eaa2e 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "performer.hh"
 #include "audio-item.hh"
+#include "music.hh"
 
 /**
    perform Piano pedals
@@ -17,8 +18,8 @@ class Piano_pedal_performer : public Performer
   struct Pedal_info
   {
     char const *name_;
-    Music *start_req_;
-    Drul_array<Music *> req_drul_;
+    Music *start_event_;
+    Drul_array<Music *> event_drul_;
   };
 
 public:
@@ -28,9 +29,9 @@ public:
 protected:
   virtual void initialize ();
   virtual bool try_music (Music *);
-  virtual void create_audio_elements ();
-  virtual void stop_translation_timestep ();
-  virtual void start_translation_timestep ();
+  void process_music ();
+  void stop_translation_timestep ();
+  void start_translation_timestep ();
 
 private:
   Link_array<Audio_piano_pedal> audios_;
@@ -58,9 +59,9 @@ Piano_pedal_performer::initialize ()
   do
     {
       p->name_ = *np;
-      p->req_drul_[START] = 0;
-      p->req_drul_[STOP] = 0;
-      p->start_req_ = 0;
+      p->event_drul_[START] = 0;
+      p->event_drul_[STOP] = 0;
+      p->start_event_ = 0;
 
       p++;
     }
@@ -68,17 +69,15 @@ Piano_pedal_performer::initialize ()
 }
 
 void
-Piano_pedal_performer::create_audio_elements ()
+Piano_pedal_performer::process_music ()
 {
   for (Pedal_info *p = info_alist_; p && p->name_; p++)
 
     {
-      if (p->req_drul_[STOP])
+      if (p->event_drul_[STOP])
        {
-         if (!p->start_req_)
-           {
-             p->req_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
-           }
+         if (!p->start_event_)
+           p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
          else
            {
              Audio_piano_pedal *a = new Audio_piano_pedal;
@@ -86,19 +85,19 @@ Piano_pedal_performer::create_audio_elements ()
              a->dir_ = STOP;
              audios_.push (a);
            }
-         p->start_req_ = 0;
+         p->start_event_ = 0;
        }
 
-      if (p->req_drul_[START])
+      if (p->event_drul_[START])
        {
-         p->start_req_ = p->req_drul_[START];
+         p->start_event_ = p->event_drul_[START];
          Audio_piano_pedal *a = new Audio_piano_pedal;
          a->type_string_ = String (p->name_);
          a->dir_ = START;
          audios_.push (a);
        }
-      p->req_drul_[START] = 0;
-      p->req_drul_[STOP] = 0;
+      p->event_drul_[START] = 0;
+      p->event_drul_[STOP] = 0;
     }
 }
 
@@ -115,8 +114,8 @@ Piano_pedal_performer::start_translation_timestep ()
 {
   for (Pedal_info *p = info_alist_; p && p->name_; p++)
     {
-      p->req_drul_[STOP] = 0;
-      p->req_drul_[START] = 0;
+      p->event_drul_[STOP] = 0;
+      p->event_drul_[START] = 0;
     }
 }
 
@@ -129,10 +128,10 @@ Piano_pedal_performer::try_music (Music *r)
        {
          String nm = p->name_ + String ("Event");
          if (ly_is_equal (r->get_property ("name"),
-                           scm_str2symbol (nm.to_str0 ())))
+                          scm_str2symbol (nm.to_str0 ())))
            {
              Direction d = to_dir (r->get_property ("span-direction"));
-             p->req_drul_[d] = r;
+             p->event_drul_[d] = r;
              return true;
            }
        }
@@ -140,6 +139,8 @@ Piano_pedal_performer::try_music (Music *r)
   return false;
 }
 
+#include "translator.icc"
+
 ADD_TRANSLATOR (Piano_pedal_performer, "", "",
                "pedal-event",
-               "", "", "");
+               "", "");