lilypond-1.3.28
[lilypond.git] / lily / lyric-performer.cc
blob5a5be595670ce3c5754bb1c8666474087204c92b
1 /*
2 lyric-performer.cc -- implement Lyric_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #include "lyric-performer.hh"
10 #include "musical-request.hh"
11 #include "audio-item.hh"
13 ADD_THIS_TRANSLATOR (Lyric_performer);
15 Lyric_performer::Lyric_performer ()
17 audio_p_ = 0;
20 void
21 Lyric_performer::do_print () const
23 #ifndef NPRINT
24 if (lreq_arr_.size ())
25 lreq_arr_[0]->print ();
26 #endif
29 void
30 Lyric_performer::do_process_requests ()
32 if (lreq_arr_.size () && lreq_arr_[0]->text_str_.length_i ())
34 audio_p_ = new Audio_text (Audio_text::LYRIC, lreq_arr_[0]->text_str_);
35 Audio_element_info info (audio_p_, lreq_arr_[0]);
36 announce_element (info);
38 lreq_arr_.clear();
41 void
42 Lyric_performer::do_pre_move_processing ()
44 if (audio_p_)
46 play_element (audio_p_);
47 audio_p_ = 0;
49 lreq_arr_.clear();
52 bool
53 Lyric_performer::do_try_music (Music* req_l)
55 if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l))
57 lreq_arr_.push (lr);
58 return true;
60 return false;