]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/repeat-engraver.hh
release: 1.3.19
[lilypond.git] / lily / include / repeat-engraver.hh
1 /*
2   repeat-engraver.hh -- declare Repeat_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #ifndef REPEAT_ENGRAVER_HH
10 #define REPEAT_ENGRAVER_HH
11
12 #include "engraver.hh"
13 #include "cons.hh"
14
15 struct Bar_create_event
16 {
17   Moment when_;
18   bool bar_b_;
19   bool last_b_;
20   String type_;
21   Bar_create_event();
22   Bar_create_event (Moment w, String s);
23   Bar_create_event (Moment w, int i, int j);
24 };
25
26 int compare (Bar_create_event const & c1, Bar_create_event const &c2)
27 {
28   return (c1.when_ - c2.when_).sign();
29 }
30
31 /**
32   Generate repeat-bars |: :| for repeated-music
33   */
34 class Repeat_engraver : public Engraver 
35 {
36 public:
37   VIRTUAL_COPY_CONS(Translator);
38   Repeat_engraver ();
39 protected:
40   virtual void acknowledge_element (Score_element_info i);
41   virtual void do_removal_processing ();
42   virtual bool do_try_music (Music *req_l);
43   virtual void do_process_requests();
44   virtual void do_pre_move_processing();
45   virtual void do_post_move_processing ();
46   void queue_events ();
47
48 private:
49   Repeated_music *repeated_music_l_;
50   bool done_this_one_b_;
51
52   /*
53     Royal_brackla_create_queue is only two Whiskies away. :-)
54    */
55   Cons<Bar_create_event> *create_barmoments_queue_;
56
57   Volta_spanner * volta_span_p_;
58   Volta_spanner* end_volta_span_p_;
59 };
60
61 #endif // REPEAT_ENGRAVER_HH
62