|
From: | Jan-Peter Voigt |
Subject: | Re: How to get Staff context-id from a grob? |
Date: | Fri, 11 Oct 2013 10:49:02 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
Hi Jan,
AFAICS its not possible to get the context from a grob. It only points to the originating music-_expression_, which might be used in several contexts. You can get the current context-id, whenever you have a context, like in an engraver or in an applyContext statement: --snip-- % find a context-id #(define (ctxid context) ; find the (let ((id (ly:context-id context)) (pc (ly:context-parent context))) (cond ((and (string? id)(> (string-length id) 0)) id) ((ly:context? pc) (ctxid pc)) (else "?") ))) % use applyContext to display the context id \new Staff = foobar \relative c'' { bes4 a \applyContext #(lambda (context) (display (ctxid context))) c b } --snip-- One might think of an engraver, which modifies grobs according to the current context-id - that should be possible. Best, Jan-Peter Am 11.10.2013 10:22, schrieb Jan Rosseel:
|
[Prev in Thread] | Current Thread | [Next in Thread] |