]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/folded-repeat-iterator.hh
release: 1.3.107
[lilypond.git] / lily / include / folded-repeat-iterator.hh
1 /*   
2   folded-repeat-iterator.hh -- declare Folded_repeat_iterator
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef FOLDED_REPEAT_ITERATOR_HH
11 #define FOLDED_REPEAT_ITERATOR_HH
12
13 #include "music-iterator.hh"
14
15 /**
16    Iterate through a repeated section: first do the body, then
17    all alternatives in parallel.
18  */
19 class Folded_repeat_iterator : public Music_iterator
20 {
21 public:
22   VIRTUAL_COPY_CONS (Music_iterator);
23   static SCM constructor_cxx_function;
24   
25   Folded_repeat_iterator ();
26   ~Folded_repeat_iterator ();
27   
28   virtual void construct_children ();
29   virtual Moment pending_moment () const;
30   virtual bool ok () const;
31
32 protected:
33   void enter_alternative ();
34   void leave_body ();
35   
36   virtual void process (Moment);
37   virtual Music_iterator *try_music_in_children (Music *) const;
38
39 private:
40   Music_iterator * main_iter_p_;
41   Music_iterator * alternative_iter_p_;
42   int count_;
43   Moment main_length_mom_;
44 };
45 #endif /* FOLDED_REPEAT_ITERATOR_HH */
46