]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/folded-repeat-iterator.hh
a3b30516013e79d32e657092a9a59aa6f25f22d1
[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--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef FOLDED_REPEAT_ITERATOR_HH
10 #define FOLDED_REPEAT_ITERATOR_HH
11
12 #include "music-iterator.hh"
13
14 /**
15    Iterate through a repeated section: first do the body, then
16    all alternatives in parallel.
17 */
18 class Folded_repeat_iterator : public Music_iterator
19 {
20 public:
21   DECLARE_SCHEME_CALLBACK (constructor, ());
22   DECLARE_CLASSNAME(Folded_repeat_iterator);
23
24   Folded_repeat_iterator (Folded_repeat_iterator const &src);
25   Folded_repeat_iterator ();
26   virtual void derived_mark () const;
27   virtual void derived_substitute (Context *f, Context *t);
28
29   virtual void construct_children ();
30   virtual Moment pending_moment () const;
31   virtual void do_quit ();
32   virtual bool ok () const;
33
34 protected:
35   void enter_alternative ();
36   void leave_body ();
37
38   virtual void process (Moment);
39   virtual Music_iterator *try_music_in_children (Music *) const;
40
41 private:
42   Music_iterator *main_iter_;
43   Music_iterator *alternative_iter_;
44
45   Moment main_length_mom_;
46 };
47 #endif /* FOLDED_REPEAT_ITERATOR_HH */
48