}
SCM
-Request_chord_iterator::get_music (Moment m) const
+Request_chord_iterator::get_music (Moment) const
{
- Request_chord_iterator* urg = (Request_chord_iterator*)this;
- urg->last_processed_mom_ = m;
- urg->last_processed_mom_.set_infinite (1);
SCM s = SCM_EOL;
- if (music_l_)
+ if (last_processed_mom_ < Moment (0))
{
Music_sequence * ms = dynamic_cast<Music_sequence*> (music_l_);
{
s = gh_cons (gh_car (m) , s);
}
- urg->music_l_ = 0;
}
return s;
}
void
Request_chord_iterator::process (Moment m)
{
- last_processed_mom_ = m;
- if (music_l_)
+ if (last_processed_mom_ < Moment (0))
{
for (SCM s = dynamic_cast<Music_sequence *> (music_l_)->music_list ();
gh_pair_p (s); s = gh_cdr (s))
{
Music *mus = unsmob_music (gh_car (s));
- if (Request * req_l = dynamic_cast<Request*> (mus))
- {
- bool gotcha = try_music (req_l);
- if (!gotcha)
- req_l->origin ()->warning (_f ("Junking request: `%s'", classname( req_l)));
- }
- else
- mus->origin ()->warning (_f ("Huh? Not a Request: `%s'",
- classname (mus)));
+ bool gotcha = try_music (mus);
+ if (!gotcha)
+ mus->origin ()->warning (_f ("Junking request: `%s'", classname(mus)));
}
-
- music_l_ =0;
}
+ skip (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Request_chord_iterator);