]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-performer.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / piano-pedal-performer.cc
index 4048bb57a72ef522a54e0e8360e8b02fe3941ab0..ef01942221f26ebffd24c620927ffaf7360de17a 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2007 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,14 +86,15 @@ 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]);
@@ -109,7 +107,7 @@ 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]);
@@ -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 ();
 }
 
@@ -164,5 +160,4 @@ Piano_pedal_performer::listen_una_corda (Stream_event *r)
 }
 
 ADD_TRANSLATOR (Piano_pedal_performer, "", "",
-               "pedal-event",
                "", "");