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: Mike Solomon
Subject: Re: Calculations for spanner before its print function is called
Date: Wed, 02 Jun 2010 20:13:37 +0200
User-agent: Microsoft-Entourage/11.4.0.080122

Good deal!  I used a callback - patch to be sent in the not-too-distant
future.

~Mike

On 6/2/10 4:26 PM, "Han-Wen Nienhuys" <address@hidden> wrote:

> On Wed, Jun 2, 2010 at 8:28 AM, Mike Solomon <address@hidden> 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.





reply via email to

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