2 lyric-performer.cc -- implement Lyric_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "audio-item.hh"
10 #include "performer.hh"
13 class Lyric_performer : public Performer
16 TRANSLATOR_DECLARATIONS (Lyric_performer);
19 virtual bool try_music (Music *event);
20 void stop_translation_timestep ();
21 void process_music ();
24 vector<Music*> events_;
28 Lyric_performer::Lyric_performer ()
34 Lyric_performer::process_music ()
36 // FIXME: won't work with fancy lyrics
38 && scm_is_string (events_[0]->get_property ("text"))
39 && ly_scm2string (events_[0]->get_property ("text")).length ())
41 audio_ = new Audio_text (Audio_text::LYRIC,
42 ly_scm2string (events_[0]->get_property ("text")));
43 Audio_element_info info (audio_, events_[0]);
44 announce_element (info);
50 Lyric_performer::stop_translation_timestep ()
54 play_element (audio_);
61 Lyric_performer::try_music (Music *event)
63 if (event->is_mus_type ("lyric-event"))
65 events_.push_back (event);
71 #include "translator.icc"
73 ADD_TRANSLATOR (Lyric_performer, "", "", "lyric-event",