2 lyric-performer.cc -- implement Lyric_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "audio-item.hh"
10 #include "performer.hh"
12 class Lyric_performer : public Performer
15 TRANSLATOR_DECLARATIONS (Lyric_performer);
18 virtual bool try_music (Music *req);
19 virtual void stop_translation_timestep ();
20 virtual void create_audio_elements ();
23 Link_array<Music> lreqs_;
27 Lyric_performer::Lyric_performer ()
33 Lyric_performer::create_audio_elements ()
35 // FIXME: won't work with fancy lyrics
37 && scm_is_string (lreqs_[0]->get_property ("text"))
38 && ly_scm2string (lreqs_[0]->get_property ("text")).length ())
40 audio_ = new Audio_text (Audio_text::LYRIC,
41 ly_scm2string (lreqs_[0]->get_property ("text")));
42 Audio_element_info info (audio_, lreqs_[0]);
43 announce_element (info);
49 Lyric_performer::stop_translation_timestep ()
53 play_element (audio_);
60 Lyric_performer::try_music (Music *req)
62 if (req->is_mus_type ("lyric-event"))
70 ADD_TRANSLATOR (Lyric_performer, "", "", "lyric-event", "", "", "");