lilypond-0.1.11
[lilypond.git] / lily / lyric-engraver.cc
blob28d1086e0283a7745eb99d31678e213b30f97866
1 /*
2 lyric-engraver.cc -- implement Lyric_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "lyric-engraver.hh"
10 #include "musical-request.hh"
11 #include "text-item.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
15 Lyric_engraver::Lyric_engraver()
19 bool
20 Lyric_engraver::do_try_request(Request*r)
22 Musical_req * m =r->musical();
23 if (!m || ! m->lreq_l())
24 return false;
25 lreq_arr_.push(m->lreq_l());
27 return true;
30 void
31 Lyric_engraver::do_process_requests()
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);
45 void
46 Lyric_engraver::do_post_move_processing()
48 lreq_arr_.set_size(0);
52 IMPLEMENT_STATIC_NAME(Lyric_engraver);
53 IMPLEMENT_IS_TYPE_B1(Lyric_engraver,Engraver);
54 ADD_THIS_ENGRAVER(Lyric_engraver);