- /*
- 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 (!ly_pair_p (staffs))
- {
- programming_error ("Huh? Volta engraver can't find staffs?");
- return false;
- }
- else if (ly_car (scm_last_pair (staffs)) != staff_)
- {
- return false;
- }
+ 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.
+ Maybe 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 ("volta engraver can't find staffs");
+ return false;