]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper-iterator.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[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--2006 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   child_iter_->quit ();
22 }
23
24 void
25 Music_wrapper_iterator::derived_mark () const
26 {
27   if (child_iter_)
28     scm_gc_mark (child_iter_->self_scm ());
29 }
30
31 void
32 Music_wrapper_iterator::derived_substitute (Context *f, Context *t)
33 {
34   if (child_iter_)
35     child_iter_->substitute_outlet (f, t);
36 }
37
38 void
39 Music_wrapper_iterator::construct_children ()
40 {
41   Music *my_music = get_music ();
42   Music *child = unsmob_music (my_music->get_property ("element"));
43   child_iter_ = unsmob_iterator (get_iterator (child));
44 }
45
46 bool
47 Music_wrapper_iterator::ok () const
48 {
49   return child_iter_ && child_iter_->ok ();
50 }
51
52 void
53 Music_wrapper_iterator::process (Moment m)
54 {
55   child_iter_->process (m);
56 }
57
58 Moment
59 Music_wrapper_iterator::pending_moment () const
60 {
61   return child_iter_->pending_moment ();
62 }
63
64 IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator);
65
66 bool
67 Music_wrapper_iterator::run_always () const
68 {
69   return child_iter_->run_always ();
70 }