;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 2004--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2004--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-public (recording-group-emulate music odef)
- "Interprets music according to odef, but stores all events in a chronological
-list, similar to the Recording_group_engraver in 2.8 and earlier"
+ "Interpret @var{music} according to @var{odef}, but store all events
+in a chronological list, similar to the @code{Recording_group_engraver} in
+LilyPond version 2.8 and earlier."
(let*
((context-list '())
(now-mom (ly:make-moment 0 0))
m))
(define-public (determine-split-list evl1 evl2)
- "EVL1 and EVL2 should be ascending"
+ "@var{evl1} and @var{evl2} should be ascending."
(let* ((pc-debug #f)
(chord-threshold 8)
(voice-state-vec1 (make-voice-states evl1))
(previous-voice-state vs)))
(define (try-solo type start-idx current-idx)
- "Find a maximum stretch that can be marked as solo. Only set
+ "Find a maximum stretch that can be marked as solo. Only set
the mark when there are no spanners active.
return next idx to analyse.
start-idx))
(define (analyse-moment result-idx)
- "Analyse 'apart starting at RESULT-IDX. Return next index. "
+ "Analyse 'apart starting at RESULT-IDX. Return next index."
(let* ((now-state (vector-ref result result-idx))
(vs1 (current-voice-state now-state 1))
(vs2 (current-voice-state now-state 2))
(define-public (add-quotable parser name mus)
(let* ((tab (eval 'musicQuotes (current-module)))
- (context-list (recording-group-emulate (context-spec-music mus 'Voice)
- (ly:parser-lookup parser 'partCombineListener))))
- (if (pair? context-list)
- (hash-set! tab name
- ;; cdr : skip name string
- (list->vector (reverse! (cdar context-list)
- '()))))))
+ ;; If a Voice is passed, use its contents:
+ (contents (if (equal? (ly:music-property mus 'name) 'ContextSpeccedMusic)
+ (ly:music-property mus 'element)
+ mus))
+ (voicename (get-next-unique-voice-name))
+ ;; recording-group-emulate returns an assoc list, so hand it a
+ ;; proper unique context name and extract that key:
+ (context-list (recording-group-emulate (context-spec-music contents 'Voice voicename)
+ (ly:parser-lookup parser 'partCombineListener)))
+ (quote-contents (if (assoc voicename context-list)
+ (assoc-get voicename context-list)
+ '())))
+
+ (if quote-contents
+ (hash-set! tab name (list->vector (reverse! quote-contents '()))))))