{
Stream_event *o = props_[i];
Context *d = inf.context ();
+ SCM grob = o->get_property ("symbol");
+ if (scm_is_symbol (grob)
+ && ly_symbol2string (grob) != inf.grob ()->name ())
+ continue;
SCM proc = o->get_property ("procedure");
scm_call_3 (proc,
inf.grob ()->self_scm (),
(func music))
applyOutput =
-#(define-music-function (ctx proc) (symbol? procedure?)
- (_i "Apply function @code{proc} to every layout object in context @code{ctx}")
- (make-music 'ApplyOutputEvent
- 'procedure proc
- 'context-type ctx))
+#(define-music-function (target proc) (symbol-list-or-symbol? procedure?)
+ (_i "Apply function @code{proc} to every layout object matched by
+@var{target} which takes the form @code{Context} or @code{Context.Grob}.")
+ (let ((p (check-grob-path target (*location*) #:max 2)))
+ (if p
+ (make-music 'ApplyOutputEvent
+ 'procedure proc
+ 'context-type (car p)
+ (if (pair? (cdr p))
+ (list (cons 'symbol (cadr p)))
+ '()))
+ (make-music 'Music))))
appoggiatura =
#(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic
return str
return inner (str)
-@rule ((2, 19, 24), "music-has-type -> music-is-of-type?")
+@rule ((2, 19, 24), r"""music-has-type -> music-is-of-type?
+\applyOutput #'Context -> \applyOutput Context""")
def conv (str):
str = re.sub (r'(?<=\s|["\\()])' + "music-has-type" + r'(?=\s|["\\()])',
"music-is-of-type?", str)
+ str = re.sub (r"(\\applyOutput\s+)#'([a-zA-Z])", r"\1\2", str)
return str
# Guidelines to write rules (please keep this at the end of this file)