lilypond-0.1.27
[lilypond.git] / lily / lyric-performer.cc
blobf55844044c4db3bf140d6e69066c635ca7951d51
1 /*
2 lyric-performer.cc -- implement Lyric_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
7 */
9 #include "lyric-performer.hh"
10 #include "text-def.hh"
11 #include "musical-request.hh"
12 #include "audio-item.hh"
16 IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer);
17 ADD_THIS_TRANSLATOR(Lyric_performer);
19 Lyric_performer::Lyric_performer()
23 Lyric_performer::~Lyric_performer()
27 void
28 Lyric_performer::do_print() const
30 #ifndef NPRINT
31 if (lreq_arr_.size())
32 lreq_arr_[ 0 ]->print();
33 #endif
36 void
37 Lyric_performer::do_process_requests()
39 if (lreq_arr_.size() && lreq_arr_[ 0 ]->tdef_p_->text_str_.length_i())
40 play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->tdef_p_->text_str_));
41 lreq_arr_.clear();
44 bool
45 Lyric_performer::do_try_request (Request* req_l)
47 Musical_req* m_l = req_l->musical();
48 if (!m_l || ! m_l->lreq_l())
49 return false;
50 lreq_arr_.push (m_l->lreq_l());
52 return true;