X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flyric-performer.cc;h=e21b7fab350bf52886e10e40e76150c87ba8ccd0;hb=7b5a9de4af9ec29ce4e7ef3166974da1dcdfc302;hp=47b3e38f6c44e0c7c407188e2880369221754d31;hpb=978fa09436484d8d670e8ee8b3eb8cfacd493675;p=lilypond.git diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 47b3e38f6c..e21b7fab35 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -3,12 +3,13 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2005 Jan Nieuwenhuizen + (c) 1997--2006 Jan Nieuwenhuizen */ #include "audio-item.hh" #include "performer.hh" -#include "music.hh" +#include "stream-event.hh" +#include "translator.icc" class Lyric_performer : public Performer { @@ -16,12 +17,11 @@ public: TRANSLATOR_DECLARATIONS (Lyric_performer); protected: - virtual bool try_music (Music *event); void stop_translation_timestep (); - void process_music (); - + void process_music (); + DECLARE_TRANSLATOR_LISTENER (lyric); private: - Link_array events_; + vector events_; Audio_text *audio_; }; @@ -51,24 +51,17 @@ Lyric_performer::stop_translation_timestep () { if (audio_) { - play_element (audio_); audio_ = 0; } events_.clear (); } -bool -Lyric_performer::try_music (Music *event) +IMPLEMENT_TRANSLATOR_LISTENER (Lyric_performer, lyric); +void +Lyric_performer::listen_lyric (Stream_event *event) { - if (event->is_mus_type ("lyric-event")) - { - events_.push (event); - return true; - } - return false; + events_.push_back (event); } -#include "translator.icc" - -ADD_TRANSLATOR (Lyric_performer, "", "", "lyric-event", +ADD_TRANSLATOR (Lyric_performer, "", "", "", "");