#include "performer.hh"
#include "audio-item.hh"
+#include "music.hh"
/**
perform Piano pedals
struct Pedal_info
{
char const *name_;
- Music *start_req_;
- Drul_array<Music *> req_drul_;
+ Music *start_event_;
+ Drul_array<Music *> event_drul_;
};
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_;
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++;
}
}
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;
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;
}
}
{
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;
}
}
{
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;
}
}
return false;
}
+#include "translator.icc"
+
ADD_TRANSLATOR (Piano_pedal_performer, "", "",
"pedal-event",
- "", "", "");
+ "", "");