]> git.donarmstrong.com Git - lilypond.git/blob - lily/event-chord-iterator.cc
* configure.in: Test for and accept lmodern if EC fonts not found.
[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--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "event-chord-iterator.hh"
10
11 #include "context.hh"
12 #include "warn.hh"
13 #include "music-list.hh"
14 #include "event.hh"
15
16 Event_chord_iterator::Event_chord_iterator ()
17 {
18 }
19
20 Context *
21 Event_chord_iterator::get_req_translator ()
22 {
23   assert (get_outlet ());
24   if (get_outlet ()->is_bottom_context ())
25     return get_outlet ();
26
27   set_context (get_outlet ()->get_default_interpreter ());
28   return get_outlet ();
29 }
30
31 void
32 Event_chord_iterator::construct_children ()
33 {
34   Simple_music_iterator::construct_children ();
35   get_req_translator ();
36 }
37
38 Event_chord*
39 Event_chord_iterator::get_elt () const
40 {
41   return (Event_chord*) get_music ();
42 }
43
44
45 void
46 Event_chord_iterator::process (Moment m)
47 {
48   if (last_processed_mom_ < Moment (0))
49     {
50       for (SCM s = dynamic_cast<Music_sequence *> (get_music ())->music_list ();
51            scm_is_pair (s);  s = scm_cdr (s))
52         {
53           Music *mus = unsmob_music (scm_car (s));
54
55           bool gotcha = try_music (mus);
56           if (!gotcha)
57             mus->origin ()->warning (_f ("Junking event: `%s'", mus->name ()));
58         }
59     }
60   Simple_music_iterator::process (m);
61 }
62
63 IMPLEMENT_CTOR_CALLBACK (Event_chord_iterator);