]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/unfolded-repeat-iterator.hh
42e78e04871247c2d11ed5b584b9b6e7c7359cd4
[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   
28   /// are we busy doing the body?
29   bool do_main_b_;
30
31   /** How far have we progressed into the repeat.
32       This excludes the elt currently being iterated.
33   */
34   Moment done_mom_;
35   int alternative_count_i_;
36   Music_iterator * current_iter_p_;
37   
38   /// pointer to the alternative that will be processed next.
39   Cons<Music> *alternative_cons_l_;
40   ~Unfolded_repeat_iterator();
41   Unfolded_repeat_iterator ();
42
43
44 protected:  
45   virtual void construct_children ();
46   virtual Moment next_moment () const;
47   virtual void do_process_and_next (Moment);
48   virtual bool ok () const;
49   virtual void next_element ();
50   virtual void do_print () const;
51 };
52 #endif /* UNFOLDED_REPEAT_ITERATOR_HH */
53