]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Volta enhancements tranche 1
[lilypond.git] / ly / music-functions-init.ly
index 54ada96164a7e6697b5a79fd74885de2d0500dcb..45f9a13638396298caedd5d921269df25f1558a8 100644 (file)
@@ -449,6 +449,19 @@ given through @var{ratio}.")
     \revert NoteHead #'stencil
   #})
 
+inStaffSegno =
+#(define-music-function (parser location) ()
+   (_i "Put the segno variant 'varsegno' at this position into the staff,
+compatible with the repeat command.")
+   (make-music 'ApplyContext
+               'procedure
+               (lambda (ctx)
+                 (let ((score-ctx (ly:context-find ctx 'Score)))
+                   (if (ly:context? score-ctx)
+                     (let ((old-rc (ly:context-property score-ctx 'repeatCommands '())))
+                       (if (eq? (memq 'segno-display old-rc) #f)
+                         (ly:context-set-property! score-ctx 'repeatCommands (cons 'segno-display old-rc)))))))))
+
 instrumentSwitch =
 #(define-music-function
    (parser location name) (string?)