X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspan-arpeggio-engraver.cc;h=38df515034ca50fe1def5e7e8a3e236ba617c665;hb=bcafa85b883969cd02a43f41ba71e1536aacec7f;hp=391ef6e4f68b8becd26f05619dd311a0d38f74d0;hpb=91821bd59959b1289f2d711509017a4dacebecd2;p=lilypond.git diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 391ef6e4f6..38df515034 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -1,11 +1,22 @@ /* - span-arpeggio-engraver.cc -- implement Span_arpeggio_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter - - (c) 2000--2005 Jan Nieuwenhuizen + Copyright (C) 2000--2011 Jan Nieuwenhuizen Han-Wen Nienhuys + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "engraver.hh" @@ -13,6 +24,7 @@ #include "pointer-group-interface.hh" #include "side-position-interface.hh" #include "staff-symbol-referencer.hh" +#include "item.hh" /** Make arpeggios that span multiple staves. Catch arpeggios, and span a @@ -30,7 +42,7 @@ protected: private: Item *span_arpeggio_; - Link_array arpeggios_; + vector arpeggios_; }; Span_arpeggio_engraver::Span_arpeggio_engraver () @@ -41,10 +53,8 @@ Span_arpeggio_engraver::Span_arpeggio_engraver () void Span_arpeggio_engraver::acknowledge_arpeggio (Grob_info info) { - if (info.origin_contexts (this).size ()) // huh? what's this test for? - { - arpeggios_.push (info.grob ()); - } + if (info.origin_contexts (this).size ()) // huh? what's this test for? + arpeggios_.push_back (info.grob ()); } void @@ -61,6 +71,7 @@ Span_arpeggio_engraver::process_acknowledged () && to_boolean (get_property ("connectArpeggios"))) { span_arpeggio_ = make_item ("Arpeggio", SCM_EOL); + span_arpeggio_->set_property ("cross-staff", SCM_BOOL_T); } } @@ -70,28 +81,29 @@ Span_arpeggio_engraver::stop_translation_timestep () if (span_arpeggio_) { /* - we do this very late, to make sure we also catch `extra' - side-pos support like accidentals. + we do this very late, to make sure we also catch `extra' + side-pos support like accidentals. */ - for (int j = 0; j < arpeggios_.size (); j++) - { - extract_grob_set (arpeggios_[j], "stems", stems); - for (int i = stems.size() ; i--;) - Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("stems"), - stems[i]); - - extract_grob_set (arpeggios_[j], "side-support-elements", sses); - for (int i = sses.size() ; i--;) - Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("side-support-elements"), - sses[i]); - - /* - 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_[j]->set_property ("print-function", SCM_EOL); - } - + for (vsize j = 0; j < arpeggios_.size (); j++) + { + extract_grob_set (arpeggios_[j], "stems", stems); + for (vsize i = 0; i < stems.size (); i++) + Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("stems"), + stems[i]); + + extract_grob_set (arpeggios_[j], "side-support-elements", sses); + for (vsize i = 0; i < sses.size (); i++) + Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("side-support-elements"), + sses[i]); + + /* + 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_[j]->set_property ("transparent", SCM_BOOL_T); + } + + span_arpeggio_->set_parent (arpeggios_[0]->get_parent (Y_AXIS), Y_AXIS); span_arpeggio_ = 0; } arpeggios_.clear (); @@ -99,10 +111,17 @@ Span_arpeggio_engraver::stop_translation_timestep () #include "translator.icc" -ADD_ACKNOWLEDGER (Span_arpeggio_engraver,arpeggio); +ADD_ACKNOWLEDGER (Span_arpeggio_engraver, arpeggio); ADD_TRANSLATOR (Span_arpeggio_engraver, - /* doc */ "", - /* create */ "Arpeggio", - /* accept */ "", - /* read */ "connectArpeggios", - /* write */ ""); + /* doc */ + "Make arpeggios that span multiple staves.", + + /* create */ + "Arpeggio ", + + /* read */ + "connectArpeggios ", + + /* write */ + "" + );