lilypond-1.1.51
[lilypond.git] / lily / lyric-engraver.cc
blob7171fc7200e1296644eb6f703bed7c14ea2e06e4
1 /*
2 lyric-engraver.cc -- implement Lyric_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
8 */
10 #include "lyric-engraver.hh"
11 #include "musical-request.hh"
12 #include "text-item.hh"
13 #include "paper-def.hh"
14 #include "lookup.hh"
16 ADD_THIS_TRANSLATOR (Lyric_engraver);
19 Lyric_engraver::Lyric_engraver()
21 text_p_ =0;
22 req_l_ =0;
25 bool
26 Lyric_engraver::do_try_music (Music*r)
28 if (Lyric_req* l = dynamic_cast <Lyric_req *> (r))
30 if (req_l_)
31 return false;
32 req_l_ =l;
33 return true;
35 return false;
38 void
39 Lyric_engraver::do_process_requests()
41 if (req_l_)
43 text_p_= new Text_item;
44 text_p_->text_str_ = req_l_->text_str_;
46 text_p_->text_str_ += " "; // ugh.
48 Scalar style = get_property ("textStyle", 0);
49 if (style.length_i ())
50 text_p_->style_str_ = style;
52 announce_element (Score_element_info (text_p_, req_l_));
56 void
57 Lyric_engraver::do_pre_move_processing()
59 if (text_p_)
61 typeset_element (text_p_);
62 text_p_ =0;
66 void
67 Lyric_engraver::do_post_move_processing ()
69 req_l_ =0;