source file of the GNU LilyPond music typesetter
- (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "performer.hh"
+
#include "audio-item.hh"
+#include "international.hh"
#include "music.hh"
/**
protected:
virtual void initialize ();
virtual bool try_music (Music *);
- virtual void create_audio_elements ();
+ void process_music ();
void stop_translation_timestep ();
void start_translation_timestep ();
private:
- Link_array<Audio_piano_pedal> audios_;
+ vector<Audio_piano_pedal*> audios_;
Pedal_info *info_alist_;
};
}
void
-Piano_pedal_performer::create_audio_elements ()
+Piano_pedal_performer::process_music ()
{
for (Pedal_info *p = info_alist_; p && p->name_; p++)
if (p->event_drul_[STOP])
{
if (!p->start_event_)
- {
- p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
- }
+ 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->type_string_ = String (p->name_);
+ a->type_string_ = string (p->name_);
a->dir_ = STOP;
- audios_.push (a);
+ audios_.push_back (a);
+ 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 (p->name_);
+ a->type_string_ = string (p->name_);
a->dir_ = START;
- audios_.push (a);
+ audios_.push_back (a);
+ Audio_element_info info(a, p->event_drul_[START]);
+ announce_element (info);
}
p->event_drul_[START] = 0;
p->event_drul_[STOP] = 0;
void
Piano_pedal_performer::stop_translation_timestep ()
{
- for (int i = 0; i < audios_.size (); i++)
+ for (vsize i = 0; i < audios_.size (); i++)
play_element (audios_[i]);
audios_.clear ();
}
{
for (Pedal_info *p = info_alist_; p->name_; p++)
{
- String nm = p->name_ + String ("Event");
+ string nm = p->name_ + string ("Event");
if (ly_is_equal (r->get_property ("name"),
- scm_str2symbol (nm.to_str0 ())))
+ scm_str2symbol (nm.c_str ())))
{
Direction d = to_dir (r->get_property ("span-direction"));
p->event_drul_[d] = r;