(process_acknowledged_grobs):
[lilypond.git] / lily / event-chord-iterator.cc
blobc417e55917b574271d7748070be27af11e8c04c0
1 /*
2 event-chord-iterator.cc -- implement Event_chord_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "translator-group.hh"
10 #include "warn.hh"
11 #include "event-chord-iterator.hh"
12 #include "music-list.hh"
13 #include "event.hh"
15 Event_chord_iterator::Event_chord_iterator ()
19 Event_chord_iterator::Event_chord_iterator (Event_chord_iterator const &src)
20 : Simple_music_iterator (src)
24 Translator_group*
25 Event_chord_iterator::get_req_translator ()
27 assert (report_to ());
28 if (report_to ()->is_bottom_translator_b ())
29 return report_to ();
31 set_translator (report_to ()->get_default_interpreter ());
32 return report_to ();
35 void
36 Event_chord_iterator::construct_children ()
38 Simple_music_iterator::construct_children ();
39 get_req_translator ();
42 Event_chord*
43 Event_chord_iterator::get_elt () const
45 return (Event_chord*) get_music ();
48 SCM
49 Event_chord_iterator::get_pending_events (Moment) const
51 SCM s = SCM_EOL;
52 if (last_processed_mom_ < Moment (0))
54 Music_sequence * ms = dynamic_cast<Music_sequence*> (get_music ());
56 for (SCM m = ms->music_list (); gh_pair_p (m); m = ly_cdr (m))
58 s = gh_cons (ly_car (m) , s);
61 return s;
64 void
65 Event_chord_iterator::process (Moment m)
67 if (last_processed_mom_ < Moment (0))
69 for (SCM s = dynamic_cast<Music_sequence *> (get_music ())->music_list ();
70 gh_pair_p (s); s = ly_cdr (s))
72 Music *mus = unsmob_music (ly_car (s));
74 bool gotcha = try_music (mus);
75 if (!gotcha)
76 mus->origin ()->warning (_f ("Junking event: `%s'", mus->name()));
79 skip (m);
82 IMPLEMENT_CTOR_CALLBACK (Event_chord_iterator);