]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/extender-engraver.hh
76f724c63a50d71b854845cefcdbd34e792fc93b
[lilypond.git] / lily / include / extender-engraver.hh
1 /*
2   extender-engraver.hh -- declare Extender_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #ifndef EXTENDER_ENGRAVER_HH
10 #define EXTENDER_ENGRAVER_HH
11
12 #include "engraver.hh"
13 #include "drul-array.hh"
14 #include "extender-spanner.hh"
15 #include "pqueue.hh"
16
17 struct Text_lyric_tuple {
18   Rhythmic_req *req_l_ ;
19   Text_item *text_l_;
20   Moment end_;
21   
22   Text_lyric_tuple ();
23   Text_lyric_tuple (Text_item*, Rhythmic_req*, Moment);
24   static int time_compare (Text_lyric_tuple const &, Text_lyric_tuple const &);
25 };
26
27 inline int compare (Text_lyric_tuple const &a, Text_lyric_tuple const &b)
28 {
29   return Text_lyric_tuple::time_compare (a,b);
30 }
31
32
33
34
35 /**
36   Generate an extender.  Should make an Extender_spanner that typesets
37   a nice extender line.
38
39   We remember all Text_items that come across, and store their
40   termination times. When we get a request, we create the spanner, and
41   attach the left point to the finished lyrics, and the right point to
42   any lyrics we receive by then.
43 */
44 class Extender_engraver : public Engraver
45 {
46   PQueue<Text_lyric_tuple> past_lyrics_pq_;
47   Array<Text_lyric_tuple> now_lyrics_;
48   Array<Text_lyric_tuple> stopped_lyrics_;  
49   
50   Extender_req* req_l_;
51   Extender_spanner* extender_spanner_p_;
52
53   
54 public:
55   Extender_engraver ();
56   VIRTUAL_COPY_CONS (Translator);
57
58 protected:
59   virtual void acknowledge_element (Score_element_info);
60   virtual void do_removal_processing();
61   virtual void do_process_requests();
62   virtual bool do_try_music (Music*);
63   virtual void do_pre_move_processing();
64   virtual void do_post_move_processing ();
65 private:
66
67 };
68
69 #endif // EXTENDER_ENGRAVER_HH