X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspan-arpeggio-engraver.cc;h=b7321da6e875f75cd9e74b77ba8844ef45c2ea5e;hb=f0968255554403de5d86b7e6efff5e644cba7f7a;hp=92f6d0f42bf6f44677997c1c831922845cb21e23;hpb=6b9bfd374643d1eed1ea158777d796c57a2bcd3a;p=lilypond.git diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 92f6d0f42b..b7321da6e8 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -3,18 +3,17 @@ source file of the GNU LilyPond music typesetter - (c) 2000--2002 Jan Nieuwenhuizen + (c) 2000--2004 Jan Nieuwenhuizen + + Han-Wen Nienhuys */ #include "engraver.hh" -#include "lily-guile.hh" -#include "item.hh" #include "arpeggio.hh" #include "group-interface.hh" #include "side-position-interface.hh" #include "staff-symbol-referencer.hh" - /** Make arpeggios that span multiple staves. Catch arpeggios, and span a Span_arpeggio over them if we find more than two arpeggios. @@ -22,7 +21,7 @@ class Span_arpeggio_engraver : public Engraver { public: - TRANSLATOR_DECLARATIONS(Span_arpeggio_engraver); + TRANSLATOR_DECLARATIONS (Span_arpeggio_engraver); protected: virtual void acknowledge_grob (Grob_info); @@ -43,8 +42,8 @@ Span_arpeggio_engraver::Span_arpeggio_engraver () void Span_arpeggio_engraver::acknowledge_grob (Grob_info info) { - if (info.origin_transes (this).size () - && Arpeggio::has_interface (info.grob_)) + if (Arpeggio::has_interface (info.grob_) + && info.origin_contexts (this).size ()) // huh? what's this test for? { arpeggios_.push (info.grob_); } @@ -54,18 +53,17 @@ void Span_arpeggio_engraver::process_acknowledged_grobs () { /* - connectArpeggios is slightly brusque; we should really read a elt + connectArpeggios is slightly brusque; we should really read a grob property of the caught non-span arpeggios. That way, we can have both non-connected and connected arps in one pianostaff. - */ if (!span_arpeggio_ && arpeggios_.size () > 1 && to_boolean (get_property ("connectArpeggios"))) { - span_arpeggio_ = new Item (get_property ("Arpeggio")); - announce_grob(span_arpeggio_, SCM_EOL); + span_arpeggio_ = make_item ("Arpeggio", SCM_EOL); + } } @@ -78,23 +76,22 @@ Span_arpeggio_engraver::stop_translation_timestep () we do this very late, to make sure we also catch `extra' side-pos support like accidentals. */ - for (int i=0; i < arpeggios_.size (); i ++) + for (int i = 0; i < arpeggios_.size (); i ++) { - for (SCM s = arpeggios_[i]->get_grob_property ("stems"); - gh_pair_p (s); s = ly_cdr (s)) - Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("stems"), ly_car (s)); - for (SCM s = arpeggios_[i]->get_grob_property ("side-support-elements"); - gh_pair_p (s); s = ly_cdr (s)) - Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("side-support-elements"), ly_car (s)); + for (SCM s = arpeggios_[i]->get_property ("stems"); + scm_is_pair (s); s = scm_cdr (s)) + Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("stems"), scm_car (s)); + for (SCM s = arpeggios_[i]->get_property ("side-support-elements"); + scm_is_pair (s); s = scm_cdr (s)) + Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("side-support-elements"), scm_car (s)); /* we can't kill the children, since we don't want to the previous note to bump into the span arpeggio; so we make it transparent. */ - arpeggios_[i]->set_grob_property ("molecule-callback", SCM_EOL); + arpeggios_[i]->set_property ("print-function", SCM_EOL); } - typeset_grob (span_arpeggio_); span_arpeggio_ = 0; } arpeggios_.clear (); @@ -102,10 +99,10 @@ Span_arpeggio_engraver::stop_translation_timestep () -ENTER_DESCRIPTION(Span_arpeggio_engraver, +ADD_TRANSLATOR (Span_arpeggio_engraver, /* descr */ "", /* creats*/ "Arpeggio", -/* accepts */ "general-music", +/* accepts */ "", /* acks */ "arpeggio-interface", /* reads */ "connectArpeggios", /* write */ "");