Re: [frogs] Changing subproperties with grob-set-property (working on bug #40)

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


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!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/