]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-performer.cc
''
[lilypond.git] / lily / piano-pedal-performer.cc
index 0617db14f264ddf82f2a70a74519aefcb6eccd50..fd32e92684349e8f3dad98b04b8ce2c5fdecab28 100644 (file)
@@ -10,8 +10,6 @@
 #include "command-request.hh"
 #include "musical-request.hh"
 #include "audio-item.hh"
-#include "dictionary.hh"
-#include "dictionary-iter.hh"
 
 /**
    perform Piano pedals
@@ -26,14 +24,13 @@ class Piano_pedal_performer : public Performer
   };
 
 public:
-  VIRTUAL_COPY_CONS (Translator);
-  Piano_pedal_performer ();
+  TRANSLATOR_DECLARATIONS(Piano_pedal_performer);
   ~Piano_pedal_performer ();
   
 protected:
-  virtual void do_creation_processing ();
+  virtual void initialize ();
   virtual bool try_music (Music*);
-  virtual void create_grobs ();
+  virtual void create_audio_elements ();
   virtual void stop_translation_timestep ();
   virtual void start_translation_timestep ();
 
@@ -42,25 +39,23 @@ private:
   Pedal_info * info_alist_;
 };
 
-ADD_THIS_TRANSLATOR (Piano_pedal_performer);
-
 Piano_pedal_performer::Piano_pedal_performer ()
 {
   info_alist_ = 0;
 }
 
-Piano_pedal_performer::~Piano_pedal_performer()
+Piano_pedal_performer::~Piano_pedal_performer ()
 {
   delete[] info_alist_;
 }
 
 void
-Piano_pedal_performer::do_creation_processing ()
+Piano_pedal_performer::initialize ()
 {
   info_alist_ = new Pedal_info[4];
   Pedal_info *p = info_alist_;
 
-  char * names [] = { "Sostenuto", "Sustain", "UnaChorda", 0  };
+  char * names [] = { "Sostenuto", "Sustain", "UnaCorda", 0  };
   char **np = names ;
   do
     {
@@ -71,11 +66,11 @@ Piano_pedal_performer::do_creation_processing ()
 
       p++;
     }
-  while (*(np ++));
+  while (* (np ++));
 }
 
 void
-Piano_pedal_performer::create_grobs ()
+Piano_pedal_performer::create_audio_elements ()
 {
   for (Pedal_info*p = info_alist_; p && p->name_; p ++)
  
@@ -84,7 +79,7 @@ Piano_pedal_performer::create_grobs ()
        {
          if (!p->start_req_l_)
            {
-             p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", String (p->name_)));
+             p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
            }
          else
            {
@@ -130,17 +125,18 @@ Piano_pedal_performer::start_translation_timestep ()
 bool
 Piano_pedal_performer::try_music (Music* r)
 {
-  if (Span_req * s = dynamic_cast<Span_req*>(r))
+  if (Span_req * s = dynamic_cast<Span_req*> (r))
     {
       for (Pedal_info*p = info_alist_; p->name_; p ++)
        {
          if (scm_equal_p (s->get_mus_property ("span-type"),
                           ly_str02scm (p->name_)) == SCM_BOOL_T)
            {
-             p->req_l_drul_[s->get_span_dir()] = s;
+             p->req_l_drul_[s->get_span_dir ()] = s;
              return true;
            }
        }
     }
   return false;
 }
+ENTER_DESCRIPTION (Piano_pedal_performer, "","","","","" );