X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fhyphen-engraver.cc;h=3a1684491b208f711d75bd491b8cefdbedaaf983;hb=81abebcfecdb22d2e7b6b8e2a6d9f758aa45a13a;hp=e4f4f3a9918656e9923eabfcb711f44a0e45eecb;hpb=9f3572d98bb948c9689cd1f75401a029451fa001;p=lilypond.git diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index e4f4f3a991..3a1684491b 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2006 Glen Prideaux , + (c) 1999--2009 Glen Prideaux , Han-Wen Nienhuys , Jan Nieuwenhuizen */ @@ -13,12 +13,15 @@ #include "item.hh" #include "pointer-group-interface.hh" #include "spanner.hh" +#include "stream-event.hh" #include "warn.hh" +#include "translator.icc" + class Hyphen_engraver : public Engraver { - Music *ev_; - Music *finished_ev_; + Stream_event *ev_; + Stream_event *finished_ev_; Spanner *hyphen_; Spanner *finished_hyphen_; @@ -29,9 +32,9 @@ public: protected: DECLARE_ACKNOWLEDGER (lyric_syllable); + DECLARE_TRANSLATOR_LISTENER (hyphen); virtual void finalize (); - virtual bool try_music (Music *); void stop_translation_timestep (); void process_music (); @@ -60,14 +63,11 @@ Hyphen_engraver::acknowledge_lyric_syllable (Grob_info i) finished_hyphen_->set_bound (RIGHT, item); } -bool -Hyphen_engraver::try_music (Music *r) +IMPLEMENT_TRANSLATOR_LISTENER (Hyphen_engraver, hyphen); +void +Hyphen_engraver::listen_hyphen (Stream_event *ev) { - if (ev_) - return false; - - ev_ = r; - return true; + ASSIGN_EVENT_ONCE (ev_, ev); } void @@ -144,14 +144,19 @@ Hyphen_engraver::stop_translation_timestep () ev_ = 0; } -#include "translator.icc" - ADD_ACKNOWLEDGER (Hyphen_engraver, lyric_syllable); ADD_TRANSLATOR (Hyphen_engraver, - /* doc */ "Create lyric hyphens and " - "distance constraints between words.", - /* create */ "LyricHyphen LyricSpace", - /* accept */ "hyphen-event", - /* read */ "", - /* write */ ""); + /* doc */ + "Create lyric hyphens and distance constraints between words.", + + /* create */ + "LyricHyphen " + "LyricSpace ", + + /* read */ + "", + + /* write */ + "" + );