Re: [frogs] Changing subproperties with grob-set-property (working on bug #40) |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: frogs@xxxxxxxxxxx
- Subject: Re: [frogs] Changing subproperties with grob-set-property (working on bug #40)
- From: Neil Puttock <n.puttock@xxxxxxxxx>
- Date: Sat, 31 Oct 2009 16:28:00 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=weH6Zw7wG9ynenG/a1YZnaEUrsZnQM4LLuCRGW7sl5c=; b=nXVhK8exDcFnCOeDU9horlJhZKm2u2IddNeEnqR09DPF6UyDEqlptIWULPsOv9+g6+ c/NF8anq0VcqqyMugS+lLveoxXPokXnzCSsAlW5MJBy9YrkA6u/oJkBpccATa4Hb2XKh iiCnF9ANmpe1qqoEYFsPI+0USqC3/jzgXzKFk=
- 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 :content-type; b=WB4l5jfKvTZ3Kbq9DE9uDL6Tm5bDReD1Z6U0bTWjgev8F0sR9LjSyfT6NeZN6i2W3n W3c/FHU8/PCeOqAAIHa8REOUvp800v/jlxpcoOFWQXNGNRlxA7IyYMf98LEoT+H6mhfn WjJO0fNHfKJEw9apSS6b6zMXqfk5lrKqyKcdY=
2009/10/31 Marc Hohl <marc@xxxxxxxxxx>:
> The syntax
>
> (ly:grob-set-property! grob '(bound-details right X) right-X)
>
> won't work, however. How can I put the new value into the list?
You'll have to do some C++ hacking. There are two options here (see
the code in grob-scheme.cc):
1) amend ly_grob_set_property_x () to allow lists
2) create a new exported function ly_grob_set_nested_property_x ()
I favour the latter, since it's cleaner to implement: if you amend
ly:grob-set-property! you'll have to use a hybrid type check, since
the property path could be either a symbol or list.
> Or is my approach aiming in the wrong direction?
I think it's fine for a tweak, but a better fix would involve working
directly on the code in line-spanner.cc.
(set! right-X (- right-X 30)))
You could get a compensatory value automatically by using
ly:grob-extent on the accidental.
Whatever you decide to do, allowing nested properties in
ly:grob-set-property! would be a useful enhancement.
Regards,
Neil
---
----
Join the Frogs!