]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper-iterator.cc
9af125955bff821062219c8039b195ed19ba1871
[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@cs.uu.nl>
7  */
8
9
10 #include "music-wrapper-iterator.hh"
11
12 #include "music-wrapper.hh"
13
14 Music_wrapper_iterator::Music_wrapper_iterator ()
15 {
16   child_iter_ = 0;
17 }
18
19 void
20 Music_wrapper_iterator::do_quit ()
21 {
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 * m =  dynamic_cast<Music_wrapper const*> (get_music ())-> element ();  
43   child_iter_ = unsmob_iterator (get_iterator (m));
44 }
45
46 bool
47 Music_wrapper_iterator::ok () const
48 {
49   return child_iter_ && child_iter_->ok ();
50 }
51
52
53 void
54 Music_wrapper_iterator::process (Moment m)
55 {
56   child_iter_->process (m);
57 }
58
59
60 Moment
61 Music_wrapper_iterator::pending_moment () const
62 {
63   return child_iter_->pending_moment ();
64 }
65
66 Music_iterator*
67 Music_wrapper_iterator::try_music_in_children (Music *m) const
68 {
69   return child_iter_->try_music (m);
70 }
71
72 IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator);
73
74 bool
75 Music_wrapper_iterator::run_always () const
76 {
77   return child_iter_->run_always ();
78 }