lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculations for spanner before its print function is called


From: Carl Sorensen
Subject: Re: Calculations for spanner before its print function is called
Date: Wed, 2 Jun 2010 05:32:39 -0600

On 6/2/10 5:28 AM, "Mike Solomon" <address@hidden> wrote:

> Hey lilypond developers,
>     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?

You could decrease the calculation time by setting a flag in the original
spanner (e.g. calculation_done_) and skip the calculation if it had been
done.

Somebody else will probably have a better idea.

Thanks,

Carl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]