2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2015 Jan Nieuwenhuizen <janneke@gnu.org>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "audio-item.hh"
21 #include "performer.hh"
22 #include "stream-event.hh"
23 #include "translator.icc"
25 class Lyric_performer : public Performer
28 TRANSLATOR_DECLARATIONS (Lyric_performer);
31 void stop_translation_timestep ();
32 void process_music ();
33 void listen_lyric (Stream_event *);
35 vector<Stream_event *> events_;
39 Lyric_performer::Lyric_performer (Context *c)
46 Lyric_performer::process_music ()
48 // FIXME: won't work with fancy lyrics
50 && scm_is_string (events_[0]->get_property ("text"))
51 && ly_scm2string (events_[0]->get_property ("text")).length ())
53 audio_ = new Audio_text (Audio_text::LYRIC,
54 ly_scm2string (events_[0]->get_property ("text")));
55 Audio_element_info info (audio_, events_[0]);
56 announce_element (info);
62 Lyric_performer::stop_translation_timestep ()
72 Lyric_performer::listen_lyric (Stream_event *event)
74 events_.push_back (event);
78 Lyric_performer::boot ()
80 ADD_LISTENER (Lyric_performer, lyric);
83 ADD_TRANSLATOR (Lyric_performer,