Re: [frogs] Stepping into the code for nested properties |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: Carl Sorensen <c_sorensen@xxxxxxx>
- Subject: Re: [frogs] Stepping into the code for nested properties
- From: Neil Puttock <n.puttock@xxxxxxxxx>
- Date: Tue, 11 May 2010 22:38:42 +0100
- Cc: Rodolfo Zitellini <xhero.gm@xxxxxxxxx>, "frogs@xxxxxxxxxxx" <frogs@xxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=a1XpTI69z2BlUHFQwNmS0jD7f6Ta/E9VTBOXvwzOdGQ=; b=W0Etqrgd8uss7qNJPDRXOMbBgp9Zwh2015WV8LFEZyGETD/P2olq1S6VSX8DuB4ysp 0n4+mILZpi387JuG+SdVSAoJX0GdfoKdRE2tF+ZtPzksLTB/scqNeBFeecXVlPYqtB7d 3wk6sxbPkvnWi4jZjlxLz5BdsMgAncI7ZIKhc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JFycIljZKlYG17N4ZtEHokGRywT2WBEuPxMClq5tNkvMnzV+G8EfduFH/U+B95USer cWCgWHkOf+ZC3FuR8xSiciAHyH7wJgigfN8S6FVJ2Ck0UjGp8O+jHz/4QAvgfy3EjS6J yFK8HvdAkFCJ7XNOvoXiqcIwz/JY4D7rI2uCc=
On 11 May 2010 17:59, Carl Sorensen <c_sorensen@xxxxxxx> wrote:
> IIUC, the default values are part of the *context* properties, rather than
> part of the *grob* properties. If there is no grob property list, then the
> value of the properties is determined from the defaults in the context.
Each grob is a context property (I learned this from you during our
discussions on autobeaming. :)
The defaults for each grob are contained in all-grob-descriptions (in
scm/define-grobs.scm), which the parser uses via \grobdescriptions to
set each grob in the Global context. You can see how this works by
using \applyContext:
#(use-modules (ice-9 pretty-print))
\new Voice \relative c' {
cis d e f
\applyContext #(lambda (ctx)
(pretty-print
(ly:context-property ctx 'Accidental)))
}
Once an override comes along, the defaults are updated recursively
(updated_grob_properties ()) to carry over any overrides from parent
contexts. The overrides are prepended to a copy of the default alist,
which itself is prepended to the default settings:
#(use-modules (ice-9 pretty-print))
\new Voice \relative c' {
\override Accidental #'color = #red
cis d e f
\applyContext #(lambda (ctx)
(pretty-print
(ly:context-property ctx 'Accidental)))
}
> Also, IIUC, when you call execute_override_property, you don't *replace* the
> override, you *prepend* it. Or at least, that's what happens for non-nested
> properties. It's possible that that *doesn't* happen for nested properties,
> and may be the cause of some of the nested-property bugs.
It looks the same for nested properties, as far as I can tell.
Cheers,
Neil
---
----
Join the Frogs!