]> git.donarmstrong.com Git - lilypond.git/blob - lily/lyric-performer.cc
patch::: 1.3.108.jcn3
[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--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "lyric-performer.hh"
10 #include "musical-request.hh"
11 #include "audio-item.hh"
12
13 ADD_THIS_TRANSLATOR (Lyric_performer);
14
15 Lyric_performer::Lyric_performer ()
16 {
17   audio_p_ = 0;
18 }
19
20
21 void
22 Lyric_performer::deprecated_process_music ()
23 {
24   // FIXME: won't work with fancy lyrics
25   if (lreq_arr_.size ()
26       && gh_string_p (lreq_arr_[0]->get_mus_property ("text"))
27       && ly_scm2string (lreq_arr_[0]->get_mus_property ("text")).length_i ())
28     {
29       audio_p_ = new Audio_text (Audio_text::LYRIC,
30                                  ly_scm2string (lreq_arr_[0]->get_mus_property ("text")));
31       Audio_element_info info (audio_p_, lreq_arr_[0]);
32       announce_element (info);
33     }
34   lreq_arr_.clear();
35 }
36
37 void
38 Lyric_performer::do_pre_move_processing ()
39 {
40   if (audio_p_)
41     {
42       play_element (audio_p_);
43       audio_p_ = 0;
44     }
45   lreq_arr_.clear();
46 }
47
48 bool
49 Lyric_performer::do_try_music (Music* req_l)
50 {
51   if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l))
52     {
53       lreq_arr_.push (lr);
54       return true;
55     }
56   return false;
57 }
58