+ staff_ = SCM_EOL;
+ volta_span_ = 0;
+ end_volta_span_ = 0;
+}
+
+
+/*
+ TODO: this logic should be rewritten, it is buggy.
+
+ One of the problems is that we can't determine wether or not to
+ print the volta bracket during the first step, since that requires
+ acknowledging the staff.
+ */
+bool
+Volta_engraver::staff_eligible ()
+{
+ SCM doit =get_property ("voltaOnThisStaff");
+ if (scm_is_bool (doit))
+ {
+ return to_boolean (doit);
+ }
+
+
+ if (!unsmob_grob (staff_))
+ return false;
+
+ /*
+ TODO: this does weird things when you open a piece with a
+ volta spanner.
+ */
+ SCM staffs = get_property ("stavesFound");
+
+ /*
+ only put a volta on the top staff.
+
+ May be this is a bit convoluted, and we should have a single
+ volta engraver in score context or somesuch.
+
+ */
+ if (!scm_is_pair (staffs))
+ {
+ programming_error ("Huh? Volta engraver can't find staffs?");
+ return false;
+ }
+ else if (scm_car (scm_last_pair (staffs)) != staff_)
+ {
+ return false;
+ }
+ return true;