On Wed, Jun 2, 2010 at 8:28 AM, Mike Solomon <mike...@ufl.edu> wrote:
>    I am toying around with a new spanner, and before it prints, I need to
> do some calculations on all of its broken_intos_.  I can easily do these
> calculations in the print function by accessing the broken_into_ of
> spanner->original (), but then this calculation is done for each time print
> is called, which is N-1 times too many (where N is the length of
> broken_into_).  The code works just fine, but it is overkill: is there a way
> to perform operations on a spanner and its broken_into_'s once before the
> print function is called?

Use a property with an attached callback to either hold the
computation result. The callback/property infrastructure will make
sure it  happens only once.  What are you trying to calculate?  You
can also have a look at some of the callbacks that attach to
'positioning-done, see for example the vertical alignment spanners.

Since LilyPond is single-threaded, nothing really happens in parallel.

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to