]> git.donarmstrong.com Git - lilypond.git/blob - lily/lyric-engraver.cc
28d1086e0283a7745eb99d31678e213b30f97866
[lilypond.git] / lily / lyric-engraver.cc
1 /*
2   lyric-engraver.cc -- implement Lyric_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "lyric-engraver.hh"
10 #include "musical-request.hh"
11 #include "text-item.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
14
15 Lyric_engraver::Lyric_engraver()
16 {
17 }
18
19 bool
20 Lyric_engraver::do_try_request(Request*r)
21 {
22     Musical_req * m =r->musical();
23     if (!m || ! m->lreq_l()) 
24         return false;
25     lreq_arr_.push(m->lreq_l());
26
27     return true;
28 }
29
30 void
31 Lyric_engraver::do_process_requests()
32 {
33     Text_item * last_item_l =0;
34     for (int i=0; i < lreq_arr_.size(); i++) {
35         Text_item *lp = new Text_item(lreq_arr_[i]->tdef_p_ );
36         lp->dir_i_ = -1;
37         lp->fat_b_ = true;
38         if (last_item_l)
39             lp->add_support(last_item_l);
40         last_item_l = lp;
41         typeset_element(lp);
42     }
43 }
44
45 void
46 Lyric_engraver::do_post_move_processing()
47 {
48     lreq_arr_.set_size(0);
49 }
50
51
52 IMPLEMENT_STATIC_NAME(Lyric_engraver);
53 IMPLEMENT_IS_TYPE_B1(Lyric_engraver,Engraver);
54 ADD_THIS_ENGRAVER(Lyric_engraver);