X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpiano-pedal-performer.cc;h=3ec96a9d490e6989d69c7f55e2537177e8bf889f;hb=f085824b2182c1f0fa2c5118884770ac7ff775c7;hp=fd32e92684349e8f3dad98b04b8ce2c5fdecab28;hpb=8d7a55721e3305f745c0b24c367de002dd197825;p=lilypond.git diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index fd32e92684..3ec96a9d49 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -3,12 +3,12 @@ source file of the GNU LilyPond music typesetter - (c) 2000 Jan Nieuwenhuizen + (c) 2000--2004 Jan Nieuwenhuizen */ #include "performer.hh" -#include "command-request.hh" -#include "musical-request.hh" + +#include "event.hh" #include "audio-item.hh" /** @@ -19,8 +19,8 @@ class Piano_pedal_performer : public Performer struct Pedal_info { char const *name_; - Span_req* start_req_l_; - Drul_array req_l_drul_; + Music* start_req_; + Drul_array req_l_drul_; }; public: @@ -35,7 +35,7 @@ protected: virtual void start_translation_timestep (); private: - Link_array audio_p_arr_; + Link_array audios_; Pedal_info * info_alist_; }; @@ -62,7 +62,7 @@ Piano_pedal_performer::initialize () p->name_ = *np; p->req_l_drul_[START] = 0; p->req_l_drul_[STOP] = 0; - p->start_req_l_ = 0; + p->start_req_ = 0; p++; } @@ -77,27 +77,27 @@ Piano_pedal_performer::create_audio_elements () { if (p->req_l_drul_[STOP]) { - if (!p->start_req_l_) + if (!p->start_req_) { p->req_l_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_str_ = String (p->name_); + a->type_string_ = String (p->name_); a->dir_ = STOP; - audio_p_arr_.push (a); + audios_.push (a); } - p->start_req_l_ = 0; + p->start_req_ = 0; } if (p->req_l_drul_[START]) { - p->start_req_l_ = p->req_l_drul_[START]; + p->start_req_ = p->req_l_drul_[START]; Audio_piano_pedal* a = new Audio_piano_pedal; - a->type_str_ = String (p->name_); + a->type_string_ = String (p->name_); a->dir_ = START; - audio_p_arr_.push (a); + audios_.push (a); } p->req_l_drul_[START] = 0; p->req_l_drul_[STOP] = 0; @@ -107,9 +107,9 @@ Piano_pedal_performer::create_audio_elements () void Piano_pedal_performer::stop_translation_timestep () { - for (int i=0; i< audio_p_arr_.size (); i++) - play_element (audio_p_arr_[i]); - audio_p_arr_.clear (); + for (int i=0; i< audios_.size (); i++) + play_element (audios_[i]); + audios_.clear (); } void @@ -125,18 +125,23 @@ Piano_pedal_performer::start_translation_timestep () bool Piano_pedal_performer::try_music (Music* r) { - if (Span_req * s = dynamic_cast (r)) + if (r->is_mus_type ("pedal-event")) { for (Pedal_info*p = info_alist_; p->name_; p ++) { - if (scm_equal_p (s->get_mus_property ("span-type"), - ly_str02scm (p->name_)) == SCM_BOOL_T) + String nm = p->name_ + String ("Event"); + if (gh_equal_p (r->get_mus_property ("name") , + scm_makfrom0str (nm.to_str0()))) { - p->req_l_drul_[s->get_span_dir ()] = s; + Direction d = to_dir (r->get_mus_property ("span-direction")); + p->req_l_drul_[d] = r; return true; } } } return false; } -ENTER_DESCRIPTION (Piano_pedal_performer, "","","","","" ); + +ENTER_DESCRIPTION (Piano_pedal_performer, "","", + "pedal-event", + "","","" );