]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper-iterator.cc
Run `make grand-replace'.
[lilypond.git] / lily / music-wrapper-iterator.cc
1 /*
2   music-wrapper-iterator.cc -- implement Music_wrapper_iterator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "music-wrapper-iterator.hh"
10 #include "music-wrapper.hh"
11 #include "music.hh"
12
13 Music_wrapper_iterator::Music_wrapper_iterator ()
14 {
15   child_iter_ = 0;
16 }
17
18 void
19 Music_wrapper_iterator::do_quit ()
20 {
21   if (child_iter_)
22     child_iter_->quit ();
23 }
24
25 void
26 Music_wrapper_iterator::derived_mark () const
27 {
28   if (child_iter_)
29     scm_gc_mark (child_iter_->self_scm ());
30 }
31
32 void
33 Music_wrapper_iterator::derived_substitute (Context *f, Context *t)
34 {
35   if (child_iter_)
36     child_iter_->substitute_outlet (f, t);
37 }
38
39 void
40 Music_wrapper_iterator::construct_children ()
41 {
42   Music *my_music = get_music ();
43   Music *child = unsmob_music (my_music->get_property ("element"));
44   child_iter_ = (child)
45     ? unsmob_iterator (get_iterator (child))
46     : 0;
47 }
48
49 bool
50 Music_wrapper_iterator::ok () const
51 {
52   return child_iter_ && child_iter_->ok ();
53 }
54
55 void
56 Music_wrapper_iterator::process (Moment m)
57 {
58   if (child_iter_)
59     child_iter_->process (m);
60 }
61
62 Moment
63 Music_wrapper_iterator::pending_moment () const
64 {
65   if (child_iter_)
66     return child_iter_->pending_moment ();
67   else
68     return Music_iterator::pending_moment ();
69 }
70
71 IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator);
72
73 bool
74 Music_wrapper_iterator::run_always () const
75 {
76   return (child_iter_ &&  child_iter_->run_always ());
77 }