]> git.donarmstrong.com Git - lilypond.git/blob - lily/event-chord-iterator.cc
08ee9b620e410a38683df548fd667f1dd566b2e8
[lilypond.git] / lily / event-chord-iterator.cc
1 /*
2   event-chord-iterator.cc -- implement Event_chord_iterator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "event-chord-iterator.hh"
10
11 #include "context.hh"
12 #include "dispatcher.hh"
13 #include "duration.hh"
14 #include "input.hh"
15 #include "international.hh"
16 #include "music.hh"
17 #include "warn.hh"
18
19 Event_chord_iterator::Event_chord_iterator ()
20 {
21 }
22
23 void
24 Event_chord_iterator::construct_children ()
25 {
26   Simple_music_iterator::construct_children ();
27   descend_to_bottom_context ();
28 }
29
30 void
31 Event_chord_iterator::process (Moment m)
32 {
33   if (last_processed_mom_ < Moment (0))
34     {
35       for (SCM s = get_music ()->get_property ("elements");
36            scm_is_pair (s); s = scm_cdr (s))
37         {
38           Music *mus = unsmob_music (scm_car (s));
39           report_event (mus);
40         }
41       for (SCM s = get_music ()->get_property ("events");
42            scm_is_pair (s); s = scm_cdr (s))
43         {
44           Stream_event *ev = unsmob_stream_event (scm_car (s));
45           get_outlet ()->event_source ()->broadcast (ev);
46         }
47     }
48   Simple_music_iterator::process (m);
49 }
50
51 IMPLEMENT_CTOR_CALLBACK (Event_chord_iterator);