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