]> git.donarmstrong.com Git - lilypond.git/blob - lily/lyric-performer.cc
release: 1.1.1
[lilypond.git] / lily / lyric-performer.cc
1 /*
2   lyric-performer.cc -- implement Lyric_performer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "lyric-performer.hh"
10 #include "text-def.hh"
11 #include "musical-request.hh"
12 #include "audio-item.hh"
13
14
15
16 IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer);
17 ADD_THIS_TRANSLATOR(Lyric_performer);
18
19 void 
20 Lyric_performer::do_print() const
21 {
22 #ifndef NPRINT
23   if (lreq_arr_.size())
24     lreq_arr_[0]->print();
25 #endif
26 }
27
28 void
29 Lyric_performer::do_process_requests()
30 {
31   if (lreq_arr_.size() && lreq_arr_[0]->text_str_.length_i())
32     play (new Audio_text (Audio_text::LYRIC, lreq_arr_[0]->text_str_));
33   lreq_arr_.clear();
34 }
35
36 bool
37 Lyric_performer::do_try_request (Request* req_l)
38 {
39   if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l))
40     {
41       lreq_arr_.push (lr);
42       return true;
43     }
44   return false;
45 }
46