]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper-iterator.cc
6dfe61c1734df57b236b88622014b5079cef0642
[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--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7  */
8
9
10 #include "music-wrapper-iterator.hh"
11 #include "music-wrapper.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 (Translator_group*f,Translator_group*t) 
33 {
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 }