X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fvolta-engraver.cc;h=db4d5e60cfd8bf0f1b1031bbed481ec32d4e4d9b;hb=5b73d5a6da063a36428b47addb477cf725674e2a;hp=7185b8fb4b7afc39101786299d4c014fdcba7a0a;hpb=2c22efe5a46a37065b10c3f51c5d7db00d07d318;p=lilypond.git diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 7185b8fb4b..db4d5e60cf 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -3,23 +3,26 @@ source file of the GNU LilyPond music typesetter - (c) 2000--2005 Han-Wen Nienhuys + (c) 2000--2006 Han-Wen Nienhuys */ #include "engraver.hh" + +#include "bar-line.hh" #include "context.hh" -#include "volta-bracket.hh" +#include "international.hh" #include "note-column.hh" -#include "bar-line.hh" #include "side-position-interface.hh" -#include "warn.hh" #include "staff-symbol.hh" +#include "text-interface.hh" +#include "volta-bracket.hh" +#include "warn.hh" #include "translator.icc" /* Create Volta spanners, by reading repeatCommands property, usually - set by Unfolded_repeat_iterator. + set by Volta_repeat_iterator. */ class Volta_engraver : public Engraver { @@ -27,6 +30,7 @@ public: TRANSLATOR_DECLARATIONS (Volta_engraver); protected: + DECLARE_END_ACKNOWLEDGER (staff_symbol); DECLARE_ACKNOWLEDGER (staff_symbol); DECLARE_ACKNOWLEDGER (note_column); DECLARE_ACKNOWLEDGER (bar_line); @@ -72,9 +76,7 @@ Volta_engraver::staff_eligible () { SCM doit = get_property ("voltaOnThisStaff"); if (scm_is_bool (doit)) - { - return to_boolean (doit); - } + return to_boolean (doit); if (!unsmob_grob (staff_)) return false; @@ -162,7 +164,7 @@ Volta_engraver::process_music () } if (!volta_span_ - && (scm_is_string (start_string_) || scm_is_pair (start_string_))) + && Text_interface::is_markup (start_string_)) { started_mom_ = now_mom (); @@ -188,6 +190,13 @@ Volta_engraver::acknowledge_bar_line (Grob_info i) Volta_bracket_interface::add_bar (end_volta_span_, i.item ()); } +void +Volta_engraver::acknowledge_end_staff_symbol (Grob_info i) +{ + if (i.grob ()->self_scm () == staff_) + staff_ = SCM_EOL; +} + void Volta_engraver::acknowledge_staff_symbol (Grob_info i) { @@ -201,6 +210,7 @@ Volta_engraver::acknowledge_staff_symbol (Grob_info i) staff_ = i.grob ()->self_scm (); } + void Volta_engraver::finalize () { @@ -243,11 +253,11 @@ Volta_engraver::stop_translation_timestep () TODO: should attach volta to paper-column if no bar is found. */ ADD_ACKNOWLEDGER (Volta_engraver, staff_symbol); +ADD_END_ACKNOWLEDGER (Volta_engraver, staff_symbol); ADD_ACKNOWLEDGER (Volta_engraver, note_column); ADD_ACKNOWLEDGER (Volta_engraver, bar_line); ADD_TRANSLATOR (Volta_engraver, /* doc */ "Make volta brackets.", /* create */ "VoltaBracket", - /* accept */ "", /* read */ "repeatCommands voltaSpannerDuration stavesFound", /* write */ "");