]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/unfolded-repeat-iterator.hh
6ffdbb62aaf790969d2cc594b339b303907afa21
[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--2000 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   VIRTUAL_COPY_CONS (Music_iterator);
23   /**
24      How often have we done the body (assuming bodies are interspersed.)?
25    */
26   int done_count_;
27
28
29   /// unfold everything, or do volta?
30   bool full_unfold_b_;
31   
32   /// are we busy doing the body?
33   bool do_main_b_;
34
35   /** How far have we progressed into the repeat.
36       This excludes the elt currently being iterated.
37   */
38   Moment done_mom_;
39   int alternative_count_i_;
40   Music_iterator * current_iter_p_;
41   
42   /// pointer to the alternative that will be processed next.
43   SCM alternative_cons_;
44   ~Unfolded_repeat_iterator();
45   Unfolded_repeat_iterator ();
46
47
48 protected:  
49   virtual void construct_children ();
50   virtual Moment pending_moment () const;
51   virtual void process (Moment);
52   virtual Music_iterator *try_music_in_children (Music *) const;
53
54   virtual bool ok () const;
55   virtual void next_element ();
56 };
57 #endif /* UNFOLDED_REPEAT_ITERATOR_HH */
58