X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fvolta-engraver.cc;h=e9f845503c04cdbc3ec49c49d892bcb89796b551;hb=29ba94b31044c22fe426305e6daf541203c8c2e7;hp=a02f8802441f9e92a5f1fda3dbd71dc03a017522;hpb=545092a25d8ca41dc90b87482474b3719f7130a9;p=lilypond.git diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index a02f880244..e9f845503c 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -3,24 +3,27 @@ source file of the GNU LilyPond music typesetter - (c) 2000--2005 Han-Wen Nienhuys + (c) 2000--2007 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 "item.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 { @@ -28,8 +31,8 @@ public: TRANSLATOR_DECLARATIONS (Volta_engraver); protected: + DECLARE_END_ACKNOWLEDGER (staff_symbol); DECLARE_ACKNOWLEDGER (staff_symbol); - DECLARE_ACKNOWLEDGER (note_column); DECLARE_ACKNOWLEDGER (bar_line); virtual void finalize (); @@ -89,7 +92,7 @@ Volta_engraver::staff_eligible () volta engraver in score context or somesuch. */ if (!scm_is_pair (staffs)) { - programming_error ("volta engraver can't find staffs"); + programming_error ("volta engraver can't find staves"); return false; } else if (scm_car (scm_last_pair (staffs)) != staff_) @@ -137,7 +140,7 @@ Volta_engraver::process_music () if (end && !volta_span_) /* fixme: be more verbose. */ - warning (_ ("can't end volta spanner")); + warning (_ ("cannot end volta spanner")); else if (end) { end_volta_span_ = volta_span_; @@ -171,13 +174,6 @@ Volta_engraver::process_music () } } -void -Volta_engraver::acknowledge_note_column (Grob_info i) -{ - if (volta_span_) - Volta_bracket_interface::add_column (volta_span_, i.grob ()); -} - void Volta_engraver::acknowledge_bar_line (Grob_info i) { @@ -187,6 +183,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) { @@ -200,6 +203,7 @@ Volta_engraver::acknowledge_staff_symbol (Grob_info i) staff_ = i.grob ()->self_scm (); } + void Volta_engraver::finalize () { @@ -242,11 +246,10 @@ Volta_engraver::stop_translation_timestep () TODO: should attach volta to paper-column if no bar is found. */ ADD_ACKNOWLEDGER (Volta_engraver, staff_symbol); -ADD_ACKNOWLEDGER (Volta_engraver, note_column); +ADD_END_ACKNOWLEDGER (Volta_engraver, staff_symbol); ADD_ACKNOWLEDGER (Volta_engraver, bar_line); ADD_TRANSLATOR (Volta_engraver, /* doc */ "Make volta brackets.", /* create */ "VoltaBracket", - /* accept */ "", /* read */ "repeatCommands voltaSpannerDuration stavesFound", /* write */ "");