]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spacing-engraver.hh
patch::: 1.3.8.uu1
[lilypond.git] / lily / include / spacing-engraver.hh
1 /*   
2   spacing-engraver.hh -- declare Spacing_engraver
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 SPACING_ENGRAVER_HH
11 #define SPACING_ENGRAVER_HH
12
13 #include "engraver.hh"
14 #include "pqueue.hh"
15
16 struct Rhythmic_tuple
17 {
18   Score_element_info info_;
19   Moment end_;
20   
21   Rhythmic_tuple ()
22     {
23     }
24   Rhythmic_tuple (Score_element_info i, Moment m )
25     {
26       info_ = i;
27       end_ = m;
28     }
29   static int time_compare (Rhythmic_tuple const &, Rhythmic_tuple const &);  
30 };
31
32 /**
33    Acknowledge rhythmic elements, for initializing spacing fields in
34    the columns.
35
36    should be the  last one of the toplevel context
37 */
38 class Spacing_engraver : public Engraver
39 {
40   PQueue<Rhythmic_tuple> playing_durations_;
41   Array<Rhythmic_tuple> now_durations_;
42   Array<Rhythmic_tuple> stopped_durations_;
43
44   Spacing_spanner * spacing_p_;
45 protected:
46   VIRTUAL_COPY_CONS(Translator);
47   virtual void acknowledge_element (Score_element_info);
48   virtual void do_post_move_processing ();
49   virtual void do_pre_move_processing ();
50   virtual void do_creation_processing ();
51   virtual void do_removal_processing ();
52 public:
53   Spacing_engraver ();
54 };
55
56 #endif /* SPACING_ENGRAVER_HH */
57