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
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;
{
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;
void
Piano_pedal_performer::stop_translation_timestep ()
{
- for (vsize i = 0; i < audios_.size (); i++)
- play_element (audios_[i]);
audios_.clear ();
}
info_alist_[UNA_CORDA].event_drul_[d] = r;
}
-ADD_TRANSLATOR (Piano_pedal_performer, "", "",
- "pedal-event",
- "", "");
+ADD_TRANSLATOR (Piano_pedal_performer,
+ /* doc */
+ "",
+
+ /* create */
+ "",
+
+ /* read */
+ "",
+
+ /* write */
+ ""
+ );