]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-performer.cc
Run `make grand-replace'.
[lilypond.git] / lily / piano-pedal-performer.cc
index 4048bb57a72ef522a54e0e8360e8b02fe3941ab0..2552e6a32f3039ebce57d82be1c6b646ed5868c2 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2008 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "performer.hh"
 
 #include "translator.icc"
 
-#define SOSTENUTO      0
-#define SUSTAIN                1
-#define UNA_CORDA      2
-#define NUM_PEDAL_TYPES 3
+typedef enum Pedal_type {SOSTENUTO, SUSTAIN, UNA_CORDA, NUM_PEDAL_TYPES};
 
 /**
    perform Piano pedals
@@ -89,17 +86,18 @@ Piano_pedal_performer::process_music ()
 
   for (int i = 0; i < NUM_PEDAL_TYPES; i++, p++)
     {
+      string pedal_type = pedal_type_str (i);
       if (p->event_drul_[STOP])
        {
          if (!p->start_event_)
-           p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", pedal_type_str (i)));
+           p->event_drul_[STOP]->origin ()->warning (_f ("cannot find start of piano pedal: `%s'", pedal_type));
          else
            {
              Audio_piano_pedal *a = new Audio_piano_pedal;
-             a->type_string_ = string (pedal_type_str (i));
+             a->type_string_ = pedal_type;
              a->dir_ = STOP;
              audios_.push_back (a);
-              Audio_element_info info(a, p->event_drul_[STOP]);
+              Audio_element_info info (a, p->event_drul_[STOP]);
               announce_element (info);
            }
          p->start_event_ = 0;
@@ -109,10 +107,10 @@ Piano_pedal_performer::process_music ()
        {
          p->start_event_ = p->event_drul_[START];
          Audio_piano_pedal *a = new Audio_piano_pedal;
-         a->type_string_ = string (pedal_type_str (i));
+         a->type_string_ = pedal_type;
          a->dir_ = START;
          audios_.push_back (a);
-          Audio_element_info info(a, p->event_drul_[START]);
+          Audio_element_info info (a, p->event_drul_[START]);
           announce_element (info);
        }
       p->event_drul_[START] = 0;
@@ -123,8 +121,6 @@ Piano_pedal_performer::process_music ()
 void
 Piano_pedal_performer::stop_translation_timestep ()
 {
-  for (vsize i = 0; i < audios_.size (); i++)
-    play_element (audios_[i]);
   audios_.clear ();
 }
 
@@ -163,6 +159,16 @@ Piano_pedal_performer::listen_una_corda (Stream_event *r)
   info_alist_[UNA_CORDA].event_drul_[d] = r;
 }
 
-ADD_TRANSLATOR (Piano_pedal_performer, "", "",
-               "pedal-event",
-               "", "");
+ADD_TRANSLATOR (Piano_pedal_performer,
+               /* doc */
+               "",
+
+               /* create */
+               "",
+
+               /* read */
+               "",
+
+               /* write */
+               ""
+               );