]> git.donarmstrong.com Git - lilypond.git/blob - lily/event-chord-iterator.cc
89a0f383a99020427b918e09f8675663b9f7f087
[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--2006 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 "pitch.hh"
18 #include "stream-event.hh"
19 #include "warn.hh"
20
21 Event_chord_iterator::Event_chord_iterator ()
22 {
23 }
24
25 void
26 Event_chord_iterator::construct_children ()
27 {
28   Simple_music_iterator::construct_children ();
29   descend_to_bottom_context ();
30 }
31
32 void
33 Event_chord_iterator::process (Moment m)
34 {
35   if (last_processed_mom_ < Moment (0))
36     {
37       for (SCM s = get_music ()->get_property ("elements");
38            scm_is_pair (s); s = scm_cdr (s))
39         {
40           Music *mus = unsmob_music (scm_car (s));
41           report_event (mus);
42         }
43       for (SCM s = get_music ()->get_property ("events");
44            scm_is_pair (s); s = scm_cdr (s))
45         {
46           Stream_event *ev = unsmob_stream_event (scm_car (s));
47           get_outlet ()->event_source ()->broadcast (ev);
48         }
49     }
50   Simple_music_iterator::process (m);
51 }
52
53 IMPLEMENT_CTOR_CALLBACK (Event_chord_iterator);