]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/unfolded-repeat-iterator.hh
release: 1.1.43
[lilypond.git] / lily / include / unfolded-repeat-iterator.hh
1 /*   
2   unfolded-repeat-iterator.hh -- declare Unfolded_repeat_iterator
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef UNFOLDED_REPEAT_ITERATOR_HH
11 #define UNFOLDED_REPEAT_ITERATOR_HH
12
13 #include "music-iterator.hh"
14
15 /**
16    Iterate repeats.  First do body, then alternatives one by one,
17    optionally interspersed by the body.
18  */
19 class Unfolded_repeat_iterator : public Music_iterator
20 {
21 public:
22   /**
23      How often have we done the body (assuming bodies are interspersed.)?
24    */
25   int done_count_;
26
27   /// are we busy doing the body?
28   bool do_main_b_;
29
30   /** How far have we progressed into the repeat.
31       This excludes the elt currently being iterated.
32   */
33   Moment done_mom_;
34   
35   Music_iterator * current_iter_p_;
36   Cons<Music> *alternative_cons_l_;
37   ~Unfolded_repeat_iterator();
38   Unfolded_repeat_iterator ();
39
40
41 protected:  
42   virtual void construct_children ();
43   virtual Moment next_moment () const;
44   virtual void do_process_and_next (Moment);
45   virtual bool ok () const;
46   virtual void next_element ();
47   virtual void do_print () const;
48 };
49 #endif /* UNFOLDED_REPEAT_ITERATOR_HH */
50