]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/volta-engraver.cc
more cleanups, convert-to-springs and code removals
[lilypond.git] / lily / volta-engraver.cc
index fefc68e7f3ef460887c5cb7aa21e2fa0e083ae32..e9f845503c04cdbc3ec49c49d892bcb89796b551 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2000--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "engraver.hh"
@@ -12,6 +12,7 @@
 #include "context.hh"
 #include "international.hh"
 #include "note-column.hh"
+#include "item.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol.hh"
 #include "text-interface.hh"
@@ -30,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 ();
@@ -91,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_)
@@ -139,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_;
@@ -173,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)
 {
@@ -189,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)
 {
@@ -202,6 +203,7 @@ Volta_engraver::acknowledge_staff_symbol (Grob_info i)
     staff_ = i.grob ()->self_scm ();
 }
 
+
 void
 Volta_engraver::finalize ()
 {
@@ -244,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 */ "");