lilypond-devel
[Top][All Lists]
Advanced

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

Re: Updating translators


From: Erik Sandberg
Subject: Re: Updating translators
Date: Sat, 8 Jul 2006 22:39:39 +0200
User-agent: KMail/1.9.1

On Saturday 08 July 2006 12:21, Han-Wen Nienhuys wrote:
> Erik Sandberg schreef:
> >   B. Create a dummy listener that protects all incoming events, and
> > unprotects them at the end of each moment. The easiest way is probably to
> > let Score-level translators take care of this. This is the easiest and
> > safest solution, but also the most inefficient one.
> >   C. Create some macro trickery in translators, so that incoming events
> > are remembered and protected automatically between try_music and
> > stop_translation_timestep.
>
> go for either B or C. I'm not sure whether you can make B work, because
> it sounds as if there still might still be a small time unprotected time
> interval before the event reaches the protection engraver.

No, the event is still protected by dispatchers (how could it otherwise reach 
the protection engraver?)

Hm, for efficiency reasons, I think I'll go for a hybrid version, and let each 
translator group store a list of events, to which engraver listeners 
automatically store all incoming events.

BTW, how long should incoming stream events be protected? Is it OK to flush 
the protection buffer each moment, or should I wait until the context is 
removed?

> rather use a derived_mark() and a vector<Event*>

I think I'll use a native Scheme list.

> > -bool
> > -Arpeggio_engraver::try_music (Music *m)
> > +IMPLEMENT_TRANSLATOR_LISTENER (Arpeggio_engraver, hear_arpeggio,
> > "ArpeggioEvent"); +void Arpeggio_engraver::hear_arpeggio (Stream_event
> > *ev)
>
> can you reengineer this to have less redundancy? I would expect that you
> can get enough info from
>
>    IMPLEMENT_TRANSLATOR_LISTENER (Arpeggio_engraver, arpeggio)

I don't understand. What is redundant? I can't reacall any other place where I 
give the information that the arpeggio method wants to hear events of class 
ArpeggioEvent.

-- 
Erik




reply via email to

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