]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix quoting overrides, set etc.
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 22 Aug 2009 12:05:36 +0000 (14:05 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 30 Sep 2009 12:19:45 +0000 (14:19 +0200)
The recording-group-emulate created the list of quoted events in reverse
order, so we'll have to revert it again to be in the correct order.
Also, allow all StreamEvent to be quoted (only those in quotedEventTypes
will actually be quoted).

input/regression/quote-overrides.ly [new file with mode: 0644]
scm/part-combiner.scm

diff --git a/input/regression/quote-overrides.ly b/input/regression/quote-overrides.ly
new file mode 100644 (file)
index 0000000..07ff722
--- /dev/null
@@ -0,0 +1,42 @@
+\version "2.13.5"
+
+\header {
+  texidoc = "The @code{\\quoteDuring} command shall also quote correctly all
+  @code{\\override}, @code{\\once \\override}, @code{\\revert}, @code{\\set},
+  @code{\\unset} and @code{\\tweak} events. The first line contains the
+  original music, the second line quotes the whole music and should look
+  identical.
+
+  By default, not all events are quoted. By setting the quoted event types to
+  @code{'(StreamEvent)}, everything should be quoted."
+}
+
+mus = \relative c' {
+  % Acciaccaturas contain a slur and  \override Stem #'stroke-style
+  % Thus, we're checking \override here
+  c4 \acciaccatura d8 c4
+  % Checking \set and \unset
+  \set fontSize = #6 f
+  \unset fontSize f |
+
+  \set autoBeaming = ##f
+  % Checking \once \override
+  \once \override Stem #'thickness = #8.0 d8
+  % Checking two overrides
+  \override Stem #'thickness = #8.0 \override Stem #'stroke-style = "grace"
+  d8
+  % reverting one of them
+  \revert Stem #'thickness d8
+  % and the other
+  \revert Stem #'stroke-style c8
+
+  % checking tweaks
+  c2-\tweak #'color #red ->
+}
+\addQuote "music" \mus
+
+\new Score \with { quotedEventTypes = #'(StreamEvent) }
+{ <<
+  \new Staff \mus
+  \new Voice { \quoteDuring #"music" s1*2 }
+>> }
\ No newline at end of file
index d1dccbab7ab042d5c6baa3eb39880179f15f4bba..d42ae31aa5abc0aadee46916afc11e2167f13b13 100644 (file)
@@ -186,7 +186,8 @@ Voice-state objects
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (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"
+  "Interprets music according to odef, but stores all events in a chronological
+list, similar to the Recording_group_engraver in 2.8 and earlier"
   (let*
       ((context-list '())
        (now-mom (ly:make-moment 0 0))
@@ -210,10 +211,12 @@ Voice-state objects
                  (save-acc-listener (ly:make-listener (lambda (tev)
                                                         (if (pair? acc)
                                                             (let ((this-moment (cons (cons now-mom (ly:context-property child 'instrumentTransposition))
-                                                                                     acc)))
+                                                                                     ;; The accumulate-event-listener above creates the list of events in reverse order,
+                                                                                     ;; so we have to revert it to be in the original order again
+                                                                                     (reverse acc))))
                                                               (set-cdr! this-moment-list (cons this-moment (cdr this-moment-list)))
                                                               (set! acc '())))))))
-              (ly:add-listener accumulate-event-listener (ly:context-event-source child) 'music-event)
+              (ly:add-listener accumulate-event-listener (ly:context-event-source child) 'StreamEvent)
               (ly:add-listener save-acc-listener (ly:context-event-source global) 'OneTimeStep))))))
     (ly:add-listener new-context-listener (ly:context-events-below global) 'AnnounceNewContext)
     (ly:add-listener mom-listener (ly:context-event-source global) 'Prepare)