summaryrefslogtreecommitdiff
path: root/scm
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2013-03-03 12:24:32 +0100
committerDavid Kastrup <dak@gnu.org>2013-03-08 18:28:38 +0100
commitc2f316e714d49e8d9557a7148f92b53ff96db21b (patch)
treea8fbf91f0bd09ac51a4e8d0e76d179ae15fdefd1 /scm
parent692b4e4ed7c1aae4d4d53ad59c26c22f2dd2d90f (diff)
Issue 1334: A \score-lines markup list command for multi-lines embedded scores
Like the \score markup, this is not usually called by users directly as it would require something awkward along the lines of \score-lines ##{ \score { ... } #} to get this through. Instead, using \score in contexts where only markup lists are allowed will pass the action to the \score-lines markup list command. Note that there are as of yet no user-level commands spacing a markup list in a way similar to the spacing inside of a \score markup.
Diffstat (limited to 'scm')
-rwxr-xr-xscm/define-markup-commands.scm45
1 files changed, 27 insertions, 18 deletions
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index d3ad150ff6..251415d85b 100755
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -961,6 +961,31 @@ samplePath =
X-extent
Y-extent)))
+(define-markup-list-command (score-lines layout props score)
+ (ly:score?)
+ "
+This is the same as the @code{\\score} markup but delivers its
+systems as a list of lines. This is not usually called directly by
+the user. Instead, it is called when the parser encounters
+@code{\\score} in a context where only markup lists are allowed. When
+used as the argument of a toplevel @code{\\markuplist}, the result can
+be split across pages."
+ (let ((output (ly:score-embedded-format score layout)))
+
+ (if (ly:music-output? output)
+ (map
+ (lambda (paper-system)
+ ;; shift such that the refpoint of the bottom staff of
+ ;; the first system is the baseline of the score
+ (ly:stencil-translate-axis
+ (paper-system-stencil paper-system)
+ (- (car (paper-system-staff-extents paper-system)))
+ Y))
+ (vector->list (ly:paper-score-paper-systems output)))
+ (begin
+ (ly:warning (_"no systems found in \\score markup, does it have a \\layout block?"))
+ '()))))
+
(define-markup-command (score layout props score)
(ly:score?)
#:category music
@@ -1013,24 +1038,8 @@ baseline.
}
}
@end lilypond"
- (let ((output (ly:score-embedded-format score layout)))
-
- (if (ly:music-output? output)
- (let ((paper-systems
- (vector->list
- (ly:paper-score-paper-systems output))))
- (if (pair? paper-systems)
- ;; shift such that the refpoint of the bottom staff of
- ;; the first system is the baseline of the score
- (ly:stencil-translate-axis
- (stack-stencils Y DOWN baseline-skip
- (map paper-system-stencil paper-systems))
- (- (car (paper-system-staff-extents (car paper-systems))))
- Y)
- empty-stencil))
- (begin
- (ly:warning (_"no systems found in \\score markup, does it have a \\layout block?"))
- empty-stencil))))
+ (stack-stencils Y DOWN baseline-skip
+ (score-lines-markup-list layout props score)))
(define-markup-command (null layout props)
()