From c05010e867e94c704197efe12aa5df5ab596af46 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 1 Jan 2007 15:00:34 +0100 Subject: [PATCH] Fix #200. Add Grob_pq_engraver::process_acknowledged(). This makes correct busyGrobs setting available earlier in the interpretation cycle. --- lily/grob-pq-engraver.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index 70a0e7d217..b36028402e 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -32,7 +32,8 @@ protected: DECLARE_ACKNOWLEDGER (grob); void start_translation_timestep (); void stop_translation_timestep (); - + void process_acknowledged (); + vector started_now_; }; @@ -88,14 +89,8 @@ Grob_pq_engraver::acknowledge_grob (Grob_info gi) } void -Grob_pq_engraver::stop_translation_timestep () +Grob_pq_engraver::process_acknowledged () { - Moment now = now_mom (); - SCM start_busy = get_property ("busyGrobs"); - SCM busy = start_busy; - while (scm_is_pair (busy) && *unsmob_moment (scm_caar (busy)) == now) - busy = scm_cdr (busy); - vector_sort (started_now_, less ()); SCM lst = SCM_EOL; SCM *tail = &lst; @@ -107,12 +102,24 @@ Grob_pq_engraver::stop_translation_timestep () tail = SCM_CDRLOC (*tail); } + SCM busy = get_property ("busyGrobs"); busy = scm_merge_x (lst, busy, ly_grob_pq_less_p_proc); context ()->set_property ("busyGrobs", busy); started_now_.clear (); } +void +Grob_pq_engraver::stop_translation_timestep () +{ + Moment now = now_mom (); + SCM start_busy = get_property ("busyGrobs"); + SCM busy = start_busy; + while (scm_is_pair (busy) && *unsmob_moment (scm_caar (busy)) == now) + busy = scm_cdr (busy); + +} + void Grob_pq_engraver::start_translation_timestep () { -- 2.39.2