X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fligature-engraver.cc;h=87db230110abe864de513ea2742c408a577b63f2;hb=9f3572d98bb948c9689cd1f75401a029451fa001;hp=9922ca1c4819706cb478cf74aa55bcdb5bd2115f;hpb=04265f11d1f21416ccebd2dcaa1d903dc781b36e;p=lilypond.git diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index 9922ca1c48..87db230110 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -12,8 +12,8 @@ #include "international.hh" #include "note-head.hh" #include "rest.hh" +#include "score-context.hh" #include "spanner.hh" -#include "stream-event.hh" #include "warn.hh" #include "translator.icc" @@ -78,11 +78,16 @@ Ligature_engraver::Ligature_engraver () brew_ligature_primitive_proc = SCM_EOL; } -void -Ligature_engraver::listen_ligature (Stream_event *ev) +bool +Ligature_engraver::try_music (Music *m) { - Direction d = to_dir (ev->get_property ("span-direction")); - ASSIGN_EVENT_ONCE (events_drul_[d], ev); + if (m->is_mus_type ("ligature-event")) + { + Direction d = to_dir (m->get_property ("span-direction")); + events_drul_[d] = m; + return true; + } + return false; } void @@ -189,7 +194,7 @@ Ligature_engraver::acknowledge_note_head (Grob_info info) if (ligature_) { primitives_.push_back (info); - if (info.grob () && brew_ligature_primitive_proc != SCM_EOL) + if (info.grob () && (brew_ligature_primitive_proc != SCM_EOL)) { info.grob ()->set_property ("stencil", brew_ligature_primitive_proc); } @@ -201,7 +206,7 @@ Ligature_engraver::acknowledge_rest (Grob_info info) { if (ligature_) { - info.event_cause ()->origin ()->warning (_ ("ignoring rest: ligature may not contain rest")); + info.music_cause ()->origin ()->warning (_ ("ignoring rest: ligature may not contain rest")); prev_start_event_->origin ()->warning (_ ("ligature was started here")); // TODO: maybe better should stop ligature here rather than // ignoring the rest?